From 965f396757f799de2096ad456402d11bb37f1e31 Mon Sep 17 00:00:00 2001 From: Hasunie Date: Mon, 19 Dec 2016 08:21:58 +0530 Subject: [PATCH] adding Device Details to Device-view UI --- .../device-view.hbs | 66 ++++++------------- .../device-view.js | 34 +--------- 2 files changed, 22 insertions(+), 78 deletions(-) diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.device-view/device-view.hbs b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.device-view/device-view.hbs index 492a0af5e..6030939ef 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.device-view/device-view.hbs +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.device-view/device-view.hbs @@ -167,23 +167,22 @@
{{#if device.deviceInfoAvailable}} - {{#if device.BatteryLevel}} -
-
-
-
BATTERY
-
-
-
- {{device.BatteryLevel - .value}} % -
-
-
-
-
- {{/if}} + + + + + + + + + + + + + + + + @@ -203,13 +202,13 @@
-
RAM Usage
+
Available RAM
{{device.ramUsage - .value}} % + .value}} MB
@@ -220,39 +219,14 @@
-
Local Storage
+
Available Local Storage
{{device.internalMemory - .usage}} % - - TOTAL OF {{device.internalMemory - .total}} GB - -
-
-
-
-
- {{/if}} - {{#if device.externalMemory}} -
-
-
-
External Storage
-
-
-
- {{device.externalMemory - .usage}} % - - TOTAL OF {{device.externalMemory - .total}} GB - + .value}} GB
diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.device-view/device-view.js b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.device-view/device-view.js index 1400f4429..d1de7c960 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.device-view/device-view.js +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.device-view/device-view.js @@ -153,42 +153,12 @@ function onRequest(context) { viewModel["BatteryLevel"] = {}; viewModel["BatteryLevel"]["value"] = filteredDeviceData["latestDeviceInfo"]["batteryLevel"]; - viewModel["cpuUsage"] = {}; - viewModel["cpuUsage"]["value"] = filteredDeviceData["latestDeviceInfo"]["cpuUsage"]; - viewModel["ramUsage"] = {}; - if (filteredDeviceData["latestDeviceInfo"]["totalRAMMemory"] != 0) { - viewModel["ramUsage"]["value"] = Math. - round((filteredDeviceData["latestDeviceInfo"]["totalRAMMemory"] - - filteredDeviceData["latestDeviceInfo"]["availableRAMMemory"]) - / filteredDeviceData["latestDeviceInfo"]["totalRAMMemory"] * 10000) / 100; - } else { - viewModel["ramUsage"]["value"] = 0; - } + viewModel["ramUsage"]["value"] = (filteredDeviceData["latestDeviceInfo"]["availableRAMMemory"]); viewModel["internalMemory"] = {}; - viewModel["internalMemory"]["total"] = Math. - round(filteredDeviceData["latestDeviceInfo"]["internalTotalMemory"] * 100) / 100; - if (filteredDeviceData["latestDeviceInfo"]["internalTotalMemory"] != 0) { - viewModel["internalMemory"]["usage"] = Math. - round((filteredDeviceData["latestDeviceInfo"]["internalTotalMemory"] - - filteredDeviceData["latestDeviceInfo"]["internalAvailableMemory"]) - / filteredDeviceData["latestDeviceInfo"]["internalTotalMemory"] * 10000) / 100; - } else { - viewModel["internalMemory"]["usage"] = 0; - } + viewModel["internalMemory"]["value"] = Math.round((filteredDeviceData["latestDeviceInfo"]["internalAvailableMemory"]) / 1024); - viewModel["externalMemory"] = {}; - viewModel["externalMemory"]["total"] = Math. - round(filteredDeviceData["latestDeviceInfo"]["externalTotalMemory"] * 100) / 100; - if (filteredDeviceData["latestDeviceInfo"]["externalTotalMemory"] != 0) { - viewModel["externalMemory"]["usage"] = Math. - round((filteredDeviceData["latestDeviceInfo"]["externalTotalMemory"] - - filteredDeviceData["latestDeviceInfo"]["externalAvailableMemory"]) - / filteredDeviceData["latestDeviceInfo"]["externalTotalMemory"] * 10000) / 100; - } else { - viewModel["externalMemory"]["usage"] = 0; - } } if (!filteredDeviceData["initialDeviceInfo"] && !filteredDeviceData["latestDeviceInfo"]) { viewModel["deviceInfoAvailable"] = false;