diff --git a/MMM-GrafanaGauges.js b/MMM-GrafanaGauges.js index d9cdc62..636d0a0 100755 --- a/MMM-GrafanaGauges.js +++ b/MMM-GrafanaGauges.js @@ -16,7 +16,9 @@ Module.register("MMM-GrafanaGauges", { getDom: function() { var img = ''; var wrapper = document.createElement("div"); - var url = "http://" + this.config.host + ":" + this.config.port + "/dashboard-solo/db/" + this.config.dashboardname+ "?orgId=" + this.config.orgId + if (this.config.version == "6"){ + var url = "http://" + this.config.host + ":" + this.config.port + "/d-solo/" + this.config.id + "/" + this.config.dashboardname + "?orgId=" + this.config.orgId + "&fullscreen&kiosk"} + else {var url = "http://" + this.config.host + ":" + this.config.port + "/dashboard-solo/db/" + this.config.dashboardname+ "?orgId=" + this.config.orgId} for (var i = 0 ; i < this.config.showIDs.length; i++) { img += ''; } @@ -41,7 +43,9 @@ Module.register("MMM-GrafanaGauges", { return; } // Change url to force refresh? - this.src = "http://" + this.config.host + ":" + this.config.port + "/dashboard-solo/db/" + this.config.dashboardname+ "?orgId=" + this.config.orgId; + 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";} + else{this.src = "http://" + this.config.host + ":" + this.config.port + "/dashboard-solo/db/" + this.config.dashboardname+ "?orgId=" + this.config.orgId;} this.updateDom(this.config.animationSpeed); this.scheduleUpdate(this.config.refreshInterval); } diff --git a/README.md b/README.md index f03dda1..b577582 100755 --- a/README.md +++ b/README.md @@ -32,15 +32,17 @@ modules: [ position: 'top_right', // This can be any of the regions. header: 'Olive tree', config: { - host: "grafana_host", //Mandatory. See url when displaying within grafana - port: 3000, // Mandatory. - dashboardname: "flowers", // Mandatory. - orgId: 1, // Mandatory. - showIDs: [12, 8, 9, 10],// Mandatory. PanelId from the url. - width: "100%", // Optional. Default: 100% - height: "100%", // Optional. Default: 100% - refreshInterval: 900 //Optional. Default: 900 = 1/4 hour - } + version: "6", // Only add this line if you are using Grafana verison 6 or greater + id: "as8fA8na", // Only Mandartory if you are using Grafana verison 6 or greater found after /d/ in the url + host: "grafana_host", //Mandatory. See url when displaying within grafana + port: 3000, // Mandatory. + dashboardname: "flowers", // Mandatory. + orgId: 1, // Mandatory. + showIDs: [12, 8, 9, 10],// Mandatory. PanelId from the url. + width: "100%", // Optional. Default: 100% + height: "100%", // Optional. Default: 100% + refreshInterval: 900 //Optional. Default: 900 = 1/4 hour + } }, ] ````