|
|
@ -17,7 +17,7 @@
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
function onRequest(context) {
|
|
|
|
function onRequest(context) {
|
|
|
|
// var log = new Log("device-view.js");
|
|
|
|
// var log = new Log("device-view.js");
|
|
|
|
var deviceType = context["uriParams"]["deviceType"];
|
|
|
|
var deviceType = context["uriParams"]["deviceType"];
|
|
|
|
var deviceId = request.getParameter("id");
|
|
|
|
var deviceId = request.getParameter("id");
|
|
|
|
var deviceViewData = {};
|
|
|
|
var deviceViewData = {};
|
|
|
@ -32,7 +32,7 @@ function onRequest(context) {
|
|
|
|
|
|
|
|
|
|
|
|
var filteredDeviceData = response["content"];
|
|
|
|
var filteredDeviceData = response["content"];
|
|
|
|
|
|
|
|
|
|
|
|
// creating deviceView information model from filtered device data
|
|
|
|
// creating deviceView information model from filtered device data
|
|
|
|
var viewModel = {};
|
|
|
|
var viewModel = {};
|
|
|
|
if (filteredDeviceData["type"]) {
|
|
|
|
if (filteredDeviceData["type"]) {
|
|
|
|
viewModel["type"] = filteredDeviceData["type"];
|
|
|
|
viewModel["type"] = filteredDeviceData["type"];
|
|
|
@ -194,7 +194,7 @@ function onRequest(context) {
|
|
|
|
if (!filteredDeviceData["initialDeviceInfo"] && !filteredDeviceData["latestDeviceInfo"]) {
|
|
|
|
if (!filteredDeviceData["initialDeviceInfo"] && !filteredDeviceData["latestDeviceInfo"]) {
|
|
|
|
viewModel["deviceInfoAvailable"] = false;
|
|
|
|
viewModel["deviceInfoAvailable"] = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
viewModel.locationHistory = stringify(filteredDeviceData["locationHistory"]);
|
|
|
|
deviceViewData["device"] = viewModel;
|
|
|
|
deviceViewData["device"] = viewModel;
|
|
|
|
} else if (response["status"] == "unauthorized") {
|
|
|
|
} else if (response["status"] == "unauthorized") {
|
|
|
|
deviceViewData["deviceFound"] = true;
|
|
|
|
deviceViewData["deviceFound"] = true;
|
|
|
@ -213,7 +213,6 @@ function onRequest(context) {
|
|
|
|
deviceViewData["autoCompleteParams"] = autoCompleteParams;
|
|
|
|
deviceViewData["autoCompleteParams"] = autoCompleteParams;
|
|
|
|
|
|
|
|
|
|
|
|
deviceViewData["portalUrl"] = devicemgtProps['portalURL'];
|
|
|
|
deviceViewData["portalUrl"] = devicemgtProps['portalURL'];
|
|
|
|
deviceViewData["deviceId"] = deviceId;
|
|
|
|
deviceViewData["anchor"] = encodeURI(JSON.stringify({ "device" : { "id" : deviceId, "type" : deviceType}}));
|
|
|
|
deviceViewData["deviceType"] = deviceType;
|
|
|
|
|
|
|
|
return deviceViewData;
|
|
|
|
return deviceViewData;
|
|
|
|
}
|
|
|
|
}
|
|
|
|