Merge pull request #868 from inoshperera/master

Device information in device view are incorrect and also needs tooltips
revert-dabc3590
inoshperera 7 years ago committed by GitHub
commit 723e41ce7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -55,22 +55,33 @@
<div class="vital-strip">
{{#if device.deviceInfoAvailable}}
{{#if device.BatteryLevel}}
<p><i class="icon fw fw-battery fw-2x"></i> <span>{{device.BatteryLevel.value}}%</span></p>
<p title="Battery level percentage" data-toggle="tooltip">
<i class="icon fw fw-battery fw-2x"></i>
<span>{{device.BatteryLevel.value}}%</span>
</p>
{{/if}}
{{#if device.ramUsage}}
<p><i class="icon fw fw-hardware fw-2x fw-rotate-90"></i> <span>{{device.ramUsage.value}}%</span></p>
<p title="RAM usage percentage" data-toggle="tooltip">
<i class="icon fw fw-hardware fw-2x fw-rotate-90"></i>
<span>{{device.ramUsage.value}}%</span>
</p>
{{/if}}
{{#if device.internalMemory}}
<p><i class="icon fw fw-hdd fw-2x fw-rotate-90"></i> <span>{{device.internalMemory.usage}}</span>
<span class="memory-amt">GB/{{device.internalMemory.total}}GB</span></p>
<p title="Free space / Total available internal storage" data-toggle="tooltip">
<i class="icon fw fw-hdd fw-2x fw-rotate-90"></i>
<span>{{device.internalMemory.usage}}</span>
<span class="memory-amt">GB Free/{{device.internalMemory.total}}GB Total</span>
</p>
{{/if}}
{{#if device.externalMemory}}
<p><i class="icon fw fw-usb-drive fw-2x"></i> <span>{{device.externalMemory.usage}}</span>
<span class="memory-amt">GB/{{device.externalMemory.total}}GB</span></p>
<p title="Free space / Total available external storage" data-toggle="tooltip">
<i class="icon fw fw-usb-drive fw-2x"></i>
<span>{{device.externalMemory.usage}}</span>
<span class="memory-amt">GB Free/{{device.externalMemory.total}}GB Total</span>
</p>
{{/if}}
{{else}}
<p>Battery, RAM and Storage related information are not
available yet.</p>
<p>Battery, RAM and Storage related information are not available yet.</p>
{{/if}}
</div>
{{/zone}}

@ -153,23 +153,22 @@ 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;
}
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"]["externalAvailableMemory"]* 100)
/100);
} else {
viewModel["externalMemory"]["usage"] = 0;
}

Loading…
Cancel
Save