Skip to content

Commit

Permalink
Update MMM-GrafanaChart.js
Browse files Browse the repository at this point in the history
added possibility to set "from" and "to" variables in the MM config file
  • Loading branch information
sideonshore authored Dec 20, 2022
1 parent 73fe979 commit 03c6b97
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions MMM-GrafanaChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*
* By SvenSommer https://github.com/SvenSommer
* MIT Licensed.
*/


Expand All @@ -29,10 +30,10 @@ Module.register("MMM-GrafanaChart", {
iframe.scrolling = this.config.scrolling;
if (this.config.version == "6")
{
iframe.src = "http://" + this.config.host + ":" + this.config.port + "/d-solo/" + this.config.id + "/" + this.config.dashboardname + "?orgId=" + this.config.orgId + "&panelId=" + this.config.panelId + "&fullscreen&kiosk";
iframe.src = "http://" + this.config.host + ":" + this.config.port + "/d-solo/" + this.config.id + "/" + this.config.dashboardname + "?orgId=" + this.config.orgId + "&panelId=" + this.config.panelId + "&from=" + this.config.from + "&to=" + this.config.to + "&fullscreen&kiosk";
}
else{
iframe.src = "http://" + this.config.host + ":" + this.config.port + "/dashboard-solo/db/" + this.config.dashboardname+ "?orgId=" + this.config.orgId + "&panelId=" + this.config.panelId;;
iframe.src = "http://" + this.config.host + ":" + this.config.port + "/dashboard-solo/db/" + this.config.dashboardname+ "?orgId=" + this.config.orgId + "&panelId=" + this.config.panelId + "&from=" + this.config.from + "&to=" + this.config.to;;
}
iframe.setAttribute("timestamp", new Date().getTime());
return iframe;
Expand All @@ -54,10 +55,10 @@ Module.register("MMM-GrafanaChart", {
}
if (this.config.version == "6")
{
this.src = "http://" + this.config.host + ":" + this.config.port + "/d-solo/" + this.config.id + "/" + this.config.dashboardname + "?orgId=" + this.config.orgId + "&panelId=" + this.config.panelId + "&fullscreen&kiosk";
this.src = "http://" + this.config.host + ":" + this.config.port + "/d-solo/" + this.config.id + "/" + this.config.dashboardname + "?orgId=" + this.config.orgId + "&panelId=" + this.config.panelId + "&from=" + this.config.from + "&to=" + this.config.to + "&fullscreen&kiosk";
}
else{
this.src = "http://" + this.config.host + ":" + this.config.port + "/dashboard-solo/db/" + this.config.dashboardname+ "?orgId=" + this.config.orgId + "&panelId=" + this.config.panelId;
this.src = "http://" + this.config.host + ":" + this.config.port + "/dashboard-solo/db/" + this.config.dashboardname+ "?orgId=" + this.config.orgId + "&panelId=" + this.config.panelId + "&from=" + this.config.from + "&to=" + this.config.to;
}
Log.info("attempting to update dom for iFrameReload");
Log.info('/"this/" module is: ' + this);
Expand Down

0 comments on commit 03c6b97

Please sign in to comment.