diff --git a/MMM-GrafanaChart.js b/MMM-GrafanaChart.js index a699251..12de00d 100755 --- a/MMM-GrafanaChart.js +++ b/MMM-GrafanaChart.js @@ -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; }, @@ -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);