dilanua 8 years ago
parent f47a1cdc55
commit 36eb2e2b16

@ -23,9 +23,15 @@
{{#defineZone "device-detail-properties"}}
<table class="table table-responsive table-striped" id="members">
<tbody>
{{#if device.viewModel.vendor}}
{{#if device.viewModel.deviceIdentifier}}
<tr role="row" class="odd">
<td class="sorting_1" style="padding:10px 15px;">ID</td>
<td style="padding:10px 15px;">{{device.viewModel.deviceIdentifier}}</td>
</tr>
{{/if}}
{{#if device.viewModel.deviceName}}
<tr role="row" class="even">
<td class="sorting_1" style="padding:10px 15px; width: 1%;">Device</td>
<td class="sorting_1" style="padding:10px 15px; width: 1%;">Name</td>
<td style="padding:10px 15px;">{{device.viewModel.deviceName}}</td>
</tr>
{{/if}}
@ -37,12 +43,31 @@
</tr>
{{/if}}
{{/if}}
<tr role="row" class="even">
<td class="sorting_1" style="padding:10px 15px;">IMEI</td>
<td style="padding:10px 15px;">{{device.viewModel.imei}}</td>
</tr>
{{#if device.viewModel.udid}}
{{#if device.status}}
<tr role="row" class="even">
<td class="sorting_1" style="padding:10px 15px;">Status</td>
<td style="padding:10px 15px;">
{{#equal device.status "ACTIVE"}}<span><i class="fw fw-ok icon-success"></i>&nbsp;&nbsp;Active</span>{{/equal}}
{{#equal device.status "INACTIVE"}}<span><i class="fw fw-warning icon-warning"></i>&nbsp;&nbsp;Inactive</span>{{/equal}}
{{#equal device.status "BLOCKED"}}<span><i class="fw fw-remove icon-danger"></i>&nbsp;&nbsp;Blocked</span>{{/equal}}
{{#equal device.status "REMOVED"}}<span><i class="fw fw-delete icon-danger"></i>&nbsp;&nbsp;Removed</span>{{/equal}}
</td>
</tr>
{{/if}}
{{#if device.viewModel.owner}}
<tr role="row" class="odd">
<td class="sorting_1" style="padding:10px 15px; width: 1%;">Owner</td>
<td style="padding:10px 15px;">{{device.viewModel.owner}}</td>
</tr>
{{/if}}
{{#if device.viewModel.imei}}
<tr role="row" class="even">
<td class="sorting_1" style="padding:10px 15px;">IMEI</td>
<td style="padding:10px 15px;">{{device.viewModel.imei}}</td>
</tr>
{{/if}}
{{#if device.viewModel.udid}}
<tr role="row" class="odd">
<td class="sorting_1" style="padding:10px 15px;">UDID</td>
<td style="padding:10px 15px;">{{device.viewModel.udid}}</td>
</tr>
@ -54,20 +79,11 @@
</tr>
{{/if}}
{{#if device.viewModel.phoneNumber}}
<tr role="row" class="even">
<tr role="row" class="odd">
<td class="sorting_1" style="padding:10px 15px;">Phone Number</td>
<td style="padding:10px 15px;">{{device.viewModel.phoneNumber}}</td>
</tr>
{{/if}}
<tr role="row" class="even">
<td class="sorting_1" style="padding:10px 15px;">Status</td>
<td style="padding:10px 15px;">
{{#equal device.status "ACTIVE"}}<span><i class="fw fw-ok icon-success"></i>&nbsp;&nbsp;Active</span>{{/equal}}
{{#equal device.status "INACTIVE"}}<span><i class="fw fw-warning icon-warning"></i>&nbsp;&nbsp;Inactive</span>{{/equal}}
{{#equal device.status "BLOCKED"}}<span><i class="fw fw-remove icon-danger"></i>&nbsp;&nbsp;Blocked</span>{{/equal}}
{{#equal device.status "REMOVED"}}<span><i class="fw fw-delete icon-danger"></i>&nbsp;&nbsp;Removed</span>{{/equal}}
</td>
</tr>
</tbody>
</table>
{{/defineZone}}
@ -126,9 +142,6 @@
</h4>
</div>
<div class="panel-heading display-none-xs">Device Details</div>
<div id="loading-content" class="col-centered">
<i class="fw fw-settings fw-spin fw-2x"></i> Loading Device Details...
</div>
<div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="device_details">
<div class="panel-body ">
<div class="device-detail-body">
@ -146,61 +159,73 @@
<div>
<div class="tile-icon"><i class="fw fw-battery"></i></div>
<div class="tile-stats">
{{device.viewModel.BatteryLevel}} %
{{device.viewModel.BatteryLevel.value}} %
</div>
</div>
</div>
</div>
</div>
{{/if}}
{{#if device.viewModel.DeviceCapacity}}
{{#if device.viewModel.cpuUsage}}
<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">STORAGE</div>
<div class="tile-name">CPU Usage</div>
<div>
<div class="tile-icon"><i class="fw fw-hdd"></i></div>
<div class="tile-icon"><i class="fw fw-dashboard"></i></div>
<div class="tile-stats">
{{device.viewModel.cpuUsage.value}} %
</div>
</div>
</div>
</div>
</div>
{{/if}}
{{#if device.viewModel.ramUsage}}
<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">RAM Usage</div>
<div>
<div class="tile-icon"><i class="fw fw-hardware"></i></div>
<div class="tile-stats">
{{device.viewModel.DeviceCapacityPercentage}} %
<span class="tile-stats-free">
{{device.viewModel.AvailableDeviceCapacity}} GB Free
</span>
{{device.viewModel.ramUsage.value}} %
</div>
</div>
</div>
</div>
</div>
{{/if}}
{{#if device.viewModel.internal_memory.FreeCapacity}}
{{#if device.viewModel.internalMemory}}
<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">LOCAL STORAGE</div>
<div class="tile-name">Local Storage</div>
<div>
<div class="tile-icon"><i class="fw fw-hdd"></i></div>
<div class="tile-stats">
{{device.viewModel.internal_memory.DeviceCapacityPercentage}} %
<span class="tile-stats-free">
{{device.viewModel.internal_memory.FreeCapacity}} GB Free
</span>
{{device.viewModel.internalMemory.usage}} %
<span class="tile-stats-free">
TOTAL OF {{device.viewModel.internalMemory.total}} GB
</span>
</div>
</div>
</div>
</div>
</div>
{{/if}}
{{#if device.viewModel.external_memory.FreeCapacity}}
{{#if device.viewModel.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 class="tile-name">External Storage</div>
<div>
<div class="tile-icon"><i class="fw fw-usb-drive"></i></div>
<div class="tile-stats">
{{device.viewModel.external_memory.DeviceCapacityPercentage}} %
<span class="tile-stats-free">
{{device.viewModel.external_memory.FreeCapacity}} GB Free
</span>
{{device.viewModel.externalMemory.usage}} %
<span class="tile-stats-free">
TOTAL OF {{device.viewModel.externalMemory.total}} GB
</span>
</div>
</div>
</div>

@ -57,12 +57,12 @@ function onRequest(context) {
viewModel["imei"] = device["properties"]["IMEI"];
viewModel["model"] = device["deviceInfo"]["deviceModel"];
viewModel["vendor"] = device["deviceInfo"]["vendor"];
viewModel["owner"] = device["owner"];
var osBuildDate = device["properties"]["OS_BUILD_DATE"];
if (osBuildDate != null && osBuildDate != "0") {
viewModel["os_build_date"] = new Date(osBuildDate * 1000);
}
viewModel["internal_memory"] = {};
viewModel["external_memory"] = {};
viewModel["location"] = {
latitude: device["properties"]["LATITUDE"],
longitude: device["properties"]["LONGITUDE"]
@ -75,23 +75,48 @@ function onRequest(context) {
}
}
deviceInfo = info;
viewModel["BatteryLevel"] = device["deviceInfo"]["batteryLevel"];
viewModel["internal_memory"]["FreeCapacity"] = Math.
round(device["deviceInfo"]["internalAvailableMemory"] * 100)/100;
viewModel["internal_memory"]["DeviceCapacityPercentage"] = Math.
round(device["deviceInfo"]["internalAvailableMemory"]
/ device["deviceInfo"]["internalTotalMemory"] * 10000) / 100;
viewModel["external_memory"]["FreeCapacity"] = Math.
round(deviceInfo["EXTERNAL_AVAILABLE_MEMORY"] * 100) / 100;
viewModel["external_memory"]["DeviceCapacityPercentage"] = Math.
round(device["deviceInfo"]["externalAvailableMemory"]
/ device["deviceInfo"]["externalTotalMemory"] * 10000) / 100;
viewModel["BatteryLevel"] = {};
viewModel["BatteryLevel"]["value"] = device["deviceInfo"]["batteryLevel"];
viewModel["cpuUsage"] = {};
viewModel["cpuUsage"]["value"] = device["deviceInfo"]["cpuUsage"];
viewModel["ramUsage"] = {};
if (device["deviceInfo"]["totalRAMMemory"] != 0) {
viewModel["ramUsage"]["value"] = Math.
round((device["deviceInfo"]["totalRAMMemory"] - device["deviceInfo"]["availableRAMMemory"])
/ device["deviceInfo"]["totalRAMMemory"] * 10000) / 100;
} else {
viewModel["ramUsage"]["value"] = 0;
}
viewModel["internalMemory"] = {};
viewModel["externalMemory"] = {};
viewModel["internalMemory"]["total"] = Math.
round(device["deviceInfo"]["internalTotalMemory"] * 100) / 100;
if (device["deviceInfo"]["internalTotalMemory"] != 0) {
viewModel["internalMemory"]["usage"] = Math.
round((device["deviceInfo"]["internalTotalMemory"] - device["deviceInfo"]["internalAvailableMemory"])
/ device["deviceInfo"]["internalTotalMemory"] * 10000) / 100;
} else {
viewModel["internalMemory"]["usage"] = 0;
}
viewModel["externalMemory"]["total"] = Math.
round(device["deviceInfo"]["externalTotalMemory"] * 100) / 100;
if (device["deviceInfo"]["externalTotalMemory"] != 0) {
viewModel["externalMemory"]["usage"] = Math.
round((device["deviceInfo"]["externalTotalMemory"] - device["deviceInfo"]["externalAvailableMemory"])
/ device["deviceInfo"]["externalTotalMemory"] * 10000) / 100;
} else {
viewModel["externalMemory"]["usage"] = 0;
}
} else if (device["type"] == "windows") {
viewModel["imei"] = device["properties"]["IMEI"];
viewModel["model"] = device["properties"]["DEVICE_MODEL"];
viewModel["vendor"] = device["properties"]["VENDOR"];
viewModel["internal_memory"] = {};
viewModel["external_memory"] = {};
viewModel["internalMemory"] = {};
viewModel["externalMemory"] = {};
viewModel["location"] = {
latitude: device["properties"]["LATITUDE"],
longitude: device["properties"]["LONGITUDE"]

Loading…
Cancel
Save