mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 15:29:42 +02:00
feat(ux): replace spinners (#1383)
This commit is contained in:
parent
9bef7cd69f
commit
d68708add7
133 changed files with 701 additions and 1061 deletions
|
@ -5,7 +5,9 @@ function ($q, $scope, Notifications, SettingsService, FileUploadService) {
|
|||
$scope.state = {
|
||||
successfulConnectivityCheck: false,
|
||||
failedConnectivityCheck: false,
|
||||
uploadInProgress: false
|
||||
uploadInProgress: false,
|
||||
connectivityCheckInProgress: false,
|
||||
deploymentInProgress: false
|
||||
};
|
||||
|
||||
$scope.formValues = {
|
||||
|
@ -21,13 +23,13 @@ function ($q, $scope, Notifications, SettingsService, FileUploadService) {
|
|||
};
|
||||
|
||||
$scope.LDAPConnectivityCheck = function() {
|
||||
$('#connectivityCheckSpinner').show();
|
||||
var settings = $scope.settings;
|
||||
var TLSCAFile = $scope.formValues.TLSCACert !== settings.LDAPSettings.TLSConfig.TLSCACert ? $scope.formValues.TLSCACert : null;
|
||||
|
||||
var uploadRequired = ($scope.LDAPSettings.TLSConfig.TLS || $scope.LDAPSettings.StartTLS) && !$scope.LDAPSettings.TLSConfig.TLSSkipVerify;
|
||||
$scope.state.uploadInProgress = uploadRequired;
|
||||
|
||||
$scope.state.connectivityCheckInProgress = true;
|
||||
$q.when(!uploadRequired || FileUploadService.uploadLDAPTLSFiles(TLSCAFile, null, null))
|
||||
.then(function success(data) {
|
||||
return SettingsService.checkLDAPConnectivity(settings);
|
||||
|
@ -44,18 +46,18 @@ function ($q, $scope, Notifications, SettingsService, FileUploadService) {
|
|||
})
|
||||
.finally(function final() {
|
||||
$scope.state.uploadInProgress = false;
|
||||
$('#connectivityCheckSpinner').hide();
|
||||
$scope.state.connectivityCheckInProgress = false;
|
||||
});
|
||||
};
|
||||
|
||||
$scope.saveSettings = function() {
|
||||
$('#updateSettingsSpinner').show();
|
||||
var settings = $scope.settings;
|
||||
var TLSCAFile = $scope.formValues.TLSCACert !== settings.LDAPSettings.TLSConfig.TLSCACert ? $scope.formValues.TLSCACert : null;
|
||||
|
||||
var uploadRequired = ($scope.LDAPSettings.TLSConfig.TLS || $scope.LDAPSettings.StartTLS) && !$scope.LDAPSettings.TLSConfig.TLSSkipVerify;
|
||||
$scope.state.uploadInProgress = uploadRequired;
|
||||
|
||||
$scope.state.deploymentInProgress = true;
|
||||
$q.when(!uploadRequired || FileUploadService.uploadLDAPTLSFiles(TLSCAFile, null, null))
|
||||
.then(function success(data) {
|
||||
return SettingsService.update(settings);
|
||||
|
@ -68,12 +70,11 @@ function ($q, $scope, Notifications, SettingsService, FileUploadService) {
|
|||
})
|
||||
.finally(function final() {
|
||||
$scope.state.uploadInProgress = false;
|
||||
$('#updateSettingsSpinner').hide();
|
||||
$scope.state.deploymentInProgress = false;
|
||||
});
|
||||
};
|
||||
|
||||
function initView() {
|
||||
$('#loadingViewSpinner').show();
|
||||
SettingsService.settings()
|
||||
.then(function success(data) {
|
||||
var settings = data;
|
||||
|
@ -83,9 +84,6 @@ function ($q, $scope, Notifications, SettingsService, FileUploadService) {
|
|||
})
|
||||
.catch(function error(err) {
|
||||
Notifications.error('Failure', err, 'Unable to retrieve application settings');
|
||||
})
|
||||
.finally(function final() {
|
||||
$('#loadingViewSpinner').hide();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue