Lines Matching full:scope
13 '$scope', '$window', 'APIUtils', '$route', '$q', 'toastService',
14 function($scope, $window, APIUtils, $route, $q, toastService) { argument
15 $scope.managers = [];
16 $scope.loading = true;
17 $scope.managersToDelete = [];
24 $scope.managers.push({
39 $scope.loading = false;
42 $scope.addNewSNMPManager = function() {
43 $scope.managers.push({address: '', port: ''});
46 $scope.removeSNMPManager = function(index) {
49 if ($scope.managers[index].path) {
50 $scope.managersToDelete.push($scope.managers[index].path);
52 $scope.managers.splice(index, 1);
55 $scope.refresh = function() {
59 $scope.setSNMP = function() {
60 $scope.loading = true;
65 for (let i in $scope.managers) {
66 if (!$scope.managers[i].address || !$scope.managers[i].port) {
67 $scope.loading = false;
74 let managersLength = $scope.managers.length;
78 if (!$scope.managers[managersLength].path) {
80 $scope.managers[managersLength].address,
81 $scope.managers[managersLength].port));
83 if ($scope.managers[managersLength].updateAddress) {
85 $scope.managers[managersLength].path,
86 $scope.managers[managersLength].address));
88 if ($scope.managers[managersLength].updatePort) {
90 $scope.managers[managersLength].path,
91 $scope.managers[managersLength].port));
98 for (let i in $scope.managersToDelete) {
99 promises.push(deleteManager($scope.managersToDelete[i]));
105 $scope.refresh();
113 $scope.loading = false;