|
|
@ -19,14 +19,15 @@
|
|
|
|
function onRequest(context) {
|
|
|
|
function onRequest(context) {
|
|
|
|
var utility = require("/app/modules/utility.js").utility;
|
|
|
|
var utility = require("/app/modules/utility.js").utility;
|
|
|
|
context.handlebars.registerHelper('equal', function (lvalue, rvalue, options) {
|
|
|
|
context.handlebars.registerHelper('equal', function (lvalue, rvalue, options) {
|
|
|
|
if (arguments.length < 3)
|
|
|
|
if (arguments.length < 3) {
|
|
|
|
throw new Error("Handlebars Helper equal needs 2 parameters");
|
|
|
|
throw new Error("Handlebars Helper equal needs 2 parameters");
|
|
|
|
if (lvalue != rvalue) {
|
|
|
|
}
|
|
|
|
return options.inverse(this);
|
|
|
|
if (lvalue != rvalue) {
|
|
|
|
} else {
|
|
|
|
return options.inverse(this);
|
|
|
|
return options.fn(this);
|
|
|
|
} else {
|
|
|
|
}
|
|
|
|
return options.fn(this);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
var groupName = request.getParameter("groupName");
|
|
|
|
var groupName = request.getParameter("groupName");
|
|
|
|
var groupId = request.getParameter("groupId");
|
|
|
|
var groupId = request.getParameter("groupId");
|
|
|
|
var deviceName = request.getParameter("deviceName");
|
|
|
|
var deviceName = request.getParameter("deviceName");
|
|
|
@ -38,7 +39,7 @@ function onRequest(context) {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
title = "Device " + title;
|
|
|
|
title = "Device " + title;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
"deviceAnalyticsViewUnitName": utility.getTenantedDeviceUnitName(deviceType, "analytics-view"),
|
|
|
|
"deviceAnalyticsViewUnitName": utility.getTenantedDeviceUnitName(deviceType, "analytics-view"),
|
|
|
|
"deviceType": deviceType,
|
|
|
|
"deviceType": deviceType,
|
|
|
|
"title": title,
|
|
|
|
"title": title,
|
|
|
@ -46,5 +47,5 @@ function onRequest(context) {
|
|
|
|
"groupId": groupId,
|
|
|
|
"groupId": groupId,
|
|
|
|
"deviceName": deviceName,
|
|
|
|
"deviceName": deviceName,
|
|
|
|
"deviceId": deviceId
|
|
|
|
"deviceId": deviceId
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|