merge-requests/1/head
dilanua 8 years ago
parent 3a7dbb81ea
commit 4947664b4b

@ -52,16 +52,11 @@ function onRequest(context) {
longitude: device["properties"]["LONGITUDE"] longitude: device["properties"]["LONGITUDE"]
}; };
} else if (device["type"] == "android") { } else if (device["type"] == "android") {
viewModel["deviceName"] = device["name"];
viewModel["deviceIdentifier"] = device["deviceIdentifier"]; viewModel["deviceIdentifier"] = device["deviceIdentifier"];
viewModel["imei"] = device["properties"]["IMEI"]; viewModel["deviceName"] = device["name"];
viewModel["model"] = device["deviceInfo"]["deviceModel"];
viewModel["vendor"] = device["deviceInfo"]["vendor"];
viewModel["owner"] = device["owner"]; viewModel["owner"] = device["owner"];
viewModel["ownership"] = device["ownership"]; viewModel["ownership"] = device["ownership"];
viewModel["lastUpdatedTime"] = device["deviceInfo"]["updatedTime"]. viewModel["imei"] = device["properties"]["IMEI"];
substr(0, device["deviceInfo"]["updatedTime"].indexOf("+"));
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);
@ -79,6 +74,13 @@ function onRequest(context) {
} }
} }
deviceInfo = info; deviceInfo = info;
if (device["deviceInfo"]) {
viewModel["model"] = device["deviceInfo"]["deviceModel"];
viewModel["vendor"] = device["deviceInfo"]["vendor"];
viewModel["lastUpdatedTime"] = device["deviceInfo"]["updatedTime"].
substr(0, device["deviceInfo"]["updatedTime"].indexOf("+"));
viewModel["BatteryLevel"] = {}; viewModel["BatteryLevel"] = {};
viewModel["BatteryLevel"]["value"] = device["deviceInfo"]["batteryLevel"]; viewModel["BatteryLevel"]["value"] = device["deviceInfo"]["batteryLevel"];
@ -115,6 +117,7 @@ function onRequest(context) {
} else { } else {
viewModel["externalMemory"]["usage"] = 0; 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"];

Loading…
Cancel
Save