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"> <div class="vital-strip">
{{#if device.deviceInfoAvailable}} {{#if device.deviceInfoAvailable}}
{{#if device.BatteryLevel}} {{#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}}
{{#if device.ramUsage}} {{#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}}
{{#if device.internalMemory}} {{#if device.internalMemory}}
<p><i class="icon fw fw-hdd fw-2x fw-rotate-90"></i> <span>{{device.internalMemory.usage}}</span> <p title="Free space / Total available internal storage" data-toggle="tooltip">
<span class="memory-amt">GB/{{device.internalMemory.total}}GB</span></p> <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}}
{{#if device.externalMemory}} {{#if device.externalMemory}}
<p><i class="icon fw fw-usb-drive fw-2x"></i> <span>{{device.externalMemory.usage}}</span> <p title="Free space / Total available external storage" data-toggle="tooltip">
<span class="memory-amt">GB/{{device.externalMemory.total}}GB</span></p> <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}} {{/if}}
{{else}} {{else}}
<p>Battery, RAM and Storage related information are not <p>Battery, RAM and Storage related information are not available yet.</p>
available yet.</p>
{{/if}} {{/if}}
</div> </div>
{{/zone}} {{/zone}}

@ -153,23 +153,22 @@ 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;
} }
viewModel["externalMemory"] = {}; viewModel["externalMemory"] = {};
viewModel["externalMemory"]["total"] = replaceNaNVal(Math.
round(filteredDeviceData["latestDeviceInfo"]["externalTotalMemory"] * 100) / 100);
if (filteredDeviceData["latestDeviceInfo"]["externalTotalMemory"] != 0) { if (filteredDeviceData["latestDeviceInfo"]["externalTotalMemory"] != 0) {
viewModel["externalMemory"]["total"] = replaceNaNVal(Math.round
(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);
/ filteredDeviceData["latestDeviceInfo"]["externalTotalMemory"] * 10000) / 100);
} else { } else {
viewModel["externalMemory"]["usage"] = 0; viewModel["externalMemory"]["usage"] = 0;
} }

Loading…
Cancel
Save