Skip to content

Commit

Permalink
fix indentation problems and one trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
klaernie committed Apr 2, 2023
1 parent 55c0a8c commit a24450a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
24 changes: 10 additions & 14 deletions MMM-GrafanaChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -98,7 +98,7 @@ The following properties can be configured:
<td><code>height</code></td>
<td>Height of the displayed chart. <code>'150 px'</code> or <code>'50 %'</code> are valid options. <br><b>Default value:<code>"100%"</code></b></td>
</tr>
<tr>
<tr>
<td><code>refreshInterval</code></td>
<td>Update interval of the diagram in seconds.
<br><b>Default value:</b> <code>900</code> = 15 \* 60 (four times every hour)
Expand Down

0 comments on commit a24450a

Please sign in to comment.