Skip to content

Commit

Permalink
Merge pull request MagicMirrorModules#12 from janre/master
Browse files Browse the repository at this point in the history
fix grafana path and add scrolling parameter
  • Loading branch information
SvenSommer authored Aug 20, 2021
2 parents 1756f8d + c1e5393 commit 73fe979
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions MMM-GrafanaChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Module.register("MMM-GrafanaChart", {
defaults: {
height:"100%",
width:"100%",
scrolling:"no",
refreshInterval: 900
},

Expand All @@ -25,9 +26,10 @@ 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;;
Expand All @@ -52,7 +54,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;
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
},
Expand Down

0 comments on commit 73fe979

Please sign in to comment.