adding Device Details to Device-view UI

revert-dabc3590
Hasunie 8 years ago
parent fcb5a354a2
commit 965f396757

@ -167,23 +167,22 @@
<div class="device-detail-body"> <div class="device-detail-body">
<!-- device summary --> <!-- device summary -->
{{#if device.deviceInfoAvailable}} {{#if device.deviceInfoAvailable}}
{{#if device.BatteryLevel}} <!--{{#if device.BatteryLevel}}-->
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6"> <!--<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">-->
<div class="col-md-12"> <!--<div class="col-md-12">-->
<div class="wr-stats-board-tile"> <!--<div class="wr-stats-board-tile">-->
<div class="tile-name">BATTERY</div> <!--<div class="tile-name">Remaining BATTERY</div>-->
<div> <!--<div>-->
<div class="tile-icon"><i <!--<div class="tile-icon"><i-->
class="fw fw-battery"></i></div> <!--class="fw fw-battery"></i></div>-->
<div class="tile-stats"> <!--<div class="tile-stats">-->
{{device.BatteryLevel <!--{{device.BatteryLevel.value}}-->
.value}} % <!--</div>-->
</div> <!--</div>-->
</div> <!--</div>-->
</div> <!--</div>-->
</div> <!--</div>-->
</div> <!--{{/if}}-->
{{/if}}
<!--{{#if device.cpuUsage}}--> <!--{{#if device.cpuUsage}}-->
<!--<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">--> <!--<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">-->
<!--<div class="col-md-12">--> <!--<div class="col-md-12">-->
@ -203,13 +202,13 @@
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6"> <div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
<div class="col-md-12"> <div class="col-md-12">
<div class="wr-stats-board-tile"> <div class="wr-stats-board-tile">
<div class="tile-name">RAM Usage</div> <div class="tile-name">Available RAM</div>
<div> <div>
<div class="tile-icon"><i <div class="tile-icon"><i
class="fw fw-hardware"></i></div> class="fw fw-hardware"></i></div>
<div class="tile-stats"> <div class="tile-stats">
{{device.ramUsage {{device.ramUsage
.value}} % .value}} MB
</div> </div>
</div> </div>
</div> </div>
@ -220,39 +219,14 @@
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6"> <div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
<div class="col-md-12"> <div class="col-md-12">
<div class="wr-stats-board-tile"> <div class="wr-stats-board-tile">
<div class="tile-name">Local Storage</div> <div class="tile-name">Available Local Storage</div>
<div> <div>
<div class="tile-icon"><i <div class="tile-icon"><i
class="fw fw-hdd"></i> class="fw fw-hdd"></i>
</div> </div>
<div class="tile-stats"> <div class="tile-stats">
{{device.internalMemory {{device.internalMemory
.usage}} % .value}} GB
<span class="tile-stats-free">
TOTAL OF {{device.internalMemory
.total}} GB
</span>
</div>
</div>
</div>
</div>
</div>
{{/if}}
{{#if device.externalMemory}}
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
<div class="col-md-12">
<div class="wr-stats-board-tile">
<div class="tile-name">External Storage</div>
<div>
<div class="tile-icon"><i
class="fw fw-usb-drive"></i></div>
<div class="tile-stats">
{{device.externalMemory
.usage}} %
<span class="tile-stats-free">
TOTAL OF {{device.externalMemory
.total}} GB
</span>
</div> </div>
</div> </div>
</div> </div>

@ -153,42 +153,12 @@ function onRequest(context) {
viewModel["BatteryLevel"] = {}; viewModel["BatteryLevel"] = {};
viewModel["BatteryLevel"]["value"] = filteredDeviceData["latestDeviceInfo"]["batteryLevel"]; viewModel["BatteryLevel"]["value"] = filteredDeviceData["latestDeviceInfo"]["batteryLevel"];
viewModel["cpuUsage"] = {};
viewModel["cpuUsage"]["value"] = filteredDeviceData["latestDeviceInfo"]["cpuUsage"];
viewModel["ramUsage"] = {}; viewModel["ramUsage"] = {};
if (filteredDeviceData["latestDeviceInfo"]["totalRAMMemory"] != 0) { viewModel["ramUsage"]["value"] = (filteredDeviceData["latestDeviceInfo"]["availableRAMMemory"]);
viewModel["ramUsage"]["value"] = Math.
round((filteredDeviceData["latestDeviceInfo"]["totalRAMMemory"] -
filteredDeviceData["latestDeviceInfo"]["availableRAMMemory"])
/ filteredDeviceData["latestDeviceInfo"]["totalRAMMemory"] * 10000) / 100;
} else {
viewModel["ramUsage"]["value"] = 0;
}
viewModel["internalMemory"] = {}; viewModel["internalMemory"] = {};
viewModel["internalMemory"]["total"] = Math. viewModel["internalMemory"]["value"] = Math.round((filteredDeviceData["latestDeviceInfo"]["internalAvailableMemory"]) / 1024);
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["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"]) { if (!filteredDeviceData["initialDeviceInfo"] && !filteredDeviceData["latestDeviceInfo"]) {
viewModel["deviceInfoAvailable"] = false; viewModel["deviceInfoAvailable"] = false;

Loading…
Cancel
Save