Page 1 of 1
"Forecast" in Dashboard
Posted: Tue 19 Jan 2016 11:11 am
by Jeff-T
I am trying to understand a bit about HTML and customising pages. I see in the Dashboard, Index.html the line
<p><span id="Forecast"></span></p>.
Where does "Forecast" get the data?
I hope this makes sense.
Jeff
Re: "Forecast" in Dashboard
Posted: Tue 19 Jan 2016 11:46 am
by steve
The function updateDisplay in dashboard.js has this code:
Code: Select all
// Get the keys from the object and set
// the element with the same id to the value
Object.keys(data).forEach(function (key) {
var id = '#' + key;
if ($(id).length) {
$(id).text(data[key]);
}
});
So any elements on the page with an id that matches one of the keys in the json data created by MX gets updated to the value for that key. You can see the json data using this URL in your browser:
http://<MX IP address>:8998/api/data/currentdata
You'll see that "Forecast" is one of the keys in the data.
Re: "Forecast" in Dashboard
Posted: Tue 19 Jan 2016 4:05 pm
by Jeff-T
Hi Steve
Thank you.
I am trying to do a bit more customising of the Dashboard.
Jeff
Re: "Forecast" in Dashboard
Posted: Wed 20 Jan 2016 12:54 pm
by Jeff-T
This is my customised Gauges page for use on tablets on my home network.
Jeff