mirror of https://github.com/portainer/portainer
21 lines
588 B
JavaScript
21 lines
588 B
JavaScript
angular.module('portainer.docker').controller('NodeLabelsTableController', [
|
|
function NodeLabelsTableController() {
|
|
var ctrl = this;
|
|
ctrl.removeLabel = removeLabel;
|
|
ctrl.updateLabel = updateLabel;
|
|
|
|
function removeLabel(index) {
|
|
var label = ctrl.labels.splice(index, 1);
|
|
if (label !== null) {
|
|
ctrl.onChangedLabels({ labels: ctrl.labels });
|
|
}
|
|
}
|
|
|
|
function updateLabel(label) {
|
|
if (label.value !== label.originalValue || label.key !== label.originalKey) {
|
|
ctrl.onChangedLabels({ labels: ctrl.labels });
|
|
}
|
|
}
|
|
},
|
|
]);
|