|
|
|
@ -27,12 +27,12 @@ function onRequest(context) {
|
|
|
|
|
var utility = require("/app/modules/utility.js").utility;
|
|
|
|
|
var typesListResponse = deviceModule.getDeviceTypes();
|
|
|
|
|
if (typesListResponse["status"] == "success") {
|
|
|
|
|
var deviceTypes = typesListResponse["content"];
|
|
|
|
|
var deviceTypes = typesListResponse.content.deviceTypes;
|
|
|
|
|
if (deviceTypes) {
|
|
|
|
|
var deviceTypesList = [], virtualDeviceTypesList = [];
|
|
|
|
|
for (var i = 0; i < deviceTypes.length; i++) {
|
|
|
|
|
|
|
|
|
|
var deviceTypeLabel = deviceTypes[i].name;
|
|
|
|
|
var deviceType = deviceTypes[i];
|
|
|
|
|
var deviceTypeLabel = deviceType;
|
|
|
|
|
var configs = utility.getDeviceTypeConfig(deviceTypeLabel);
|
|
|
|
|
var deviceCategory = "device";
|
|
|
|
|
if (configs) {
|
|
|
|
@ -47,19 +47,17 @@ function onRequest(context) {
|
|
|
|
|
virtualDeviceTypesList.push({
|
|
|
|
|
"hasCustTemplate": false,
|
|
|
|
|
"deviceTypeLabel": deviceTypeLabel,
|
|
|
|
|
"deviceTypeName": deviceTypes[i].name,
|
|
|
|
|
"deviceTypeName": deviceType,
|
|
|
|
|
"deviceCategory": deviceCategory,
|
|
|
|
|
"deviceTypeId": deviceTypes[i].id,
|
|
|
|
|
"thumb": utility.getDeviceThumb(deviceTypes[i].name)
|
|
|
|
|
"thumb": utility.getDeviceThumb(deviceType)
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
deviceTypesList.push({
|
|
|
|
|
"hasCustTemplate": false,
|
|
|
|
|
"deviceTypeLabel": deviceTypeLabel,
|
|
|
|
|
"deviceTypeName": deviceTypes[i].name,
|
|
|
|
|
"deviceTypeName": deviceType,
|
|
|
|
|
"deviceCategory": deviceCategory,
|
|
|
|
|
"deviceTypeId": deviceTypes[i].id,
|
|
|
|
|
"thumb": utility.getDeviceThumb(deviceTypes[i].name)
|
|
|
|
|
"thumb": utility.getDeviceThumb(deviceType)
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|