diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/modules/constants.js b/modules/distribution/src/repository/jaggeryapps/iotserver/modules/constants.js
index b05ebef0..bd03967a 100644
--- a/modules/distribution/src/repository/jaggeryapps/iotserver/modules/constants.js
+++ b/modules/distribution/src/repository/jaggeryapps/iotserver/modules/constants.js
@@ -38,6 +38,7 @@ var FEATURE_DESCRIPTION = "featureDescription";
var PLATFORM_ANDROID = "android";
var PLATFORM_IOS = "ios";
+var DEVICE_ENROLLMENT = "enrollment";
var VENDOR_APPLE = "Apple";
var ERRORS = {
diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/modules/device.js b/modules/distribution/src/repository/jaggeryapps/iotserver/modules/device.js
index bf69621c..8dfd6fcd 100644
--- a/modules/distribution/src/repository/jaggeryapps/iotserver/modules/device.js
+++ b/modules/distribution/src/repository/jaggeryapps/iotserver/modules/device.js
@@ -167,6 +167,7 @@ deviceModule = function () {
var data = {};
//XMLHTTPRequest's GET
+ log.info(removeDeviceEndpoint);
return del(removeDeviceEndpoint, data, "text");
};
@@ -177,6 +178,7 @@ deviceModule = function () {
var data = {};
//XMLHTTPRequest's POST
+ log.info(updateDeviceEndpoint+ "?name="+device.name);
return post(updateDeviceEndpoint+ "?name="+device.name, data, "text");
};
@@ -264,7 +266,7 @@ deviceModule = function () {
properties[constants.DEVICE_VENDOR] = constants.VENDOR_APPLE;
}
deviceObject[constants.DEVICE_PROPERTIES] = properties;
-
+ deviceObject[constants.DEVICE_ENROLLMENT] = device.getDateOfEnrolment();
return deviceObject;
}
};
diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/analytics.hbs b/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/analytics.hbs
index b373cc00..5f42efc4 100644
--- a/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/analytics.hbs
+++ b/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/analytics.hbs
@@ -4,6 +4,6 @@
WSO2 DC | FireAlarm
{{/zone}}
{{#zone "body"}}
- {{unit "appbar" link="device-mgt" title="Device Management"}}
+ {{unit "appbar" link="analytics" title="Device Analytics"}}
{{unit "analytics"}}
{{/zone}}
\ No newline at end of file
diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/appbar/appbar.js b/modules/distribution/src/repository/jaggeryapps/iotserver/units/appbar/appbar.js
index cb0d769b..7d0416b2 100644
--- a/modules/distribution/src/repository/jaggeryapps/iotserver/units/appbar/appbar.js
+++ b/modules/distribution/src/repository/jaggeryapps/iotserver/units/appbar/appbar.js
@@ -9,7 +9,7 @@ function onRequest(context) {
"device-mgt": [],
"store": [],
"dashboard": [],
- "statistics" : []
+ "analytics" : []
};
var dashboardLink = {
title: "Go back to Dashboard",
@@ -35,7 +35,7 @@ function onRequest(context) {
links.profiles.push(dashboardLink);
links.store.push(dashboardLink);
links.store.push(storeLink);
- links.statistics.push(deviceMgtLink);
+ links.analytics.push(deviceMgtLink);
links['device-mgt'].push(dashboardLink);
if (user) {
diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/device-detail/device-detail.hbs b/modules/distribution/src/repository/jaggeryapps/iotserver/units/device-detail/device-detail.hbs
index 2228685c..bf566146 100644
--- a/modules/distribution/src/repository/jaggeryapps/iotserver/units/device-detail/device-detail.hbs
+++ b/modules/distribution/src/repository/jaggeryapps/iotserver/units/device-detail/device-detail.hbs
@@ -4,7 +4,9 @@
@@ -26,11 +28,13 @@
-
Device: {{device.viewModel.vendor}} {{device.properties.model}}
-
Model: {{device.viewModel.model}}
-
IMEI: {{device.viewModel.imei}}
- {{#if device.viewModel.udid}}
UDID: {{device.viewModel.udid}}
{{/if}}
- {{#if device.viewModel.phoneNumber}}
Phone Number: {{device.viewModel.phoneNumber}}
{{/if}}
+
Owner: {{device.owner}}
+
Date of Enrollment:
{{device.enrollment}}
+
+
+
+
+
@@ -93,25 +97,46 @@
-
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -136,46 +161,27 @@
-
-
-
-
- Not available yet
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/device-detail/device-detail.js b/modules/distribution/src/repository/jaggeryapps/iotserver/units/device-detail/device-detail.js
index 24169f72..769d3041 100644
--- a/modules/distribution/src/repository/jaggeryapps/iotserver/units/device-detail/device-detail.js
+++ b/modules/distribution/src/repository/jaggeryapps/iotserver/units/device-detail/device-detail.js
@@ -13,7 +13,6 @@ function onRequest(context) {
if (device){
var viewModel = {};
var deviceInfo = device.properties.DEVICE_INFO;
- log.info(deviceInfo);
if (deviceInfo != undefined && String(deviceInfo.toString()).length > 0){
deviceInfo = JSON.parse(deviceInfo);
if (device.type == "ios"){
@@ -28,7 +27,6 @@ function onRequest(context) {
viewModel.DeviceCapacityPercentage = Math.round(viewModel.DeviceCapacityUsed
/ viewModel.DeviceCapacity * 10000) /100;
}else if(device.type == "android"){
-
viewModel.imei = device.properties.IMEI;
viewModel.model = device.properties.DEVICE_MODEL;
viewModel.vendor = device.properties.VENDOR;
@@ -48,6 +46,7 @@ function onRequest(context) {
viewModel.external_memory.DeviceCapacityPercentage = Math.round(deviceInfo.EXTERNAL_AVAILABLE_MEMORY
/deviceInfo.EXTERNAL_TOTAL_MEMORY * 10000) /100;
}
+ viewModel.enrollment = device.enrollment;
device.viewModel = viewModel;
}
}
diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/device-detail/public/js/device-detail.js b/modules/distribution/src/repository/jaggeryapps/iotserver/units/device-detail/public/js/device-detail.js
index 04a2bedd..c453c889 100644
--- a/modules/distribution/src/repository/jaggeryapps/iotserver/units/device-detail/public/js/device-detail.js
+++ b/modules/distribution/src/repository/jaggeryapps/iotserver/units/device-detail/public/js/device-detail.js
@@ -16,6 +16,13 @@
* under the License.
*/
+function formatDates(){
+ $(".formatDate").each(function(){
+ var timeStamp = $(this).html();
+ $(this).html(new Date(parseInt(timeStamp)).toUTCString());
+ });
+}
+
(function () {
var deviceId = $(".device-id");
var deviceIdentifier = deviceId.data("deviceid");
@@ -35,6 +42,7 @@
$(document).ready(function(){
loadOperationBar(deviceType);
loadMap();
+ formatDates();
});
function loadMap(){
var map;
diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/device-listing/public/js/device-listing.js b/modules/distribution/src/repository/jaggeryapps/iotserver/units/device-listing/public/js/device-listing.js
index 9f91dd7e..097882cd 100644
--- a/modules/distribution/src/repository/jaggeryapps/iotserver/units/device-listing/public/js/device-listing.js
+++ b/modules/distribution/src/repository/jaggeryapps/iotserver/units/device-listing/public/js/device-listing.js
@@ -168,6 +168,7 @@ function loadDevices(searchType, searchParam) {
addDeviceSelectedClass(this);
});
attachEvents();
+ formatDates();
}
};
invokerUtil.get(serviceURL,
@@ -180,6 +181,12 @@ $(document).ready(function () {
loadDevices();
});
+function formatDates(){
+ $(".formatDate").each(function(){
+ var timeStamp = $(this).html();
+ $(this).html(new Date(parseInt(timeStamp)).toUTCString());
+ });
+}
/**
* Sorting function of users
diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/device-listing/public/templates/device-listing.hbs b/modules/distribution/src/repository/jaggeryapps/iotserver/units/device-listing/public/templates/device-listing.hbs
index 58b12d9b..767aab17 100644
--- a/modules/distribution/src/repository/jaggeryapps/iotserver/units/device-listing/public/templates/device-listing.hbs
+++ b/modules/distribution/src/repository/jaggeryapps/iotserver/units/device-listing/public/templates/device-listing.hbs
@@ -8,15 +8,16 @@