From b6cc3147fe0068bcd5182486e5720593f1b6d019 Mon Sep 17 00:00:00 2001 From: Sahan Kariyawasam Date: Thu, 9 Jun 2016 13:12:33 +0530 Subject: [PATCH] Embedded gadget dashboard page in connectedcup analytics page --- .../analytics-view.hbs | 34 +++---------------- .../analytics-view.js | 6 ++-- 2 files changed, 9 insertions(+), 31 deletions(-) diff --git a/modules/samples/connectedcup/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.analytics-view/analytics-view.hbs b/modules/samples/connectedcup/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.analytics-view/analytics-view.hbs index b20a79d8..9632b931 100644 --- a/modules/samples/connectedcup/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.analytics-view/analytics-view.hbs +++ b/modules/samples/connectedcup/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.analytics-view/analytics-view.hbs @@ -1,34 +1,10 @@ - -
-
- Temperature -
-
-
-
-
-
-
-
-
+ -
- Coffee Level - -
-
-
-
-
-
-
-
-
-
+ {{#zone "bottomJs"}} {{js "js/connectedcup.js"}} -{{/zone}} +{{/zone}} \ No newline at end of file diff --git a/modules/samples/connectedcup/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.analytics-view/analytics-view.js b/modules/samples/connectedcup/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.analytics-view/analytics-view.js index 2583a548..5263fa38 100644 --- a/modules/samples/connectedcup/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.analytics-view/analytics-view.js +++ b/modules/samples/connectedcup/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.analytics-view/analytics-view.js @@ -26,7 +26,8 @@ function onRequest(context) { if (devices) { return { "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) { var deviceModule = require("/app/modules/device.js").deviceModule; @@ -34,7 +35,8 @@ function onRequest(context) { if (device && device.status != "error") { return { "device": device, - "backendApiUri": devicemgtProps["httpsURL"] + "/connectedcup/stats/" + deviceId + "backendApiUri": devicemgtProps["httpsURL"] + "/connectedcup/stats/" + deviceId, + "dashboardserverURL" : devicemgtProps["dashboardserverURL"] }; } else { response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!");