Merge pull request #661 from charithag/master

Fixes and improvments
revert-70aa11f8
Geeth 8 years ago committed by GitHub
commit c0a474f6fc

@ -81,21 +81,11 @@ var operationModule = function () {
publicMethods.getControlOperations = function (deviceType) {
var operations = privateMethods.getOperationsFromFeatures(deviceType, "operation");
var features = utility.getDeviceTypeConfig(deviceType).deviceType.features;
for (var op in operations) {
var iconIdentifier = operations[op].operation;
if (features && features[iconIdentifier]) {
var icon = features[iconIdentifier].icon;
var icon = utility.getOperationIcon(deviceType, iconIdentifier);
if (icon) {
operations[op]["iconFont"] = icon;
} else if (iconPath) {
var iconPath = utility.getOperationIcon(deviceType, iconIdentifier);
operations[op]["icon"] = iconPath;
}
var formParams = features[iconIdentifier].formParams;
if (formParams) {
operations[op]["uiParams"] = formParams;
}
operations[op]["icon"] = icon;
}
}
return operations;

@ -67,8 +67,8 @@
<div class="try-device-container" id="{{deviceTypeName}}">
<div class="message message-info try-device-message">
<p class="try-device-text">
<button id="{{deviceTypeName}}_btn" onclick="location.href='{{@app
.context}}/device/{{deviceTypeName}}/enroll'"
<button id="{{deviceTypeName}}_btn"
onclick="location.href='{{@app.context}}/device/{{deviceTypeName}}/enroll?type=virtual'"
class="btn btn-default btn-primary">Try
</button>
our {{deviceTypeLabel}} device

@ -21,6 +21,7 @@ function onRequest(context) {
var DTYPE_CONF_DEVICE_TYPE_KEY = "deviceType";
var DTYPE_CONF_DEVICE_CATEGORY = "category";
var DTYPE_CONF_DEVICE_TYPE_LABEL_KEY = "label";
var DTYPE_CONF_VIRTUAL_DEVICE_TYPE_LABEL_KEY = "virtualLabel";
var viewModel = {};
var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
@ -54,6 +55,25 @@ function onRequest(context) {
"deviceCategory": deviceCategory,
"thumb": utility.getDeviceThumb(deviceType)
});
} else if (deviceCategory == 'hybrid') {
var virtualLabel = configs[DTYPE_CONF_DEVICE_TYPE_KEY][DTYPE_CONF_VIRTUAL_DEVICE_TYPE_LABEL_KEY];
if (!virtualLabel) {
virtualLabel = deviceTypeLabel;
}
virtualDeviceTypesList.push({
"hasCustTemplate": false,
"deviceTypeLabel": virtualLabel,
"deviceTypeName": deviceType,
"deviceCategory": deviceCategory,
"thumb": utility.getDeviceThumb(deviceType)
});
deviceTypesList.push({
"hasCustTemplate": false,
"deviceTypeLabel": deviceTypeLabel,
"deviceTypeName": deviceType,
"deviceCategory": deviceCategory,
"thumb": utility.getDeviceThumb(deviceType)
});
} else {
deviceTypesList.push({
"hasCustTemplate": false,

Loading…
Cancel
Save