feat(engine-details): add labels-table component

This commit is contained in:
Chaim Lando
2018-09-06 11:41:54 +03:00
parent 67c020db9b
commit 2f4b68e043
3 changed files with 86 additions and 0 deletions
@@ -0,0 +1,24 @@
angular.module('portainer.docker').controller('NodeLabelsTableController', [
function NodeLabelsTableController() {
var ctrl = this;
ctrl.removeLabel = removeLabel;
ctrl.updateLabel = updateLabel;
function removeLabel(index) {
var removedElement = ctrl.labels.splice(index, 1);
if (removedElement !== null) {
console.log(ctrl.labels);
ctrl.onChangedLabels({labels: ctrl.labels});
}
}
function updateLabel(label) {
if (
label.value !== label.originalValue ||
label.key !== label.originalKey
) {
ctrl.onChangedLabels({labels: ctrl.labels});
}
}
}
]);