You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/app/docker/components/host-view-panels/node-labels-table/node-labels-table-controlle...

21 lines
588 B

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 });
}
}
},
]);