|
|
@ -79,18 +79,19 @@ var operationModule = function () {
|
|
|
|
return featuresList;
|
|
|
|
return featuresList;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
publicMethods.getControlOperations = function (deviceType) {
|
|
|
|
publicMethods.getControlOperations = function (device) {
|
|
|
|
|
|
|
|
var deviceType = device.type;
|
|
|
|
var operations = privateMethods.getOperationsFromFeatures(deviceType, "operation");
|
|
|
|
var operations = privateMethods.getOperationsFromFeatures(deviceType, "operation");
|
|
|
|
var features = utility.getDeviceTypeConfig(deviceType).deviceType.features;
|
|
|
|
var features = utility.getDeviceTypeConfig(deviceType).deviceType.features;
|
|
|
|
for (var op in operations) {
|
|
|
|
for (var op in operations) {
|
|
|
|
var iconIdentifier = operations[op].operation;
|
|
|
|
var iconIdentifier = operations[op].operation;
|
|
|
|
if (features && features[iconIdentifier]) {
|
|
|
|
if (features && features[iconIdentifier]) {
|
|
|
|
var icon = features[iconIdentifier].icon;
|
|
|
|
var icon = features[iconIdentifier].icon;
|
|
|
|
var isCloud = devicemgtProps["isCloud"];
|
|
|
|
//TODO: need improve this check to get feature availability from agent side
|
|
|
|
//TODO: remove isCloud check once able to verify features from the device agent
|
|
|
|
var filter = features[iconIdentifier].filter;
|
|
|
|
var isDisabled = features[iconIdentifier].isDisabled;
|
|
|
|
if (device && filter && filter.property && device[filter.property] !== filter.value) {
|
|
|
|
if (isDisabled && isCloud) {
|
|
|
|
operations[op]["isDisabled"] = true;
|
|
|
|
operations[op]["isDisabled"] = isDisabled;
|
|
|
|
operations[op]["disabledText"] = filter.text;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
operations[op]["isDisabled"] = false;
|
|
|
|
operations[op]["isDisabled"] = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|