@@ -120,22 +130,22 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -143,7 +153,8 @@
-
+
Not available yet
@@ -162,27 +174,26 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
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 c453c889..a86523fd 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,54 +16,13 @@
* under the License.
*/
-function formatDates(){
- $(".formatDate").each(function(){
+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");
- var deviceType = deviceId.data("type");
- var payload = [deviceIdentifier];
- if (deviceType == "ios") {
- var serviceUrl = "/ios/operation/deviceinfo";
- } else if (deviceType == "android") {
- var serviceUrl = "/mdm-android-agent/operation/device-info";
- }
- invokerUtil.post(serviceUrl, payload,
- function(message){
- console.log(message);
- }, function (message) {
- console.log(message);
- });
- $(document).ready(function(){
- loadOperationBar(deviceType);
- loadMap();
- formatDates();
- });
- function loadMap(){
- var map;
- function initialize() {
- var mapOptions = {
- zoom: 18
- };
- var lat = 6.9098591;
- var long = 79.8523753;
- map = new google.maps.Map(document.getElementById('device-location'),
- mapOptions);
-
- var pos = new google.maps.LatLng(lat,
- long);
- var marker = new google.maps.Marker({
- position: pos,
- map: map
- });
-
- map.setCenter(pos);
- }
- google.maps.event.addDomListener(window, 'load', initialize);
- }
-}());
+$(document).ready(function () {
+ formatDates();
+});
\ No newline at end of file
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 acc0984c..c3b570ae 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
@@ -187,7 +187,7 @@ function loadDevices(searchType, searchParam) {
addDeviceSelectedClass(this);
});
attachEvents();
- //formatDates();
+ formatDates();
}
};
invokerUtil.get(serviceURL,
@@ -374,81 +374,86 @@ function attachEvents() {
* when a user clicks on "Group" link
* on Device Management page in WSO2 MDM Console.
*/
- $("a.group-device-link").click(function () {
- var deviceId = $(this).data("deviceid");
- var deviceType = $(this).data("devicetype");
- var endPoint = "/iotserver/api/group/all";
+ if (groupId && groupId != "0") {
+ $("a.group-device-link").remove();
+ }else{
+ $("a.group-device-link").click(function () {
+ var deviceId = $(this).data("deviceid");
+ var deviceType = $(this).data("devicetype");
+ var endPoint = "/iotserver/api/group/all";
- $(modalPopupContent).html($('#group-device-modal-content').html());
- $('#user-groups').html("Loading...");
- $("a#group-device-yes-link").hide();
- showPopup();
+ $(modalPopupContent).html($('#group-device-modal-content').html());
+ $('#user-groups').html("Loading...");
+ $("a#group-device-yes-link").hide();
+ showPopup();
- invokerUtil.get(endPoint,
- function (data, txtStatus, jqxhr) {
- var groups = JSON.parse(data);
- var status = jqxhr.status;
- if (status == 200) {
- if (groups.length <= 0) {
- $('#user-groups').html("There is no any groups available");
- return;
- }
- var str = '
';
- $('#user-groups').html(str);
- $("a#group-device-yes-link").show();
- $("a#group-device-yes-link").click(function () {
- var selectedGroupId = $('#assign-group-selector').val();
- endPoint = "/iotserver/api/group/id/" + selectedGroupId + "/assign";
- var device = {"deviceId": deviceId, "deviceType": deviceType};
- invokerUtil.post(
- endPoint,
- device,
- function (data, txtStatus, jqxhr) {
- var status = jqxhr.status;
- if (status == 200) {
- $(modalPopupContent).html($('#group-associate-device-200-content').html());
- $("a#group-associate-device-200-link").click(function () {
- hidePopup();
- });
- } else if (status == 400) {
- $(modalPopupContent).html($('#device-400-content').html());
- $("a#device-400-link").click(function () {
- hidePopup();
- });
- } else if (status == 403) {
- $(modalPopupContent).html($('#device-403-content').html());
- $("a#device-403-link").click(function () {
- hidePopup();
- });
- } else if (status == 409) {
- $(modalPopupContent).html($('#device-409-content').html());
- $("a#device-409-link").click(function () {
+ invokerUtil.get(endPoint,
+ function (data, txtStatus, jqxhr) {
+ var groups = JSON.parse(data);
+ var status = jqxhr.status;
+ if (status == 200) {
+ if (groups.length <= 0) {
+ $('#user-groups').html("There is no any groups available");
+ return;
+ }
+ var str = '
';
+ $('#user-groups').html(str);
+ $("a#group-device-yes-link").show();
+ $("a#group-device-yes-link").click(function () {
+ var selectedGroupId = $('#assign-group-selector').val();
+ endPoint = "/iotserver/api/group/id/" + selectedGroupId + "/assign";
+ var device = {"deviceId": deviceId, "deviceType": deviceType};
+ invokerUtil.post(
+ endPoint,
+ device,
+ function (data, txtStatus, jqxhr) {
+ var status = jqxhr.status;
+ if (status == 200) {
+ $(modalPopupContent).html($('#group-associate-device-200-content').html());
+ $("a#group-associate-device-200-link").click(function () {
+ hidePopup();
+ });
+ } else if (status == 400) {
+ $(modalPopupContent).html($('#device-400-content').html());
+ $("a#device-400-link").click(function () {
+ hidePopup();
+ });
+ } else if (status == 403) {
+ $(modalPopupContent).html($('#device-403-content').html());
+ $("a#device-403-link").click(function () {
+ hidePopup();
+ });
+ } else if (status == 409) {
+ $(modalPopupContent).html($('#device-409-content').html());
+ $("a#device-409-link").click(function () {
+ hidePopup();
+ });
+ }
+ },
+ function () {
+ $(modalPopupContent).html($('#device-unexpected-error-content').html());
+ $("a#device-unexpected-error-link").click(function () {
hidePopup();
});
- }
- },
- function () {
- $(modalPopupContent).html($('#device-unexpected-error-content').html());
- $("a#device-unexpected-error-link").click(function () {
- hidePopup();
});
- });
+ });
+ }
+ },
+ function () {
+ $(modalPopupContent).html($('#device-unexpected-error-content').html());
+ $("a#device-unexpected-error-link").click(function () {
+ hidePopup();
});
- }
- },
- function () {
- $(modalPopupContent).html($('#device-unexpected-error-content').html());
- $("a#device-unexpected-error-link").click(function () {
- hidePopup();
});
- });
- $("a#group-device-cancel-link").click(function () {
- hidePopup();
+ $("a#group-device-cancel-link").click(function () {
+ hidePopup();
+ });
});
- });
+
+ }
}
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 f1fe2032..23eb0086 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
@@ -14,10 +14,10 @@
{{name}}
Device Type: {{type}}
- Date of Enrollment: {{dateOfEnrolment}}
+ Date of Enrollment: {{enrolmentInfo.dateOfEnrolment}}
-
{{owner}}
+
{{enrolmentInfo.owner}}
{{status}}