1
0
Fork 0
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:
Chaim Lev-Ari 2020-04-11 00:54:53 +03:00 committed by GitHub
parent 6663073be1
commit cf5056d9c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
714 changed files with 31228 additions and 28305 deletions

View file

@ -1,81 +1,89 @@
angular.module('portainer.integrations.storidge')
.controller('StoridgeClusterController', ['$q', '$scope', '$state', 'Notifications', 'StoridgeClusterService', 'StoridgeNodeService', 'ModalService',
function ($q, $scope, $state, Notifications, StoridgeClusterService, StoridgeNodeService, ModalService) {
angular.module('portainer.integrations.storidge').controller('StoridgeClusterController', [
'$q',
'$scope',
'$state',
'Notifications',
'StoridgeClusterService',
'StoridgeNodeService',
'ModalService',
function ($q, $scope, $state, Notifications, StoridgeClusterService, StoridgeNodeService, ModalService) {
$scope.state = {
shutdownInProgress: false,
rebootInProgress: false,
};
$scope.state = {
shutdownInProgress: false,
rebootInProgress: false
};
$scope.rebootCluster = function () {
ModalService.confirm({
title: 'Are you sure?',
message: 'All the nodes in the cluster will reboot during the process. Do you want to reboot the Storidge cluster?',
buttons: {
confirm: {
label: 'Reboot',
className: 'btn-danger',
},
},
callback: function onConfirm(confirmed) {
if (!confirmed) {
return;
}
rebootCluster();
},
});
};
$scope.rebootCluster = function() {
ModalService.confirm({
title: 'Are you sure?',
message: 'All the nodes in the cluster will reboot during the process. Do you want to reboot the Storidge cluster?',
buttons: {
confirm: {
label: 'Reboot',
className: 'btn-danger'
}
},
callback: function onConfirm(confirmed) {
if(!confirmed) { return; }
rebootCluster();
}
});
};
function rebootCluster() {
$scope.state.rebootInProgress = true;
StoridgeClusterService.reboot().finally(function final() {
$scope.state.rebootInProgress = false;
Notifications.success('Cluster successfully rebooted');
$state.reload();
});
}
function rebootCluster() {
$scope.state.rebootInProgress = true;
StoridgeClusterService.reboot()
.finally(function final() {
$scope.state.rebootInProgress = false;
Notifications.success('Cluster successfully rebooted');
$state.reload();
});
}
$scope.shutdownCluster = function () {
ModalService.confirm({
title: 'Are you sure?',
message: 'All the nodes in the cluster will shutdown. Do you want to shutdown the Storidge cluster?',
buttons: {
confirm: {
label: 'Shutdown',
className: 'btn-danger',
},
},
callback: function onConfirm(confirmed) {
if (!confirmed) {
return;
}
shutdownCluster();
},
});
};
$scope.shutdownCluster = function() {
ModalService.confirm({
title: 'Are you sure?',
message: 'All the nodes in the cluster will shutdown. Do you want to shutdown the Storidge cluster?',
buttons: {
confirm: {
label: 'Shutdown',
className: 'btn-danger'
}
},
callback: function onConfirm(confirmed) {
if(!confirmed) { return; }
shutdownCluster();
}
});
};
function shutdownCluster() {
$scope.state.shutdownInProgress = true;
StoridgeClusterService.shutdown().finally(function final() {
$scope.state.shutdownInProgress = false;
Notifications.success('Cluster successfully shutdown');
$state.go('docker.dashboard');
});
}
function shutdownCluster() {
$scope.state.shutdownInProgress = true;
StoridgeClusterService.shutdown()
.finally(function final() {
$scope.state.shutdownInProgress = false;
Notifications.success('Cluster successfully shutdown');
$state.go('docker.dashboard');
});
}
function initView() {
$q.all({
info: StoridgeClusterService.info(),
version: StoridgeClusterService.version(),
nodes: StoridgeNodeService.nodes(),
})
.then(function success(data) {
$scope.clusterInfo = data.info;
$scope.clusterVersion = data.version;
$scope.clusterNodes = data.nodes;
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to retrieve cluster information');
});
}
function initView() {
$q.all({
info: StoridgeClusterService.info(),
version: StoridgeClusterService.version(),
nodes: StoridgeNodeService.nodes()
})
.then(function success(data) {
$scope.clusterInfo = data.info;
$scope.clusterVersion = data.version;
$scope.clusterNodes = data.nodes;
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to retrieve cluster information');
});
}
initView();
}]);
initView();
},
]);