changing the used space to free space

revert-dabc3590
inoshperera 7 years ago
parent 89c4ab3fbd
commit cf0d38d43e

@ -55,7 +55,7 @@
<div class="vital-strip"> <div class="vital-strip">
{{#if device.deviceInfoAvailable}} {{#if device.deviceInfoAvailable}}
{{#if device.BatteryLevel}} {{#if device.BatteryLevel}}
<p title="Total used /Total available storage" data-toggle="tooltip"> <p title="Battery level percentage" data-toggle="tooltip">
<i class="icon fw fw-battery fw-2x"></i> <i class="icon fw fw-battery fw-2x"></i>
<span>{{device.BatteryLevel.value}}%</span> <span>{{device.BatteryLevel.value}}%</span>
</p> </p>
@ -67,17 +67,17 @@
</p> </p>
{{/if}} {{/if}}
{{#if device.internalMemory}} {{#if device.internalMemory}}
<p title="Total used /Total available internal storage" data-toggle="tooltip"> <p title="Free space / Total available internal storage" data-toggle="tooltip">
<i class="icon fw fw-hdd fw-2x fw-rotate-90"></i> <i class="icon fw fw-hdd fw-2x fw-rotate-90"></i>
<span>{{device.internalMemory.usage}}</span> <span>{{device.internalMemory.usage}}</span>
<span class="memory-amt">GB Used/{{device.internalMemory.total}}GB Total</span> <span class="memory-amt">GB Free/{{device.internalMemory.total}}GB Total</span>
</p> </p>
{{/if}} {{/if}}
{{#if device.externalMemory}} {{#if device.externalMemory}}
<p title="Total used /Total available external storage" data-toggle="tooltip"> <p title="Free space / Total available external storage" data-toggle="tooltip">
<i class="icon fw fw-usb-drive fw-2x"></i> <i class="icon fw fw-usb-drive fw-2x"></i>
<span>{{device.externalMemory.usage}}</span> <span>{{device.externalMemory.usage}}</span>
<span class="memory-amt">GB Used/{{device.externalMemory.total}}GB Total</span> <span class="memory-amt">GB Free/{{device.externalMemory.total}}GB Total</span>
</p> </p>
{{/if}} {{/if}}
{{else}} {{else}}

@ -153,11 +153,11 @@ function onRequest(context) {
} }
viewModel["internalMemory"] = {}; viewModel["internalMemory"] = {};
viewModel["internalMemory"]["total"] = replaceNaNVal(Math.
round(filteredDeviceData["latestDeviceInfo"]["internalTotalMemory"] * 100) / 100);
if (filteredDeviceData["latestDeviceInfo"]["internalTotalMemory"] != 0) { if (filteredDeviceData["latestDeviceInfo"]["internalTotalMemory"] != 0) {
viewModel["internalMemory"]["usage"] = replaceNaNVal(Math.round((filteredDeviceData["latestDeviceInfo"]["internalTotalMemory"] - viewModel["internalMemory"]["total"] = replaceNaNVal(Math.round
filteredDeviceData["latestDeviceInfo"]["internalAvailableMemory"]) * 100) / 100); (filteredDeviceData["latestDeviceInfo"]["internalTotalMemory"] * 100) / 100);
viewModel["internalMemory"]["usage"] = replaceNaNVal(Math.round
(filteredDeviceData["latestDeviceInfo"]["internalAvailableMemory"] * 100) / 100);
} else { } else {
viewModel["internalMemory"]["usage"] = 0; viewModel["internalMemory"]["usage"] = 0;
} }
@ -167,8 +167,8 @@ function onRequest(context) {
viewModel["externalMemory"]["total"] = replaceNaNVal(Math.round viewModel["externalMemory"]["total"] = replaceNaNVal(Math.round
(filteredDeviceData["latestDeviceInfo"]["externalTotalMemory"] * 100) / 100); (filteredDeviceData["latestDeviceInfo"]["externalTotalMemory"] * 100) / 100);
viewModel["externalMemory"]["usage"] = replaceNaNVal(Math. viewModel["externalMemory"]["usage"] = replaceNaNVal(Math.
round((filteredDeviceData["latestDeviceInfo"]["externalTotalMemory"] - round(filteredDeviceData["latestDeviceInfo"]["externalAvailableMemory"]* 100)
filteredDeviceData["latestDeviceInfo"]["externalAvailableMemory"])* 100) /100); /100);
} else { } else {
viewModel["externalMemory"]["usage"] = 0; viewModel["externalMemory"]["usage"] = 0;
} }

Loading…
Cancel
Save