From 17ec1285718b79727abdebdf5a52240c02a68f30 Mon Sep 17 00:00:00 2001 From: charithag Date: Tue, 15 Dec 2015 20:26:21 +0530 Subject: [PATCH] Update device details page --- .../device-view.hbs | 2 +- .../device-view.js | 1 - .../public/js/device-detail.js | 14 +------------- .../device-view.js | 17 +++-------------- 4 files changed, 5 insertions(+), 29 deletions(-) diff --git a/features/device-mgt-iot-androidsense-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.device-view/device-view.hbs b/features/device-mgt-iot-androidsense-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.device-view/device-view.hbs index f0b81fcc4d..2d3127332c 100644 --- a/features/device-mgt-iot-androidsense-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.device-view/device-view.hbs +++ b/features/device-mgt-iot-androidsense-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.device-view/device-view.hbs @@ -3,7 +3,7 @@ {{#defineZone "device-detail-top"}}
-
diff --git a/features/device-mgt-iot-androidsense-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.device-view/device-view.js b/features/device-mgt-iot-androidsense-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.device-view/device-view.js index eca50c19f4..fc980ac4f9 100644 --- a/features/device-mgt-iot-androidsense-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.device-view/device-view.js +++ b/features/device-mgt-iot-androidsense-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.device-view/device-view.js @@ -8,7 +8,6 @@ function onRequest(context) { var device = deviceModule.viewDevice(deviceType, deviceId); if (device && device.status != "error") { - log.info(device); return {"device": device}; } } diff --git a/features/device-mgt-iot-androidsense-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.device-view/public/js/device-detail.js b/features/device-mgt-iot-androidsense-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.device-view/public/js/device-detail.js index f8f4f23a47..21f05a9026 100644 --- a/features/device-mgt-iot-androidsense-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.device-view/public/js/device-detail.js +++ b/features/device-mgt-iot-androidsense-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.device-view/public/js/device-detail.js @@ -22,19 +22,7 @@ var deviceType = deviceId.data("type"); var payload = [deviceIdentifier]; var operationTable; - if (deviceType == "ios") { - var serviceUrl = "/ios/operation/deviceinfo"; - } else if (deviceType == "android") { - var serviceUrl = "/mdm-android-agent/operation/device-info"; - } - if(serviceUrl){ - invokerUtil.post(serviceUrl, payload, - function(message){ - console.log(message); - }, function (message) { - console.log(message); - }); - } + $(document).ready(function(){ $(".panel-body").removeClass("hidden"); $("#loading-content").remove(); diff --git a/features/device-mgt-iot-virtualfirealarm-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.device-view/device-view.js b/features/device-mgt-iot-virtualfirealarm-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.device-view/device-view.js index aeb0c51d5d..fc980ac4f9 100644 --- a/features/device-mgt-iot-virtualfirealarm-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.device-view/device-view.js +++ b/features/device-mgt-iot-virtualfirealarm-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.device-view/device-view.js @@ -1,5 +1,5 @@ function onRequest(context) { - var log = new Log("detail.js"); + var log = new Log("device-view.js"); var deviceType = context.uriParams.deviceType; var deviceId = request.getParameter("id"); @@ -7,19 +7,8 @@ function onRequest(context) { var deviceModule = require("/app/modules/device.js").deviceModule; var device = deviceModule.viewDevice(deviceType, deviceId); - if (device) { - var viewModel = {}; - var deviceInfo = device.properties.DEVICE_INFO; - if (deviceInfo != undefined && String(deviceInfo.toString()).length > 0) { - deviceInfo = parse(stringify(deviceInfo)); - viewModel.system = device.properties.IMEI; - viewModel.machine = "Virtual Firealarm"; - viewModel.vendor = device.properties.VENDOR; - } - device.viewModel = viewModel; + if (device && device.status != "error") { + return {"device": device}; } - context.device = device; - - return context; } } \ No newline at end of file