How to include another HTML file on the end of another?
Basically I want to create a dashboard where I have different data. In the page1.html or home.html I would setup all of the data from XID's and then load a common HTML that would display the data. This would save me having to duplicate all the HTML pages and makes making changes to them all easy.
Is this possible?
I did find this but not sure if this will work with the dashboards?
Jared Wiltshire last edited by Jared Wiltshire
Hi v8dave, could you tell me a bit more about what exactly you are trying to achieve? I think we can help you out here but I'm not clear exactly on how you want your page to behave..
I will say that I would stay well clear of the instructions in that w3schools link.
To just include a HTML file AngularJS does have a similar functionality - https://docs.angularjs.org/api/ng/directive/ngInclude
But I think that what you may actually want is to add another UI router view - http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.directive:ui-view
This means adding another state to your app.js
Thanks for the advice on w3schools.
What I am trying to do is use the same webpage for all of the remote devices. What I have done is give each one a unique device ID and then I have created a copy of each http receiver and this means they all have the same data point names but different XID values.
What I want is to create a page with the XID's so that the point names are now available for the included file. eg.
<ma-get-point-value point-xid="DP_997239" point="oilbbl1" realtime="realtime"></ma-get-point-value> <ma-get-point-value point-xid="DP_873659" point="oilbbl2" realtime="realtime"></ma-get-point-value> <ma-get-point-value point-xid="DP_910714" point="waterbbl1" realtime="realtime"></ma-get-point-value>
The point names are now allocated from the XID. Each page would have their own and I can hopefully import the rest of the page with would use them.
Does this make sense?
JoelHaggar last edited by
I think what you are looking for is the templating features we have created. This is actually a very common use case. Check in the examples for this page: /modules/dashboards/web/mdAdmin/#/dashboard/examples/point-arrays/templating
The idea is that you query for a group of data points and then use filters on the point names to bind each data point to each widget you are using. This way you can have a single page and easily switch from one device to the other all using the same HTML.
I can see how to use this where the user can select the device. I would like to preset the device on entry to that page.
What we are doing with Mango is to have a number of different clients upload the data from the remote sites and when they log in, they get their own dashboard view and this only shows their data to them. We don't want them having access to any other client data.
We have modified the dashboard based on permissions so that they cannot access the events page and thereby seeing all the data points. Their only view is via the Dashboard.
JoelHaggar last edited by
You could do that a few ways.
Use the username or users group in the RQL query for the data points.
Do an RQL query to get a list of unique Device Names the users has permissions for and then use those in the drop down. It would default to the first one but if they had permissions for more then one they could still use a selector.
Put all the data points in a point hierarchy folder that matches the username and use the username in a point hierarchy query.
There are probably more ways but I think this should give you some ideas. This is probably something we could put some examples together on in the coming weeks.