Skip to content

Commit

Permalink
Update MMM-GrafanaChart.js
Browse files Browse the repository at this point in the history
  • Loading branch information
CMALG authored Feb 13, 2020
1 parent 3490e69 commit b057f09
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions MMM-GrafanaChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ Module.register("MMM-GrafanaChart", {
iframe.style = "border:0"
iframe.width = this.config.width;
iframe.height = this.config.height;
iframe.src = "http://" + this.config.host + ":" + this.config.port + "/dashboard-solo/db/" + this.config.dashboardname+ "?orgId=" + this.config.orgId + "&panelId=" + this.config.panelId;;
if (this.config.version == "6")
{
iframe.src = "http://" + this.config.host + ":" + this.config.port + "/d/" + this.config.id + "/" + this.config.dashboardname + "?orgId=" + this.config.orgId + "&panelId=" + this.config.panelId + "&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.setAttribute("timestamp", new Date().getTime());
return iframe;
},
Expand All @@ -44,7 +50,13 @@ Module.register("MMM-GrafanaChart", {
Log.error("Tried to refresh, iFrameReload URL not set!");
return;
}
this.src = "http://" + this.config.host + ":" + this.config.port + "/dashboard-solo/db/" + this.config.dashboardname+ "?orgId=" + this.config.orgId + "&panelId=" + this.config.panelId;
if (this.config.version == "6")
{
this.src = "http://" + this.config.host + ":" + this.config.port + "/d/" + this.config.id + "/" + this.config.dashboardname + "?orgId=" + this.config.orgId + "&panelId=" + this.config.panelId + "&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;
}
Log.info("attempting to update dom for iFrameReload");
Log.info('/"this/" module is: ' + this);
this.updateDom(1000);
Expand Down

0 comments on commit b057f09

Please sign in to comment.