diff --git a/MMM-GrafanaChart.js b/MMM-GrafanaChart.js index 77f76ee..4cedacc 100755 --- a/MMM-GrafanaChart.js +++ b/MMM-GrafanaChart.js @@ -27,13 +27,11 @@ Module.register("MMM-GrafanaChart", { iframe.width = this.config.width; iframe.height = this.config.height; 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 + "&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 + "&from=" + this.config.from + "&to=" + this.config.to;; - } + 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 + "&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 + "&from=" + this.config.from + "&to=" + this.config.to;; + } iframe.setAttribute("timestamp", new Date().getTime()); return iframe; }, @@ -52,13 +50,11 @@ Module.register("MMM-GrafanaChart", { Log.error("Tried to refresh, iFrameReload URL not set!"); return; } - 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 + "&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 + "&from=" + this.config.from + "&to=" + this.config.to; - } + 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 + "&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 + "&from=" + this.config.from + "&to=" + this.config.to; + } Log.info("attempting to update dom for iFrameReload"); Log.info('/"this/" module is: ' + this); this.updateDom(1000); diff --git a/README.md b/README.md index 60a5c60..4395c33 100755 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Change the grafana.ini to have the following settings [auth.anonymous] # enable anonymous access -enabled = true +enabled = true # specify role for unauthenticated users org_role = Viewer @@ -98,7 +98,7 @@ The following properties can be configured: height Height of the displayed chart. '150 px' or '50 %' are valid options.
Default value:"100%" - + refreshInterval Update interval of the diagram in seconds.
Default value: 900 = 15 \* 60 (four times every hour)