Browse Source

Fix data key to alarm widget (#1978)

pull/1992/head
Vladyslav 7 years ago
committed by Igor Kulikov
parent
commit
6afef792f4
  1. 3
      ui/src/app/components/datasource-entity.directive.js
  2. 7
      ui/src/app/components/datasource-func.directive.js

3
ui/src/app/components/datasource-entity.directive.js

@ -215,10 +215,11 @@ function DatasourceEntity($compile, $templateCache, $q, $mdDialog, $window, $doc
w.triggerHandler('resize');
}
}).then(function (newDataKey) {
let index = scope.dataKeys.indexOf(dataKey);
if ((newDataKey.type === types.dataKeyType.timeseries) || (newDataKey.type === types.dataKeyType.attribute)) {
let index = scope.dataKeys.indexOf(dataKey);
scope.dataKeys[index] = newDataKey;
} else if (newDataKey.type === types.dataKeyType.alarm) {
let index = scope.alarmDataKeys.indexOf(dataKey);
scope.alarmDataKeys[index] = newDataKey;
}
ngModelCtrl.$setDirty();

7
ui/src/app/components/datasource-func.directive.js

@ -183,10 +183,11 @@ function DatasourceFunc($compile, $templateCache, $mdDialog, $window, $document,
w.triggerHandler('resize');
}
}).then(function (newDataKey) {
let index = scope.funcDataKeys.indexOf(dataKey);
if (newDataKey.type === types.dataKeyType.function) {
scope.funcDataKeys[index] = newDataKey;
if ((newDataKey.type === types.dataKeyType.timeseries) || (newDataKey.type === types.dataKeyType.attribute)) {
let index = scope.dataKeys.indexOf(dataKey);
scope.dataKeys[index] = newDataKey;
} else if (newDataKey.type === types.dataKeyType.alarm) {
let index = scope.alarmDataKeys.indexOf(dataKey);
scope.alarmDataKeys[index] = newDataKey;
}
ngModelCtrl.$setDirty();

Loading…
Cancel
Save