From 7dbcf5ebf58cc633313b866d63d90d086141e0e1 Mon Sep 17 00:00:00 2001 From: jr Date: Fri, 20 Aug 2021 10:55:42 +0200 Subject: [PATCH] fix grafana path and add scrolling parameter --- MMM-GrafanaChart.js | 7 +++++-- README.md | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/MMM-GrafanaChart.js b/MMM-GrafanaChart.js index 12de00d..718729b 100755 --- a/MMM-GrafanaChart.js +++ b/MMM-GrafanaChart.js @@ -11,6 +11,7 @@ Module.register("MMM-GrafanaChart", { defaults: { height:"100%", width:"100%", + scrolling:"no", refreshInterval: 900 }, @@ -25,9 +26,11 @@ Module.register("MMM-GrafanaChart", { iframe.style = "border:0" 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/" + 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 + "&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;; @@ -52,7 +55,7 @@ Module.register("MMM-GrafanaChart", { } 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"; + 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 + "&panelId=" + this.config.panelId; diff --git a/README.md b/README.md index c4d8426..df95326 100755 --- a/README.md +++ b/README.md @@ -58,6 +58,7 @@ modules: [ panelId: 2, // Mandatory. width: "100%", // Optional. Default: 100% height: "100%", // Optional. Default: 100% + scrolling: "yes", // Optional. Default: no refreshInterval: 900 //Optional. Default: 900 = 1/4 hour } },