Merge branch 'application-mgt-device-info' into 'application-mgt-new'

Show extensive device info

See merge request entgra/carbon-device-mgt-plugins!98
revert-dabc3590
Inosh Perara 5 years ago
commit a09638e79b

@ -97,6 +97,7 @@
</li>
<li><a data-toggle="tab" href="#app">Applications</a></li>
<li><a data-toggle="tab" href="#policy">Policy Compliance</a></li>
<li><a data-toggle="tab" href="#device-info">Extensive Device Information</a></li>
<li><a data-toggle="tab" href="#remote-session">Remote Session</a></li>
{{/zone}}
@ -143,6 +144,27 @@
<div id="policy-list-container">
</div>
</div>
<div id="device-info" class="tab-pane fade">
<div id="device-info-container">
{{#if device.deviceInfoAvailable}}
<table class="table table-striped table-hover table-bordered display data-table"
id="device-info-table">
{{#each device.extensiveDeviceInfo}}
<tr>
<td>
{{@key}}
</td>
<td>
<span>{{this}}</span>
</td>
</tr>
{{/each}}
</table>
{{else}}<p>Extensive information is not available yet.</p>
{{/if}}
</div>
</div>
<div id="remote-session" class="tab-pane fade" data-remote-session-uri="{{remoteSessionEndpoint}}">
<div class="remote-session-container">
<div class="tab-actions">

@ -76,10 +76,33 @@ function onRequest(context) {
viewModel["ownership"] = filteredDeviceData["enrolmentInfo"]["ownership"];
}
}
var extensiveDeviceInfo = {};
if (filteredDeviceData["initialDeviceInfo"]) {
viewModel["deviceInfoAvailable"] = true;
if (filteredDeviceData["initialDeviceInfo"]["IMEI"]) {
viewModel["imei"] = filteredDeviceData["initialDeviceInfo"]["IMEI"];
extensiveDeviceInfo["IMEI"] = filteredDeviceData["initialDeviceInfo"]["IMEI"];
}
if (filteredDeviceData["initialDeviceInfo"]["IMSI"]) {
extensiveDeviceInfo["IMSI"] = filteredDeviceData["initialDeviceInfo"]["IMSI"];
}
if (filteredDeviceData["initialDeviceInfo"]["OS_VERSION"]) {
extensiveDeviceInfo["OS Version"] = filteredDeviceData["initialDeviceInfo"]["OS_VERSION"];
}
if (filteredDeviceData["initialDeviceInfo"]["DEVICE_MODEL"]) {
extensiveDeviceInfo["Model"] = filteredDeviceData["initialDeviceInfo"]["DEVICE_MODEL"];
}
if (filteredDeviceData["initialDeviceInfo"]["VENDOR"]) {
extensiveDeviceInfo["Vendor"] = filteredDeviceData["initialDeviceInfo"]["VENDOR"];
}
if (filteredDeviceData["initialDeviceInfo"]["SERIAL"]) {
extensiveDeviceInfo["Serial Number"] = filteredDeviceData["initialDeviceInfo"]["SERIAL"];
}
if (filteredDeviceData["initialDeviceInfo"]["MAC_ADDRESS"]) {
extensiveDeviceInfo["MAC Address"] = filteredDeviceData["initialDeviceInfo"]["MAC_ADDRESS"];
}
if (filteredDeviceData["initialDeviceInfo"]["OS_BUILD_DATE"]) {
extensiveDeviceInfo["OS Build Date"] = filteredDeviceData["initialDeviceInfo"]["OS_BUILD_DATE"];
}
if (!filteredDeviceData["latestDeviceInfo"]) {
if (filteredDeviceData["initialDeviceInfo"]["OS_BUILD_DATE"]) {
@ -109,6 +132,12 @@ function onRequest(context) {
} else {
viewModel["internalMemory"]["usage"] = 0;
}
if (filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["OPERATOR"]) {
extensiveDeviceInfo["Operator"] = filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["OPERATOR"];
}
if (filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["PHONE_NUMBER"]) {
extensiveDeviceInfo["Phone Number"] = filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["PHONE_NUMBER"];
}
viewModel["externalMemory"] = {};
viewModel["externalMemory"]["total"] = replaceNaNVal(Math.
@ -142,6 +171,15 @@ function onRequest(context) {
viewModel["vendor"] = filteredDeviceData["latestDeviceInfo"]["vendor"];
viewModel["model"] = filteredDeviceData["latestDeviceInfo"]["deviceModel"];
}
if (filteredDeviceData["latestDeviceInfo"]["osVersion"]) {
extensiveDeviceInfo["OS Version"] = filteredDeviceData["latestDeviceInfo"]["osVersion"];
}
if (filteredDeviceData["latestDeviceInfo"]["connectionType"]) {
extensiveDeviceInfo["Connection Type"] = filteredDeviceData["latestDeviceInfo"]["connectionType"];
}
if (filteredDeviceData["latestDeviceInfo"]["ssid"]) {
extensiveDeviceInfo["SSID"] = filteredDeviceData["latestDeviceInfo"]["ssid"];
}
if (filteredDeviceData["latestDeviceInfo"]["updatedTime"]) {
viewModel["lastUpdatedTime"] = filteredDeviceData["latestDeviceInfo"]["updatedTime"].
substr(0, filteredDeviceData["latestDeviceInfo"]["updatedTime"].indexOf("+"));
@ -151,6 +189,7 @@ function onRequest(context) {
viewModel["cpuUsage"] = {};
viewModel["cpuUsage"]["value"] = filteredDeviceData["latestDeviceInfo"]["cpuUsage"];
extensiveDeviceInfo["CPU Usage"] = filteredDeviceData["latestDeviceInfo"]["cpuUsage"];
viewModel["ramUsage"] = {};
if (filteredDeviceData["latestDeviceInfo"]["totalRAMMemory"] != 0) {
@ -183,6 +222,7 @@ function onRequest(context) {
viewModel["externalMemory"]["usage"] = 0;
}
}
viewModel["extensiveDeviceInfo"] = extensiveDeviceInfo;
if (!filteredDeviceData["initialDeviceInfo"] && !filteredDeviceData["latestDeviceInfo"]) {
viewModel["deviceInfoAvailable"] = false;
}

Loading…
Cancel
Save