|
|
@ -26,7 +26,7 @@ function onRequest(context) {
|
|
|
|
if (devices) {
|
|
|
|
if (devices) {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
"devices": stringify(devices),
|
|
|
|
"devices": stringify(devices),
|
|
|
|
"backendApiUri": devicemgtProps["httpsURL"] + "/virtual_firealarm/device/stats/"
|
|
|
|
"backendApiUri": "/virtual_firealarm/device/stats/"
|
|
|
|
};
|
|
|
|
};
|
|
|
|
} else if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) {
|
|
|
|
} else if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) {
|
|
|
|
var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
|
|
|
|
var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
|
|
|
@ -34,7 +34,7 @@ function onRequest(context) {
|
|
|
|
if (device && device.status != "error") {
|
|
|
|
if (device && device.status != "error") {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
"device": device.content,
|
|
|
|
"device": device.content,
|
|
|
|
"backendApiUri": devicemgtProps["httpsURL"] + "/virtual_firealarm/device/stats/" + deviceId
|
|
|
|
"backendApiUri": "/virtual_firealarm/device/stats/" + deviceId
|
|
|
|
};
|
|
|
|
};
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!");
|
|
|
|
response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!");
|
|
|
|