dilanua 8 years ago
parent f47a1cdc55
commit 36eb2e2b16

@ -23,9 +23,15 @@
{{#defineZone "device-detail-properties"}} {{#defineZone "device-detail-properties"}}
<table class="table table-responsive table-striped" id="members"> <table class="table table-responsive table-striped" id="members">
<tbody> <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"> <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> <td style="padding:10px 15px;">{{device.viewModel.deviceName}}</td>
</tr> </tr>
{{/if}} {{/if}}
@ -37,12 +43,31 @@
</tr> </tr>
{{/if}} {{/if}}
{{/if}} {{/if}}
<tr role="row" class="even"> {{#if device.status}}
<td class="sorting_1" style="padding:10px 15px;">IMEI</td>
<td style="padding:10px 15px;">{{device.viewModel.imei}}</td>
</tr>
{{#if device.viewModel.udid}}
<tr role="row" class="even"> <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 class="sorting_1" style="padding:10px 15px;">UDID</td>
<td style="padding:10px 15px;">{{device.viewModel.udid}}</td> <td style="padding:10px 15px;">{{device.viewModel.udid}}</td>
</tr> </tr>
@ -54,20 +79,11 @@
</tr> </tr>
{{/if}} {{/if}}
{{#if device.viewModel.phoneNumber}} {{#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 class="sorting_1" style="padding:10px 15px;">Phone Number</td>
<td style="padding:10px 15px;">{{device.viewModel.phoneNumber}}</td> <td style="padding:10px 15px;">{{device.viewModel.phoneNumber}}</td>
</tr> </tr>
{{/if}} {{/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> </tbody>
</table> </table>
{{/defineZone}} {{/defineZone}}
@ -126,9 +142,6 @@
</h4> </h4>
</div> </div>
<div class="panel-heading display-none-xs">Device Details</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 id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="device_details">
<div class="panel-body "> <div class="panel-body ">
<div class="device-detail-body"> <div class="device-detail-body">
@ -146,61 +159,73 @@
<div> <div>
<div class="tile-icon"><i class="fw fw-battery"></i></div> <div class="tile-icon"><i class="fw fw-battery"></i></div>
<div class="tile-stats"> <div class="tile-stats">
{{device.viewModel.BatteryLevel}} % {{device.viewModel.BatteryLevel.value}} %
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
{{/if}} {{/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-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">STORAGE</div> <div class="tile-name">CPU Usage</div>
<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"> <div class="tile-stats">
{{device.viewModel.DeviceCapacityPercentage}} % {{device.viewModel.ramUsage.value}} %
<span class="tile-stats-free">
{{device.viewModel.AvailableDeviceCapacity}} GB Free
</span>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
{{/if}} {{/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-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">Local Storage</div>
<div> <div>
<div class="tile-icon"><i class="fw fw-hdd"></i></div> <div class="tile-icon"><i class="fw fw-hdd"></i></div>
<div class="tile-stats"> <div class="tile-stats">
{{device.viewModel.internal_memory.DeviceCapacityPercentage}} % {{device.viewModel.internalMemory.usage}} %
<span class="tile-stats-free"> <span class="tile-stats-free">
{{device.viewModel.internal_memory.FreeCapacity}} GB Free TOTAL OF {{device.viewModel.internalMemory.total}} GB
</span> </span>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
{{/if}} {{/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-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">EXTERNAL STORAGE</div> <div class="tile-name">External Storage</div>
<div> <div>
<div class="tile-icon"><i class="fw fw-usb-drive"></i></div> <div class="tile-icon"><i class="fw fw-usb-drive"></i></div>
<div class="tile-stats"> <div class="tile-stats">
{{device.viewModel.external_memory.DeviceCapacityPercentage}} % {{device.viewModel.externalMemory.usage}} %
<span class="tile-stats-free"> <span class="tile-stats-free">
{{device.viewModel.external_memory.FreeCapacity}} GB Free TOTAL OF {{device.viewModel.externalMemory.total}} GB
</span> </span>
</div> </div>
</div> </div>
</div> </div>

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

Loading…
Cancel
Save