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