From ab2332d34c815d998760f390f4746d3329c81757 Mon Sep 17 00:00:00 2001 From: inoshperera Date: Fri, 19 Jan 2018 10:55:04 +0530 Subject: [PATCH 1/3] fixing https://github.com/wso2/product-iots/issues/1604 --- .../device-view.hbs | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) 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/device-view.hbs 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/device-view.hbs index 1c5038755f..fbb4841efc 100644 --- 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/device-view.hbs +++ 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/device-view.hbs @@ -55,22 +55,33 @@
{{#if device.deviceInfoAvailable}} {{#if device.BatteryLevel}} -

{{device.BatteryLevel.value}}%

+

+ + {{device.BatteryLevel.value}}% +

{{/if}} {{#if device.ramUsage}} -

{{device.ramUsage.value}}%

+

+ + {{device.ramUsage.value}}% +

{{/if}} {{#if device.internalMemory}} -

{{device.internalMemory.usage}} - GB/{{device.internalMemory.total}}GB

+

+ + {{device.internalMemory.usage}} + GB Used/{{device.internalMemory.total}}GB Total +

{{/if}} {{#if device.externalMemory}} -

{{device.externalMemory.usage}} - GB/{{device.externalMemory.total}}GB

+

+ + {{device.externalMemory.usage}} + GB Used/{{device.externalMemory.total}}GB Total +

{{/if}} {{else}} -

Battery, RAM and Storage related information are not - available yet.

+

Battery, RAM and Storage related information are not available yet.

{{/if}}
{{/zone}} From 89c4ab3fbdadad0e93dc0eefd10dcf45a680b1f7 Mon Sep 17 00:00:00 2001 From: inoshperera Date: Fri, 19 Jan 2018 10:56:51 +0530 Subject: [PATCH 2/3] fixing https://github.com/wso2/product-iots/issues/1605 --- .../device-view.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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/device-view.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/device-view.js index 7e33ea0361..6135e0780b 100644 --- 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/device-view.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/device-view.js @@ -163,13 +163,12 @@ function onRequest(context) { } viewModel["externalMemory"] = {}; - viewModel["externalMemory"]["total"] = replaceNaNVal(Math. - round(filteredDeviceData["latestDeviceInfo"]["externalTotalMemory"] * 100) / 100); if (filteredDeviceData["latestDeviceInfo"]["externalTotalMemory"] != 0) { + viewModel["externalMemory"]["total"] = replaceNaNVal(Math.round + (filteredDeviceData["latestDeviceInfo"]["externalTotalMemory"] * 100) / 100); viewModel["externalMemory"]["usage"] = replaceNaNVal(Math. - round((filteredDeviceData["latestDeviceInfo"]["externalTotalMemory"] - - filteredDeviceData["latestDeviceInfo"]["externalAvailableMemory"]) - / filteredDeviceData["latestDeviceInfo"]["externalTotalMemory"] * 10000) / 100); + round((filteredDeviceData["latestDeviceInfo"]["externalTotalMemory"] - + filteredDeviceData["latestDeviceInfo"]["externalAvailableMemory"])* 100) /100); } else { viewModel["externalMemory"]["usage"] = 0; } From cf0d38d43e0c4e7e1024e01d6d3404d90df7d7fa Mon Sep 17 00:00:00 2001 From: inoshperera Date: Fri, 19 Jan 2018 14:19:00 +0530 Subject: [PATCH 3/3] changing the used space to free space --- .../device-view.hbs | 10 +++++----- .../device-view.js | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) 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/device-view.hbs 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/device-view.hbs index fbb4841efc..1c0081a93c 100644 --- 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/device-view.hbs +++ 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/device-view.hbs @@ -55,7 +55,7 @@
{{#if device.deviceInfoAvailable}} {{#if device.BatteryLevel}} -

+

{{device.BatteryLevel.value}}%

@@ -67,17 +67,17 @@

{{/if}} {{#if device.internalMemory}} -

+

{{device.internalMemory.usage}} - GB Used/{{device.internalMemory.total}}GB Total + GB Free/{{device.internalMemory.total}}GB Total

{{/if}} {{#if device.externalMemory}} -

+

{{device.externalMemory.usage}} - GB Used/{{device.externalMemory.total}}GB Total + GB Free/{{device.externalMemory.total}}GB Total

{{/if}} {{else}} 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/device-view.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/device-view.js index 6135e0780b..338320b3f5 100644 --- 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/device-view.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/device-view.js @@ -153,11 +153,11 @@ function onRequest(context) { } viewModel["internalMemory"] = {}; - viewModel["internalMemory"]["total"] = replaceNaNVal(Math. - round(filteredDeviceData["latestDeviceInfo"]["internalTotalMemory"] * 100) / 100); if (filteredDeviceData["latestDeviceInfo"]["internalTotalMemory"] != 0) { - viewModel["internalMemory"]["usage"] = replaceNaNVal(Math.round((filteredDeviceData["latestDeviceInfo"]["internalTotalMemory"] - - filteredDeviceData["latestDeviceInfo"]["internalAvailableMemory"]) * 100) / 100); + viewModel["internalMemory"]["total"] = replaceNaNVal(Math.round + (filteredDeviceData["latestDeviceInfo"]["internalTotalMemory"] * 100) / 100); + viewModel["internalMemory"]["usage"] = replaceNaNVal(Math.round + (filteredDeviceData["latestDeviceInfo"]["internalAvailableMemory"] * 100) / 100); } else { viewModel["internalMemory"]["usage"] = 0; } @@ -167,8 +167,8 @@ function onRequest(context) { viewModel["externalMemory"]["total"] = replaceNaNVal(Math.round (filteredDeviceData["latestDeviceInfo"]["externalTotalMemory"] * 100) / 100); viewModel["externalMemory"]["usage"] = replaceNaNVal(Math. - round((filteredDeviceData["latestDeviceInfo"]["externalTotalMemory"] - - filteredDeviceData["latestDeviceInfo"]["externalAvailableMemory"])* 100) /100); + round(filteredDeviceData["latestDeviceInfo"]["externalAvailableMemory"]* 100) + /100); } else { viewModel["externalMemory"]["usage"] = 0; }