diff --git a/modules/distribution/src/repository/jaggeryapps/iot/units/alldevices/alldevices.hbs b/modules/distribution/src/repository/jaggeryapps/iot/units/alldevices/alldevices.hbs
index 86d5fac3..8e3cdc7d 100644
--- a/modules/distribution/src/repository/jaggeryapps/iot/units/alldevices/alldevices.hbs
+++ b/modules/distribution/src/repository/jaggeryapps/iot/units/alldevices/alldevices.hbs
@@ -9,12 +9,6 @@
-
- {{#each devices.devices}}
- {{name}}
- {{id}}
- {{/each}}
-
@@ -25,76 +19,26 @@
-
-
-
- 001 |
- RaspberryPi |
-
-
- |
-
-
- 002 |
- ArduinoUno |
-
-
- |
-
-
- 003 |
- BeagleBone |
-
-
- |
-
-
- 003 |
- Fire Alarm |
-
-
- |
-
+
diff --git a/modules/distribution/src/repository/jaggeryapps/iot/units/alldevices/alldevices.js b/modules/distribution/src/repository/jaggeryapps/iot/units/alldevices/alldevices.js
index 6cde4b35..1f225215 100644
--- a/modules/distribution/src/repository/jaggeryapps/iot/units/alldevices/alldevices.js
+++ b/modules/distribution/src/repository/jaggeryapps/iot/units/alldevices/alldevices.js
@@ -1,5 +1,5 @@
function onRequest(context) {
- context.myDevicePath = "mydevice";
+ context.myDevicePath = "/iot/mydevice";
var constants = require("/modules/constants.js");
var httpReq = new XMLHttpRequest();
@@ -7,28 +7,29 @@ function onRequest(context) {
var endPoint = "http://localhost:9763/iotdevices/DevicesManager/getDevices?username=" + user.username;
//
httpReq.open("GET", endPoint, false);
- log.info("%%%%");
- log.info(httpReq.response);
-
- context.devices = {
- "devices": [
- {"name":"device1",
- "id" : 1234
- },
- {"name":"device2",
- "id" : 5678}
- ]
- };
+ httpReq.setRequestHeader("Content-type","application/json");
+ httpReq.send();
+ //
+ context.devices = JSON.parse(httpReq.responseText);
return context;
}
-//
//{
-// "devices": [
-// {"name":"device1",
-// "id" : 1234
-// },
-// {"name":"device2",
-// "id" : 5678}
+// "device": [
+// {
+// "dateOfEnrolment": 1432978481443,
+// "dateOfLastUpdate": 1432978481443,
+// "deviceIdentifier": "qhnva32dy2ck",
+// "deviceTypeId": 1,
+// "id": 1,
+// "name": "rasikas_firealarm_qhn",
+// "owner": "rasika",
+// "properties": {
+// "name": "DEVICE_NAME",
+// "value": "rasikas_firealarm_qhn"
+// },
+// "status": "ACTIVE",
+// "type": "firealarm"
+// }
//]
//}
diff --git a/modules/distribution/src/repository/jaggeryapps/iot/units/appbar/appbar.hbs b/modules/distribution/src/repository/jaggeryapps/iot/units/appbar/appbar.hbs
index 2f33f8c3..c7279a1f 100644
--- a/modules/distribution/src/repository/jaggeryapps/iot/units/appbar/appbar.hbs
+++ b/modules/distribution/src/repository/jaggeryapps/iot/units/appbar/appbar.hbs
@@ -25,6 +25,9 @@
GUIDE
SUPPORT
COMMUNITY
+ {{#if user}}
+ MY DEVICES
+ {{/if}}
diff --git a/modules/distribution/src/repository/jaggeryapps/iot/units/firealarm/firealarm.hbs b/modules/distribution/src/repository/jaggeryapps/iot/units/firealarm/firealarm.hbs
index ffbde56e..335eba52 100644
--- a/modules/distribution/src/repository/jaggeryapps/iot/units/firealarm/firealarm.hbs
+++ b/modules/distribution/src/repository/jaggeryapps/iot/units/firealarm/firealarm.hbs
@@ -40,10 +40,6 @@
-
diff --git a/modules/distribution/src/repository/jaggeryapps/iot/units/mydevice/mydevice.hbs b/modules/distribution/src/repository/jaggeryapps/iot/units/mydevice/mydevice.hbs
index b2613adb..1a6342f8 100644
--- a/modules/distribution/src/repository/jaggeryapps/iot/units/mydevice/mydevice.hbs
+++ b/modules/distribution/src/repository/jaggeryapps/iot/units/mydevice/mydevice.hbs
@@ -34,8 +34,8 @@
-
-
diff --git a/modules/distribution/src/repository/jaggeryapps/iot/units/mydevice/public/js/graph_util.js b/modules/distribution/src/repository/jaggeryapps/iot/units/mydevice/public/js/graph_util.js
index f6b78fa4..4d03b5ed 100644
--- a/modules/distribution/src/repository/jaggeryapps/iot/units/mydevice/public/js/graph_util.js
+++ b/modules/distribution/src/repository/jaggeryapps/iot/units/mydevice/public/js/graph_util.js
@@ -44,8 +44,6 @@ $('#date-range1').dateRangePicker(configObject)
$('#btn-draw-graphs').on('click', function () {
var deviceId = $('#device-id').val();
- console.log(deviceId);
- console.log(dateRange.date1.toString());
getStats(deviceId, fromDate, toDate);
})
@@ -63,10 +61,6 @@ function getStats(deviceId, from, to) {
requestData['to'] = to;
}
-
- console.log("from: "+from);
- console.log("to:" +to);
-
var getStatsRequest = $.ajax({
url: "api/stats",
method: "GET",