From 740bb976fa4232359d87fc99152a3ee5f5bfb8f2 Mon Sep 17 00:00:00 2001 From: Kamidu Sachith Punchihewa Date: Sun, 19 Feb 2017 19:10:20 +0530 Subject: [PATCH] adding location operation to device view page --- .../public/js/device-detail.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/public/js/device-detail.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/public/js/device-detail.js index 449dec84c0..498aa73d2d 100755 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/public/js/device-detail.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/public/js/device-detail.js @@ -26,12 +26,14 @@ var InitiateViewOption = null; var payload = [deviceIdentifier]; var operationTable; var serviceUrl; + var serviceUrlLocal = "/api/device-mgt/android/v1.0/admin/devices/location"; if (deviceType == "ios") { serviceUrl = "/ios/operation/deviceinfo"; } else if (deviceType == "android") { //var serviceUrl = "/mdm-android-agent/operation/device-info"; serviceUrl = "/api/device-mgt/android/v1.0/admin/devices/info"; + serviceUrlLocal = "/api/device-mgt/android/v1.0/admin/devices/location"; } if (serviceUrl) { @@ -49,6 +51,23 @@ var InitiateViewOption = null; $(".panel-body").append(defaultInnerHTML); } ); + + + invokerUtil.post( + serviceUrlLocal, + payload, + // success-callback + function () { + $(".panel-body").show(); + }, + // error-callback + function () { + var defaultInnerHTML = + "

Device data may not have been updated. Please refresh to try again.

"; + $(".panel-body").append(defaultInnerHTML); + } + ); + }