mirror of
https://github.com/portainer/portainer.git
synced 2025-08-04 13:25:26 +02:00
chore(project): add prettier for code format (#3645)
* chore(project): install prettier and lint-staged * chore(project): apply prettier to html too * chore(project): git ignore eslintcache * chore(project): add a comment about format script * chore(prettier): update printWidth * chore(prettier): remove useTabs option * chore(prettier): add HTML validation * refactor(prettier): fix closing tags * feat(prettier): define angular parser for html templates * style(prettier): run prettier on codebase Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com>
This commit is contained in:
parent
6663073be1
commit
cf5056d9c0
714 changed files with 31228 additions and 28305 deletions
|
@ -1,107 +1,117 @@
|
|||
angular.module('portainer.integrations.storidge')
|
||||
.controller('StoridgeNodeController', ['$scope', '$state', '$transition$', 'Notifications', 'StoridgeNodeService', 'ModalService',
|
||||
function ($scope, $state, $transition$, Notifications, StoridgeNodeService, ModalService) {
|
||||
angular.module('portainer.integrations.storidge').controller('StoridgeNodeController', [
|
||||
'$scope',
|
||||
'$state',
|
||||
'$transition$',
|
||||
'Notifications',
|
||||
'StoridgeNodeService',
|
||||
'ModalService',
|
||||
function ($scope, $state, $transition$, Notifications, StoridgeNodeService, ModalService) {
|
||||
$scope.removeNodeAction = function (selectedItems) {
|
||||
ModalService.confirm({
|
||||
title: 'Are you sure?',
|
||||
message: 'Do you want really want to remove the node from the cluster?',
|
||||
buttons: {
|
||||
confirm: {
|
||||
label: 'Remove',
|
||||
className: 'btn-danger',
|
||||
},
|
||||
},
|
||||
callback: function onConfirm(confirmed) {
|
||||
if (!confirmed) {
|
||||
return;
|
||||
}
|
||||
remove(selectedItems);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
$scope.removeNodeAction = function(selectedItems) {
|
||||
ModalService.confirm({
|
||||
title: 'Are you sure?',
|
||||
message: 'Do you want really want to remove the node from the cluster?',
|
||||
buttons: {
|
||||
confirm: {
|
||||
label: 'Remove',
|
||||
className: 'btn-danger'
|
||||
}
|
||||
},
|
||||
callback: function onConfirm(confirmed) {
|
||||
if(!confirmed) { return; }
|
||||
remove(selectedItems);
|
||||
}
|
||||
});
|
||||
};
|
||||
function remove() {
|
||||
StoridgeNodeService.remove($scope.node.Name)
|
||||
.then(function success() {
|
||||
Notifications.success('Node successfully removed', $scope.node.Name);
|
||||
$state.go('storidge.cluster');
|
||||
})
|
||||
.catch(function error(err) {
|
||||
Notifications.error('Failure', err, 'Unable to remove node');
|
||||
});
|
||||
}
|
||||
|
||||
function remove() {
|
||||
StoridgeNodeService.remove($scope.node.Name)
|
||||
.then(function success() {
|
||||
Notifications.success('Node successfully removed', $scope.node.Name);
|
||||
$state.go('storidge.cluster');
|
||||
})
|
||||
.catch(function error(err) {
|
||||
Notifications.error('Failure', err, 'Unable to remove node');
|
||||
});
|
||||
}
|
||||
$scope.cordonNodeAction = function (selectedItems) {
|
||||
ModalService.confirm({
|
||||
title: 'Are you sure?',
|
||||
message: 'Do you want really want to put the node in maintenance mode?',
|
||||
buttons: {
|
||||
confirm: {
|
||||
label: 'Enter maintenance',
|
||||
className: 'btn-danger',
|
||||
},
|
||||
},
|
||||
callback: function onConfirm(confirmed) {
|
||||
if (!confirmed) {
|
||||
return;
|
||||
}
|
||||
cordonNode(selectedItems);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
$scope.cordonNodeAction = function(selectedItems) {
|
||||
ModalService.confirm({
|
||||
title: 'Are you sure?',
|
||||
message: 'Do you want really want to put the node in maintenance mode?',
|
||||
buttons: {
|
||||
confirm: {
|
||||
label: 'Enter maintenance',
|
||||
className: 'btn-danger'
|
||||
}
|
||||
},
|
||||
callback: function onConfirm(confirmed) {
|
||||
if(!confirmed) { return; }
|
||||
cordonNode(selectedItems);
|
||||
}
|
||||
});
|
||||
};
|
||||
function cordonNode() {
|
||||
StoridgeNodeService.cordon($scope.node.Name)
|
||||
.then(function success() {
|
||||
Notifications.success('Node successfully put in maintenance');
|
||||
})
|
||||
.catch(function error(err) {
|
||||
Notifications.error('Failure', err, 'Unable to put node in maintenance mode');
|
||||
})
|
||||
.finally(function final() {
|
||||
$state.reload();
|
||||
});
|
||||
}
|
||||
|
||||
function cordonNode() {
|
||||
StoridgeNodeService.cordon($scope.node.Name)
|
||||
.then(function success() {
|
||||
Notifications.success('Node successfully put in maintenance');
|
||||
})
|
||||
.catch(function error(err) {
|
||||
Notifications.error('Failure', err, 'Unable to put node in maintenance mode');
|
||||
})
|
||||
.finally(function final() {
|
||||
$state.reload();
|
||||
});
|
||||
}
|
||||
$scope.uncordonNodeAction = function (selectedItems) {
|
||||
ModalService.confirm({
|
||||
title: 'Are you sure?',
|
||||
message: 'Do you want really want to bring the nodes out of maintenance mode?',
|
||||
buttons: {
|
||||
confirm: {
|
||||
label: 'Exit maintenance',
|
||||
className: 'btn-danger',
|
||||
},
|
||||
},
|
||||
callback: function onConfirm(confirmed) {
|
||||
if (!confirmed) {
|
||||
return;
|
||||
}
|
||||
uncordonNode(selectedItems);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
$scope.uncordonNodeAction = function(selectedItems) {
|
||||
ModalService.confirm({
|
||||
title: 'Are you sure?',
|
||||
message: 'Do you want really want to bring the nodes out of maintenance mode?',
|
||||
buttons: {
|
||||
confirm: {
|
||||
label: 'Exit maintenance',
|
||||
className: 'btn-danger'
|
||||
}
|
||||
},
|
||||
callback: function onConfirm(confirmed) {
|
||||
if(!confirmed) { return; }
|
||||
uncordonNode(selectedItems);
|
||||
}
|
||||
});
|
||||
};
|
||||
function uncordonNode() {
|
||||
StoridgeNodeService.uncordon($scope.node.Name)
|
||||
.then(function success() {
|
||||
Notifications.success('Node successfully bringed back');
|
||||
})
|
||||
.catch(function error(err) {
|
||||
Notifications.error('Failure', err, 'Unable to put node out of maintenance mode');
|
||||
})
|
||||
.finally(function final() {
|
||||
$state.reload();
|
||||
});
|
||||
}
|
||||
|
||||
function uncordonNode() {
|
||||
StoridgeNodeService.uncordon($scope.node.Name)
|
||||
.then(function success() {
|
||||
Notifications.success('Node successfully bringed back');
|
||||
})
|
||||
.catch(function error(err) {
|
||||
Notifications.error('Failure', err, 'Unable to put node out of maintenance mode');
|
||||
})
|
||||
.finally(function final() {
|
||||
$state.reload();
|
||||
});
|
||||
}
|
||||
function initView() {
|
||||
$scope.name = $transition$.params().name;
|
||||
|
||||
function initView() {
|
||||
$scope.name = $transition$.params().name;
|
||||
StoridgeNodeService.node($scope.name)
|
||||
.then(function success(data) {
|
||||
$scope.node = data;
|
||||
})
|
||||
.catch(function error(err) {
|
||||
Notifications.error('Failure', err, 'Unable to retrieve node details');
|
||||
});
|
||||
}
|
||||
|
||||
StoridgeNodeService.node($scope.name)
|
||||
.then(function success(data) {
|
||||
$scope.node = data;
|
||||
})
|
||||
.catch(function error(err) {
|
||||
Notifications.error('Failure', err, 'Unable to retrieve node details');
|
||||
});
|
||||
}
|
||||
|
||||
initView();
|
||||
|
||||
}]);
|
||||
initView();
|
||||
},
|
||||
]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue