mirror of
https://repository.entgra.net/community/product-iots.git
synced 2025-09-16 23:32:19 +00:00
Merge pull request #164 from sahan-kariyawasam/master
Embedded gadget dashboard page in connectedcup analytics page
This commit is contained in:
commit
d712d07c80
@ -1,33 +1,9 @@
|
|||||||
<span id="connectedcup-details" data-devices="{{devices}}" data-devicename="{{device.name}}"
|
|
||||||
data-deviceid="{{device.deviceIdentifier}}"
|
|
||||||
data-appcontext="{{@app.context}}"></span>
|
|
||||||
<div id="connectedcup-div-chart" data-backend-api-url= {{backendApiUri}}>
|
|
||||||
<div class="chartWrapper" id="chartWrapper-temperature">
|
|
||||||
<span id="span-title">Temperature</span>
|
|
||||||
|
|
||||||
<div id="y_axis-temperature" class="custom_y_axis"></div>
|
<iframe src="{{dashboardserverURL}}/portal/gadgets/connected-cup-analytics/landing" width="100%" height="1700" frameBorder="0"></iframe>
|
||||||
<div class="legend_container">
|
|
||||||
<div id="smoother-temperature" title="Smoothing"></div>
|
|
||||||
<div id="legend-temperature"></div>
|
|
||||||
</div>
|
|
||||||
<div id="chart-temperature" class="custom_rickshaw_graph"></div>
|
|
||||||
<div id="x_axis-temperature" class="custom_x_axis"></div>
|
|
||||||
<div id="slider-temperature" class="custom_slider"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="chartWrapper" id="chartWrapper-coffeelevel">
|
<style>
|
||||||
<span id="span-title">Coffee Level</span>
|
#rangeSliderWrapper{ display: none;}
|
||||||
|
</style>
|
||||||
<div id="y_axis-coffeelevel" class="custom_y_axis"></div>
|
|
||||||
<div class="legend_container">
|
|
||||||
<div id="smoother-coffeelevel" title="Smoothing"></div>
|
|
||||||
<div id="legend-coffeelevel"></div>
|
|
||||||
</div>
|
|
||||||
<div id="chart-coffeelevel" class="custom_rickshaw_graph"></div>
|
|
||||||
<div id="x_axis-coffeelevel" class="custom_x_axis"></div>
|
|
||||||
<div id="slider-coffeelevel" class="custom_slider"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{#zone "bottomJs"}}
|
{{#zone "bottomJs"}}
|
||||||
{{js "js/connectedcup.js"}}
|
{{js "js/connectedcup.js"}}
|
||||||
|
|||||||
@ -26,7 +26,8 @@ function onRequest(context) {
|
|||||||
if (devices) {
|
if (devices) {
|
||||||
return {
|
return {
|
||||||
"devices": stringify(devices),
|
"devices": stringify(devices),
|
||||||
"backendApiUri": devicemgtProps["httpsURL"] + "/connectedcup/stats/"
|
"backendApiUri": devicemgtProps["httpsURL"] + "/connectedcup/stats/",
|
||||||
|
"dashboardserverURL" : devicemgtProps["dashboardserverURL"]
|
||||||
};
|
};
|
||||||
} else if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) {
|
} else if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) {
|
||||||
var deviceModule = require("/app/modules/device.js").deviceModule;
|
var deviceModule = require("/app/modules/device.js").deviceModule;
|
||||||
@ -34,7 +35,8 @@ function onRequest(context) {
|
|||||||
if (device && device.status != "error") {
|
if (device && device.status != "error") {
|
||||||
return {
|
return {
|
||||||
"device": device,
|
"device": device,
|
||||||
"backendApiUri": devicemgtProps["httpsURL"] + "/connectedcup/stats/" + deviceId
|
"backendApiUri": devicemgtProps["httpsURL"] + "/connectedcup/stats/" + deviceId,
|
||||||
|
"dashboardserverURL" : devicemgtProps["dashboardserverURL"]
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!");
|
response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user