|
|
@ -21,7 +21,7 @@ function onRequest(context) {
|
|
|
|
var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
|
|
|
|
var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
|
|
|
|
var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
|
|
|
|
var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
|
|
|
|
var groupModule = require("/app/modules/business-controllers/group.js")["groupModule"];
|
|
|
|
var groupModule = require("/app/modules/business-controllers/group.js")["groupModule"];
|
|
|
|
|
|
|
|
|
|
|
|
var groupId = request.getParameter("groupId");
|
|
|
|
var groupId = request.getParameter("groupId");
|
|
|
|
|
|
|
|
|
|
|
|
var viewModel = {};
|
|
|
|
var viewModel = {};
|
|
|
@ -60,6 +60,8 @@ function onRequest(context) {
|
|
|
|
if (data) {
|
|
|
|
if (data) {
|
|
|
|
for (var i = 0; i < data.length; i++) {
|
|
|
|
for (var i = 0; i < data.length; i++) {
|
|
|
|
var config = utility.getDeviceTypeConfig(data[i]);
|
|
|
|
var config = utility.getDeviceTypeConfig(data[i]);
|
|
|
|
|
|
|
|
var log = new Log("devices.js");
|
|
|
|
|
|
|
|
|
|
|
|
if (!config) {
|
|
|
|
if (!config) {
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -70,7 +72,8 @@ function onRequest(context) {
|
|
|
|
"label": deviceType.label,
|
|
|
|
"label": deviceType.label,
|
|
|
|
"thumb": utility.getDeviceThumb(data[i]),
|
|
|
|
"thumb": utility.getDeviceThumb(data[i]),
|
|
|
|
"analyticsEnabled": deviceType.analyticsEnabled,
|
|
|
|
"analyticsEnabled": deviceType.analyticsEnabled,
|
|
|
|
"groupingEnabled": deviceType.groupingEnabled
|
|
|
|
"groupingEnabled": deviceType.groupingEnabled,
|
|
|
|
|
|
|
|
"analyticsView" : deviceType.analyticsView
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -80,9 +83,15 @@ function onRequest(context) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var mdmProps = require("/app/modules/conf-reader/main.js")["conf"];
|
|
|
|
var mdmProps = require("/app/modules/conf-reader/main.js")["conf"];
|
|
|
|
var analyticsServer = mdmProps["dashboardServerURL"];
|
|
|
|
var serverUrl = mdmProps["httpsURL"];
|
|
|
|
var analyticsURL = analyticsServer + "/portal/t/" + context.user.userDomain + "/dashboards/android-iot/battery?owner=" + context.user.username + "&deviceId=";
|
|
|
|
var portalUrl = mdmProps["portalURL"];
|
|
|
|
viewModel.analyticsURL = analyticsURL;
|
|
|
|
var userDomain = context.user.domain;
|
|
|
|
|
|
|
|
//var userName = context.user.username;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
viewModel.serverUrl = serverUrl;
|
|
|
|
|
|
|
|
viewModel.portalUrl = portalUrl;
|
|
|
|
|
|
|
|
viewModel.userDomain = userDomain;
|
|
|
|
|
|
|
|
//viewModel.userName = userName;
|
|
|
|
|
|
|
|
|
|
|
|
return viewModel;
|
|
|
|
return viewModel;
|
|
|
|
}
|
|
|
|
}
|
|
|
|