1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 07:49:41 +02:00

refactor(ux): rename deploymentInProgress variable (#1385)

This commit is contained in:
Anthony Lapenna 2017-11-12 22:39:12 +01:00 committed by GitHub
parent d68708add7
commit efc3154617
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 130 additions and 130 deletions

View file

@ -21,7 +21,7 @@ function ($q, $scope, $state, $timeout, $transition$, $filter, Container, Contai
$scope.state = { $scope.state = {
formValidationError: '', formValidationError: '',
deploymentInProgress: false actionInProgress: false
}; };
$scope.refreshSlider = function () { $scope.refreshSlider = function () {
@ -580,7 +580,7 @@ function ($q, $scope, $state, $timeout, $transition$, $filter, Container, Contai
return; return;
} }
$scope.state.deploymentInProgress = true; $scope.state.actionInProgress = true;
var config = prepareConfiguration(); var config = prepareConfiguration();
createContainer(config, accessControlData); createContainer(config, accessControlData);
}) })
@ -606,7 +606,7 @@ function ($q, $scope, $state, $timeout, $transition$, $filter, Container, Contai
Notifications.error('Failure', err, 'Unable to create container'); Notifications.error('Failure', err, 'Unable to create container');
}) })
.finally(function final() { .finally(function final() {
$scope.state.deploymentInProgress = false; $scope.state.actionInProgress = false;
}); });
}); });
} }

View file

@ -112,9 +112,9 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="col-sm-12"> <div class="col-sm-12">
<button type="button" class="btn btn-primary btn-sm" ng-disabled="state.deploymentInProgress || !config.Image || (!formValues.Registry && fromContainer)" ng-click="create()" button-spinner="state.deploymentInProgress"> <button type="button" class="btn btn-primary btn-sm" ng-disabled="state.actionInProgress || !config.Image || (!formValues.Registry && fromContainer)" ng-click="create()" button-spinner="state.actionInProgress">
<span ng-hide="state.deploymentInProgress">Deploy the container</span> <span ng-hide="state.actionInProgress">Deploy the container</span>
<span ng-show="state.deploymentInProgress">Deployment in progress...</span> <span ng-show="state.actionInProgress">Deployment in progress...</span>
</button> </button>
<span class="text-danger" ng-if="state.formValidationError" style="margin-left: 5px;">{{ state.formValidationError }}</span> <span class="text-danger" ng-if="state.formValidationError" style="margin-left: 5px;">{{ state.formValidationError }}</span>
<span ng-if="fromContainerMultipleNetworks" style="margin-left: 10px"> <span ng-if="fromContainerMultipleNetworks" style="margin-left: 10px">

View file

@ -12,7 +12,7 @@ function ($q, $scope, $state, PluginService, Notifications, NetworkService, Labe
$scope.state = { $scope.state = {
formValidationError: '', formValidationError: '',
deploymentInProgress: false actionInProgress: false
}; };
$scope.availableNetworkDrivers = []; $scope.availableNetworkDrivers = [];
@ -99,7 +99,7 @@ function ($q, $scope, $state, PluginService, Notifications, NetworkService, Labe
return; return;
} }
$scope.state.deploymentInProgress = true; $scope.state.actionInProgress = true;
NetworkService.create(networkConfiguration) NetworkService.create(networkConfiguration)
.then(function success(data) { .then(function success(data) {
var networkIdentifier = data.Id; var networkIdentifier = data.Id;
@ -114,7 +114,7 @@ function ($q, $scope, $state, PluginService, Notifications, NetworkService, Labe
Notifications.error('Failure', err, 'An error occured during network creation'); Notifications.error('Failure', err, 'An error occured during network creation');
}) })
.finally(function final() { .finally(function final() {
$scope.state.deploymentInProgress = false; $scope.state.actionInProgress = false;
}); });
}; };

View file

@ -128,9 +128,9 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="col-sm-12"> <div class="col-sm-12">
<button type="button" class="btn btn-primary btn-sm" ng-disabled="state.deploymentInProgress || !config.Name" ng-click="create()" button-spinner="state.deploymentInProgress"> <button type="button" class="btn btn-primary btn-sm" ng-disabled="state.actionInProgress || !config.Name" ng-click="create()" button-spinner="state.actionInProgress">
<span ng-hide="state.deploymentInProgress">Create the network</span> <span ng-hide="state.actionInProgress">Create the network</span>
<span ng-show="state.deploymentInProgress">Creating network...</span> <span ng-show="state.actionInProgress">Creating network...</span>
</button> </button>
<i id="createResourceSpinner" class="fa fa-cog fa-spin" style="margin-left: 5px; display: none;"></i> <i id="createResourceSpinner" class="fa fa-cog fa-spin" style="margin-left: 5px; display: none;"></i>
<span class="text-danger" ng-if="state.formValidationError" style="margin-left: 5px;">{{ state.formValidationError }}</span> <span class="text-danger" ng-if="state.formValidationError" style="margin-left: 5px;">{{ state.formValidationError }}</span>

View file

@ -4,7 +4,7 @@ function ($scope, $state, RegistryService, Notifications) {
$scope.state = { $scope.state = {
RegistryType: 'quay', RegistryType: 'quay',
deploymentInProgress: false actionInProgress: false
}; };
$scope.formValues = { $scope.formValues = {
@ -34,7 +34,7 @@ function ($scope, $state, RegistryService, Notifications) {
var username = $scope.formValues.Username; var username = $scope.formValues.Username;
var password = $scope.formValues.Password; var password = $scope.formValues.Password;
$scope.state.deploymentInProgress = true; $scope.state.actionInProgress = true;
RegistryService.createRegistry(registryName, registryURL, authentication, username, password) RegistryService.createRegistry(registryName, registryURL, authentication, username, password)
.then(function success(data) { .then(function success(data) {
Notifications.success('Registry successfully created'); Notifications.success('Registry successfully created');
@ -44,7 +44,7 @@ function ($scope, $state, RegistryService, Notifications) {
Notifications.error('Failure', err, 'Unable to create registry'); Notifications.error('Failure', err, 'Unable to create registry');
}) })
.finally(function final() { .finally(function final() {
$scope.state.deploymentInProgress = false; $scope.state.actionInProgress = false;
}); });
}; };
}]); }]);

View file

@ -107,9 +107,9 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="col-sm-12"> <div class="col-sm-12">
<button type="button" class="btn btn-primary btn-sm" ng-disabled="state.deploymentInProgress || !formValues.Name || !formValues.URL || (formValues.Authentication && (!formValues.Username || !formValues.Password))" ng-click="addRegistry()" button-spinner="state.deploymentInProgress"> <button type="button" class="btn btn-primary btn-sm" ng-disabled="state.actionInProgress || !formValues.Name || !formValues.URL || (formValues.Authentication && (!formValues.Username || !formValues.Password))" ng-click="addRegistry()" button-spinner="state.actionInProgress">
<span ng-hide="state.deploymentInProgress">Add registry</span> <span ng-hide="state.actionInProgress">Add registry</span>
<span ng-show="state.deploymentInProgress">Adding registry...</span> <span ng-show="state.actionInProgress">Adding registry...</span>
</button> </button>
</div> </div>
</div> </div>

View file

@ -12,7 +12,7 @@ function ($scope, $state, Notifications, SecretService, LabelHelper, Authenticat
$scope.state = { $scope.state = {
formValidationError: '', formValidationError: '',
deploymentInProgress: false actionInProgress: false
}; };
$scope.addLabel = function() { $scope.addLabel = function() {
@ -65,7 +65,7 @@ function ($scope, $state, Notifications, SecretService, LabelHelper, Authenticat
return; return;
} }
$scope.state.deploymentInProgress = true; $scope.state.actionInProgress = true;
var secretConfiguration = prepareConfiguration(); var secretConfiguration = prepareConfiguration();
SecretService.create(secretConfiguration) SecretService.create(secretConfiguration)
.then(function success(data) { .then(function success(data) {
@ -81,7 +81,7 @@ function ($scope, $state, Notifications, SecretService, LabelHelper, Authenticat
Notifications.error('Failure', err, 'Unable to create secret'); Notifications.error('Failure', err, 'Unable to create secret');
}) })
.finally(function final() { .finally(function final() {
$scope.state.deploymentInProgress = false; $scope.state.actionInProgress = false;
}); });
}; };
}]); }]);

View file

@ -75,9 +75,9 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="col-sm-12"> <div class="col-sm-12">
<button type="button" class="btn btn-primary btn-sm" ng-disabled="state.deploymentInProgress || !formValues.Name || !formValues.Data" ng-click="create()" button-spinner="state.deploymentInProgress"> <button type="button" class="btn btn-primary btn-sm" ng-disabled="state.actionInProgress || !formValues.Name || !formValues.Data" ng-click="create()" button-spinner="state.actionInProgress">
<span ng-hide="state.deploymentInProgress">Create the secret</span> <span ng-hide="state.actionInProgress">Create the secret</span>
<span ng-show="state.deploymentInProgress">Creating secret...</span> <span ng-show="state.actionInProgress">Creating secret...</span>
</button> </button>
<span class="text-danger" ng-if="state.formValidationError" style="margin-left: 5px;">{{ state.formValidationError }}</span> <span class="text-danger" ng-if="state.formValidationError" style="margin-left: 5px;">{{ state.formValidationError }}</span>
</div> </div>

View file

@ -40,7 +40,7 @@ function ($q, $scope, $state, $timeout, Service, ServiceHelper, ConfigService, C
$scope.state = { $scope.state = {
formValidationError: '', formValidationError: '',
deploymentInProgress: false actionInProgress: false
}; };
$scope.refreshSlider = function () { $scope.refreshSlider = function () {
@ -367,7 +367,7 @@ function ($q, $scope, $state, $timeout, Service, ServiceHelper, ConfigService, C
Notifications.error('Failure', err, 'Unable to create service'); Notifications.error('Failure', err, 'Unable to create service');
}) })
.finally(function final() { .finally(function final() {
$scope.state.deploymentInProgress = false; $scope.state.actionInProgress = false;
}); });
} }
@ -393,7 +393,7 @@ function ($q, $scope, $state, $timeout, Service, ServiceHelper, ConfigService, C
return; return;
} }
$scope.state.deploymentInProgress = true; $scope.state.actionInProgress = true;
var config = prepareConfiguration(); var config = prepareConfiguration();
createNewService(config, accessControlData); createNewService(config, accessControlData);
}; };

View file

@ -107,9 +107,9 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="col-sm-12"> <div class="col-sm-12">
<button type="button" class="btn btn-primary btn-sm" ng-disabled="state.deploymentInProgress || !formValues.Image" ng-click="create()" button-spinner="state.deploymentInProgress"> <button type="button" class="btn btn-primary btn-sm" ng-disabled="state.actionInProgress || !formValues.Image" ng-click="create()" button-spinner="state.actionInProgress">
<span ng-hide="state.deploymentInProgress">Create the service</span> <span ng-hide="state.actionInProgress">Create the service</span>
<span ng-show="state.deploymentInProgress">Creating service...</span> <span ng-show="state.actionInProgress">Creating service...</span>
</button> </button>
<span class="text-danger" ng-if="state.formValidationError" style="margin-left: 5px;">{{ state.formValidationError }}</span> <span class="text-danger" ng-if="state.formValidationError" style="margin-left: 5px;">{{ state.formValidationError }}</span>
</div> </div>

View file

@ -19,7 +19,7 @@ function ($scope, $state, $document, StackService, CodeMirrorService, Authentica
$scope.state = { $scope.state = {
Method: 'editor', Method: 'editor',
formValidationError: '', formValidationError: '',
deploymentInProgress: false actionInProgress: false
}; };
$scope.addEnvironmentVariable = function() { $scope.addEnvironmentVariable = function() {
@ -74,7 +74,7 @@ function ($scope, $state, $document, StackService, CodeMirrorService, Authentica
return; return;
} }
$scope.state.deploymentInProgress = true; $scope.state.actionInProgress = true;
createStack(name) createStack(name)
.then(function success(data) { .then(function success(data) {
Notifications.success('Stack successfully deployed'); Notifications.success('Stack successfully deployed');
@ -92,7 +92,7 @@ function ($scope, $state, $document, StackService, CodeMirrorService, Authentica
Notifications.error('Failure', err, 'Unable to apply resource control on the stack'); Notifications.error('Failure', err, 'Unable to apply resource control on the stack');
}) })
.finally(function final() { .finally(function final() {
$scope.state.deploymentInProgress = false; $scope.state.actionInProgress = false;
}); });
}; };

View file

@ -167,12 +167,12 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="col-sm-12"> <div class="col-sm-12">
<button type="button" class="btn btn-primary btn-sm" ng-disabled="state.deploymentInProgress || (state.Method === 'editor' && !formValues.StackFileContent) <button type="button" class="btn btn-primary btn-sm" ng-disabled="state.actionInProgress || (state.Method === 'editor' && !formValues.StackFileContent)
|| (state.Method === 'upload' && !formValues.StackFile) || (state.Method === 'upload' && !formValues.StackFile)
|| (state.Method === 'repository' && (!formValues.RepositoryURL || !formValues.RepositoryPath)) || (state.Method === 'repository' && (!formValues.RepositoryURL || !formValues.RepositoryPath))
|| !formValues.Name" ng-click="deployStack()" button-spinner="state.deploymentInProgress"> || !formValues.Name" ng-click="deployStack()" button-spinner="state.actionInProgress">
<span ng-hide="state.deploymentInProgress">Deploy the stack</span> <span ng-hide="state.actionInProgress">Deploy the stack</span>
<span ng-show="state.deploymentInProgress">Deployment in progress...</span> <span ng-show="state.actionInProgress">Deployment in progress...</span>
</button> </button>
<span class="text-danger" ng-if="state.formValidationError" style="margin-left: 5px;">{{ state.formValidationError }}</span> <span class="text-danger" ng-if="state.formValidationError" style="margin-left: 5px;">{{ state.formValidationError }}</span>
</div> </div>

View file

@ -10,7 +10,7 @@ function ($q, $scope, $state, VolumeService, PluginService, ResourceControlServi
$scope.state = { $scope.state = {
formValidationError: '', formValidationError: '',
deploymentInProgress: false actionInProgress: false
}; };
$scope.availableVolumeDrivers = []; $scope.availableVolumeDrivers = [];
@ -49,7 +49,7 @@ function ($q, $scope, $state, VolumeService, PluginService, ResourceControlServi
return; return;
} }
$scope.state.deploymentInProgress = true; $scope.state.actionInProgress = true;
VolumeService.createVolume(volumeConfiguration) VolumeService.createVolume(volumeConfiguration)
.then(function success(data) { .then(function success(data) {
var volumeIdentifier = data.Id; var volumeIdentifier = data.Id;
@ -64,7 +64,7 @@ function ($q, $scope, $state, VolumeService, PluginService, ResourceControlServi
Notifications.error('Failure', err, 'An error occured during volume creation'); Notifications.error('Failure', err, 'An error occured during volume creation');
}) })
.finally(function final() { .finally(function final() {
$scope.state.deploymentInProgress = false; $scope.state.actionInProgress = false;
}); });
}; };

View file

@ -71,9 +71,9 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="col-sm-12"> <div class="col-sm-12">
<button type="button" class="btn btn-primary btn-sm" ng-click="create()" ng-disabled="state.deploymentInProgress" button-spinner="state.deploymentInProgress"> <button type="button" class="btn btn-primary btn-sm" ng-click="create()" ng-disabled="state.actionInProgress" button-spinner="state.actionInProgress">
<span ng-hide="state.deploymentInProgress">Create the volume</span> <span ng-hide="state.actionInProgress">Create the volume</span>
<span ng-show="state.deploymentInProgress">Creating volume...</span> <span ng-show="state.actionInProgress">Creating volume...</span>
</button> </button>
<span class="text-danger" ng-if="state.formValidationError" style="margin-left: 5px;">{{ state.formValidationError }}</span> <span class="text-danger" ng-if="state.formValidationError" style="margin-left: 5px;">{{ state.formValidationError }}</span>
</div> </div>

View file

@ -53,9 +53,9 @@
<!-- !endpoint-security --> <!-- !endpoint-security -->
<div class="form-group"> <div class="form-group">
<div class="col-sm-12"> <div class="col-sm-12">
<button type="button" class="btn btn-primary btn-sm" ng-disabled="state.deploymentInProgress || !endpoint.Name || !endpoint.URL || (endpoint.TLS && ((endpoint.TLSVerify && !formValues.TLSCACert) || (endpoint.TLSClientCert && (!formValues.TLSCert || !formValues.TLSKey))))" ng-click="updateEndpoint()" button-spinner="state.deploymentInProgress"> <button type="button" class="btn btn-primary btn-sm" ng-disabled="state.actionInProgress || !endpoint.Name || !endpoint.URL || (endpoint.TLS && ((endpoint.TLSVerify && !formValues.TLSCACert) || (endpoint.TLSClientCert && (!formValues.TLSCert || !formValues.TLSKey))))" ng-click="updateEndpoint()" button-spinner="state.actionInProgress">
<span ng-hide="state.deploymentInProgress">Update endpoint</span> <span ng-hide="state.actionInProgress">Update endpoint</span>
<span ng-show="state.deploymentInProgress">Updating endpoint...</span> <span ng-show="state.actionInProgress">Updating endpoint...</span>
</button> </button>
<a type="button" class="btn btn-default btn-sm" ui-sref="endpoints">Cancel</a> <a type="button" class="btn btn-default btn-sm" ui-sref="endpoints">Cancel</a>
</div> </div>

View file

@ -8,7 +8,7 @@ function ($scope, $state, $transition$, $filter, EndpointService, Notifications)
$scope.state = { $scope.state = {
uploadInProgress: false, uploadInProgress: false,
deploymentInProgress: false actionInProgress: false
}; };
$scope.formValues = { $scope.formValues = {
@ -36,14 +36,14 @@ function ($scope, $state, $transition$, $filter, EndpointService, Notifications)
type: $scope.endpointType type: $scope.endpointType
}; };
$scope.state.deploymentInProgress = true; $scope.state.actionInProgress = true;
EndpointService.updateEndpoint(endpoint.Id, endpointParams) EndpointService.updateEndpoint(endpoint.Id, endpointParams)
.then(function success(data) { .then(function success(data) {
Notifications.success('Endpoint updated', $scope.endpoint.Name); Notifications.success('Endpoint updated', $scope.endpoint.Name);
$state.go('endpoints'); $state.go('endpoints');
}, function error(err) { }, function error(err) {
Notifications.error('Failure', err, 'Unable to update endpoint'); Notifications.error('Failure', err, 'Unable to update endpoint');
$scope.state.deploymentInProgress = false; $scope.state.actionInProgress = false;
}, function update(evt) { }, function update(evt) {
if (evt.upload) { if (evt.upload) {
$scope.state.uploadInProgress = evt.upload; $scope.state.uploadInProgress = evt.upload;

View file

@ -65,9 +65,9 @@
<!-- actions --> <!-- actions -->
<div class="form-group"> <div class="form-group">
<div class="col-sm-12"> <div class="col-sm-12">
<button type="submit" class="btn btn-primary btn-sm" ng-disabled="state.deploymentInProgress || !formValues.Name || !formValues.URL || (formValues.TLS && ((formValues.TLSVerify && !formValues.TLSCACert) || (formValues.TLSClientCert && (!formValues.TLSCert || !formValues.TLSKey))))" ng-click="addEndpoint()" button-spinner="state.deploymentInProgress"> <button type="submit" class="btn btn-primary btn-sm" ng-disabled="state.actionInProgress || !formValues.Name || !formValues.URL || (formValues.TLS && ((formValues.TLSVerify && !formValues.TLSCACert) || (formValues.TLSClientCert && (!formValues.TLSCert || !formValues.TLSKey))))" ng-click="addEndpoint()" button-spinner="state.actionInProgress">
<span ng-hide="state.deploymentInProgress"><i class="fa fa-plus" aria-hidden="true"></i> Add endpoint</span> <span ng-hide="state.actionInProgress"><i class="fa fa-plus" aria-hidden="true"></i> Add endpoint</span>
<span ng-show="state.deploymentInProgress">Creating endpoint...</span> <span ng-show="state.actionInProgress">Creating endpoint...</span>
</button> </button>
</div> </div>

View file

@ -5,7 +5,7 @@ function ($scope, $state, $filter, EndpointService, EndpointProvider, Notificati
uploadInProgress: false, uploadInProgress: false,
selectedItemCount: 0, selectedItemCount: 0,
pagination_count: Pagination.getPaginationCount('endpoints'), pagination_count: Pagination.getPaginationCount('endpoints'),
deploymentInProgress: false actionInProgress: false
}; };
$scope.sortType = 'Name'; $scope.sortType = 'Name';
$scope.sortReverse = true; $scope.sortReverse = true;
@ -60,13 +60,13 @@ function ($scope, $state, $filter, EndpointService, EndpointProvider, Notificati
var TLSCertFile = TLSSkipClientVerify ? null : securityData.TLSCert; var TLSCertFile = TLSSkipClientVerify ? null : securityData.TLSCert;
var TLSKeyFile = TLSSkipClientVerify ? null : securityData.TLSKey; var TLSKeyFile = TLSSkipClientVerify ? null : securityData.TLSKey;
$scope.state.deploymentInProgress = true; $scope.state.actionInProgress = true;
EndpointService.createRemoteEndpoint(name, URL, PublicURL, TLS, TLSSkipVerify, TLSSkipClientVerify, TLSCAFile, TLSCertFile, TLSKeyFile).then(function success(data) { EndpointService.createRemoteEndpoint(name, URL, PublicURL, TLS, TLSSkipVerify, TLSSkipClientVerify, TLSCAFile, TLSCertFile, TLSKeyFile).then(function success(data) {
Notifications.success('Endpoint created', name); Notifications.success('Endpoint created', name);
$state.reload(); $state.reload();
}, function error(err) { }, function error(err) {
$scope.state.uploadInProgress = false; $scope.state.uploadInProgress = false;
$scope.state.deploymentInProgress = false; $scope.state.actionInProgress = false;
Notifications.error('Failure', err, 'Unable to create endpoint'); Notifications.error('Failure', err, 'Unable to create endpoint');
}, function update(evt) { }, function update(evt) {
if (evt.upload) { if (evt.upload) {

View file

@ -28,9 +28,9 @@
<!-- !tag-note --> <!-- !tag-note -->
<div class="form-group"> <div class="form-group">
<div class="col-sm-12"> <div class="col-sm-12">
<button type="button" class="btn btn-primary btn-sm" ng-disabled="state.deploymentInProgress || !formValues.Image" ng-click="pullImage()" button-spinner="state.deploymentInProgress"> <button type="button" class="btn btn-primary btn-sm" ng-disabled="state.actionInProgress || !formValues.Image" ng-click="pullImage()" button-spinner="state.actionInProgress">
<span ng-hide="state.deploymentInProgress">Pull the image</span> <span ng-hide="state.actionInProgress">Pull the image</span>
<span ng-show="state.deploymentInProgress">Download in progress...</span> <span ng-show="state.actionInProgress">Download in progress...</span>
</button> </button>
</div> </div>
</div> </div>

View file

@ -3,7 +3,7 @@ angular.module('images', [])
function ($scope, $state, ImageService, Notifications, Pagination, ModalService) { function ($scope, $state, ImageService, Notifications, Pagination, ModalService) {
$scope.state = { $scope.state = {
pagination_count: Pagination.getPaginationCount('images'), pagination_count: Pagination.getPaginationCount('images'),
deploymentInProgress: false, actionInProgress: false,
selectedItemCount: 0 selectedItemCount: 0
}; };
@ -45,7 +45,7 @@ function ($scope, $state, ImageService, Notifications, Pagination, ModalService)
var image = $scope.formValues.Image; var image = $scope.formValues.Image;
var registry = $scope.formValues.Registry; var registry = $scope.formValues.Registry;
$scope.state.deploymentInProgress = true; $scope.state.actionInProgress = true;
ImageService.pullImage(image, registry, false) ImageService.pullImage(image, registry, false)
.then(function success(data) { .then(function success(data) {
Notifications.success('Image successfully pulled', image); Notifications.success('Image successfully pulled', image);
@ -55,7 +55,7 @@ function ($scope, $state, ImageService, Notifications, Pagination, ModalService)
Notifications.error('Failure', err, 'Unable to pull image'); Notifications.error('Failure', err, 'Unable to pull image');
}) })
.finally(function final() { .finally(function final() {
$scope.state.deploymentInProgress = false; $scope.state.actionInProgress = false;
}); });
}; };

View file

@ -64,9 +64,9 @@
<!-- actions --> <!-- actions -->
<div class="form-group"> <div class="form-group">
<div class="col-sm-12"> <div class="col-sm-12">
<button type="submit" class="btn btn-primary btn-sm" ng-disabled="state.deploymentInProgress || formValues.Password.length < 8 || formValues.Password !== formValues.ConfirmPassword" ng-click="createAdminUser()" button-spinner="state.deploymentInProgress"> <button type="submit" class="btn btn-primary btn-sm" ng-disabled="state.actionInProgress || formValues.Password.length < 8 || formValues.Password !== formValues.ConfirmPassword" ng-click="createAdminUser()" button-spinner="state.actionInProgress">
<span ng-hide="state.deploymentInProgress"><i class="fa fa-user-plus" aria-hidden="true"></i> Create user</span> <span ng-hide="state.actionInProgress"><i class="fa fa-user-plus" aria-hidden="true"></i> Create user</span>
<span ng-show="state.deploymentInProgress">Creating user...</span> <span ng-show="state.actionInProgress">Creating user...</span>
</button> </button>
</div> </div>
</div> </div>

View file

@ -11,14 +11,14 @@ function ($scope, $state, $sanitize, Notifications, Authentication, StateManager
}; };
$scope.state = { $scope.state = {
deploymentInProgress: false actionInProgress: false
}; };
$scope.createAdminUser = function() { $scope.createAdminUser = function() {
var username = $sanitize($scope.formValues.Username); var username = $sanitize($scope.formValues.Username);
var password = $sanitize($scope.formValues.Password); var password = $sanitize($scope.formValues.Password);
$scope.state.deploymentInProgress = true; $scope.state.actionInProgress = true;
UserService.initAdministrator(username, password) UserService.initAdministrator(username, password)
.then(function success() { .then(function success() {
return Authentication.login(username, password); return Authentication.login(username, password);
@ -45,7 +45,7 @@ function ($scope, $state, $sanitize, Notifications, Authentication, StateManager
Notifications.error('Failure', err, 'Unable to create administrator user'); Notifications.error('Failure', err, 'Unable to create administrator user');
}) })
.finally(function final() { .finally(function final() {
$scope.state.deploymentInProgress = false; $scope.state.actionInProgress = false;
}); });
}; };

View file

@ -66,9 +66,9 @@
<!-- actions --> <!-- actions -->
<div class="form-group"> <div class="form-group">
<div class="col-sm-12"> <div class="col-sm-12">
<button type="submit" class="btn btn-primary btn-sm" ng-disabled="state.deploymentInProgress" ng-click="createLocalEndpoint()" button-spinner="state.deploymentInProgress"> <button type="submit" class="btn btn-primary btn-sm" ng-disabled="state.actionInProgress" ng-click="createLocalEndpoint()" button-spinner="state.actionInProgress">
<span ng-hide="state.deploymentInProgress"><i class="fa fa-bolt" aria-hidden="true"></i> Connect</span> <span ng-hide="state.actionInProgress"><i class="fa fa-bolt" aria-hidden="true"></i> Connect</span>
<span ng-show="state.deploymentInProgress">Connecting...</span> <span ng-show="state.actionInProgress">Connecting...</span>
</button> </button>
</div> </div>
</div> </div>
@ -186,9 +186,9 @@
<!-- actions --> <!-- actions -->
<div class="form-group"> <div class="form-group">
<div class="col-sm-12"> <div class="col-sm-12">
<button type="submit" class="btn btn-primary btn-sm" ng-disabled="state.deploymentInProgress || !formValues.Name || !formValues.URL || (formValues.TLS && ((formValues.TLSVerify && !formValues.TLSCACert) || (!formValues.TLSSKipClientVerify && (!formValues.TLSCert || !formValues.TLSKey))))" ng-click="createRemoteEndpoint()" button-spinner="state.deploymentInProgress"> <button type="submit" class="btn btn-primary btn-sm" ng-disabled="state.actionInProgress || !formValues.Name || !formValues.URL || (formValues.TLS && ((formValues.TLSVerify && !formValues.TLSCACert) || (!formValues.TLSSKipClientVerify && (!formValues.TLSCert || !formValues.TLSKey))))" ng-click="createRemoteEndpoint()" button-spinner="state.actionInProgress">
<span ng-hide="state.deploymentInProgress"><i class="fa fa-bolt" aria-hidden="true"></i> Connect</span> <span ng-hide="state.actionInProgress"><i class="fa fa-bolt" aria-hidden="true"></i> Connect</span>
<span ng-show="state.deploymentInProgress">Connecting...</span> <span ng-show="state.actionInProgress">Connecting...</span>
</button> </button>
</div> </div>
</div> </div>

View file

@ -10,7 +10,7 @@ function ($scope, $state, EndpointService, StateManager, EndpointProvider, Notif
$scope.state = { $scope.state = {
uploadInProgress: false, uploadInProgress: false,
deploymentInProgress: false actionInProgress: false
}; };
$scope.formValues = { $scope.formValues = {
@ -30,7 +30,7 @@ function ($scope, $state, EndpointService, StateManager, EndpointProvider, Notif
var URL = 'unix:///var/run/docker.sock'; var URL = 'unix:///var/run/docker.sock';
var endpointID = 1; var endpointID = 1;
$scope.state.deploymentInProgress = true; $scope.state.actionInProgress = true;
EndpointService.createLocalEndpoint(name, URL, false, true) EndpointService.createLocalEndpoint(name, URL, false, true)
.then(function success(data) { .then(function success(data) {
endpointID = data.Id; endpointID = data.Id;
@ -45,7 +45,7 @@ function ($scope, $state, EndpointService, StateManager, EndpointProvider, Notif
EndpointService.deleteEndpoint(endpointID); EndpointService.deleteEndpoint(endpointID);
}) })
.finally(function final() { .finally(function final() {
$scope.state.deploymentInProgress = false; $scope.state.actionInProgress = false;
}); });
}; };
@ -61,7 +61,7 @@ function ($scope, $state, EndpointService, StateManager, EndpointProvider, Notif
var TLSKeyFile = TLSSKipClientVerify ? null : $scope.formValues.TLSKey; var TLSKeyFile = TLSSKipClientVerify ? null : $scope.formValues.TLSKey;
var endpointID = 1; var endpointID = 1;
$scope.state.deploymentInProgress = true; $scope.state.actionInProgress = true;
EndpointService.createRemoteEndpoint(name, URL, PublicURL, TLS, TLSSkipVerify, TLSSKipClientVerify, TLSCAFile, TLSCertFile, TLSKeyFile) EndpointService.createRemoteEndpoint(name, URL, PublicURL, TLS, TLSSkipVerify, TLSSKipClientVerify, TLSCAFile, TLSCertFile, TLSKeyFile)
.then(function success(data) { .then(function success(data) {
endpointID = data.Id; endpointID = data.Id;
@ -76,7 +76,7 @@ function ($scope, $state, EndpointService, StateManager, EndpointProvider, Notif
EndpointService.deleteEndpoint(endpointID); EndpointService.deleteEndpoint(endpointID);
}) })
.finally(function final() { .finally(function final() {
$scope.state.deploymentInProgress = false; $scope.state.actionInProgress = false;
}); });
}; };
}]); }]);

View file

@ -56,9 +56,9 @@
<!-- !authentication-credentials --> <!-- !authentication-credentials -->
<div class="form-group"> <div class="form-group">
<div class="col-sm-12"> <div class="col-sm-12">
<button type="button" class="btn btn-primary btn-sm" ng-disabled="state.deploymentInProgress || dockerhub.Authentication && (!dockerhub.Username || !dockerhub.Password)" ng-click="updateDockerHub()" button-spinner="state.deploymentInProgress"> <button type="button" class="btn btn-primary btn-sm" ng-disabled="state.actionInProgress || dockerhub.Authentication && (!dockerhub.Username || !dockerhub.Password)" ng-click="updateDockerHub()" button-spinner="state.actionInProgress">
<span ng-hide="state.deploymentInProgress">Update</span> <span ng-hide="state.actionInProgress">Update</span>
<span ng-show="state.deploymentInProgress">Updating DockerHub settings...</span> <span ng-show="state.actionInProgress">Updating DockerHub settings...</span>
</button> </button>
</div> </div>
</div> </div>

View file

@ -5,14 +5,14 @@ function ($q, $scope, $state, RegistryService, DockerHubService, ModalService, N
$scope.state = { $scope.state = {
selectedItemCount: 0, selectedItemCount: 0,
pagination_count: Pagination.getPaginationCount('registries'), pagination_count: Pagination.getPaginationCount('registries'),
deploymentInProgress: false actionInProgress: false
}; };
$scope.sortType = 'Name'; $scope.sortType = 'Name';
$scope.sortReverse = true; $scope.sortReverse = true;
$scope.updateDockerHub = function() { $scope.updateDockerHub = function() {
var dockerhub = $scope.dockerhub; var dockerhub = $scope.dockerhub;
$scope.state.deploymentInProgress = true; $scope.state.actionInProgress = true;
DockerHubService.update(dockerhub) DockerHubService.update(dockerhub)
.then(function success(data) { .then(function success(data) {
Notifications.success('DockerHub registry updated'); Notifications.success('DockerHub registry updated');
@ -21,7 +21,7 @@ function ($q, $scope, $state, RegistryService, DockerHubService, ModalService, N
Notifications.error('Failure', err, 'Unable to update DockerHub details'); Notifications.error('Failure', err, 'Unable to update DockerHub details');
}) })
.finally(function final() { .finally(function final() {
$scope.state.deploymentInProgress = false; $scope.state.actionInProgress = false;
}); });
}; };

View file

@ -64,9 +64,9 @@
<!-- !authentication-credentials --> <!-- !authentication-credentials -->
<div class="form-group"> <div class="form-group">
<div class="col-sm-12"> <div class="col-sm-12">
<button type="button" class="btn btn-primary btn-sm" ng-disabled="state.deploymentInProgress || !registry.Name || !registry.URL || (registry.Authentication && (!registry.Username || !registry.Password))" ng-click="updateRegistry()" button-spinner="state.deploymentInProgress"> <button type="button" class="btn btn-primary btn-sm" ng-disabled="state.actionInProgress || !registry.Name || !registry.URL || (registry.Authentication && (!registry.Username || !registry.Password))" ng-click="updateRegistry()" button-spinner="state.actionInProgress">
<span ng-hide="state.deploymentInProgress">Update registry</span> <span ng-hide="state.actionInProgress">Update registry</span>
<span ng-show="state.deploymentInProgress">Updating registry...</span> <span ng-show="state.actionInProgress">Updating registry...</span>
</button> </button>
<a type="button" class="btn btn-default btn-sm" ui-sref="registries">Cancel</a> <a type="button" class="btn btn-default btn-sm" ui-sref="registries">Cancel</a>
</div> </div>

View file

@ -3,12 +3,12 @@ angular.module('registry', [])
function ($scope, $state, $transition$, $filter, RegistryService, Notifications) { function ($scope, $state, $transition$, $filter, RegistryService, Notifications) {
$scope.state = { $scope.state = {
deploymentInProgress: false actionInProgress: false
}; };
$scope.updateRegistry = function() { $scope.updateRegistry = function() {
var registry = $scope.registry; var registry = $scope.registry;
$scope.state.deploymentInProgress = true; $scope.state.actionInProgress = true;
RegistryService.updateRegistry(registry) RegistryService.updateRegistry(registry)
.then(function success(data) { .then(function success(data) {
Notifications.success('Registry successfully updated'); Notifications.success('Registry successfully updated');
@ -18,7 +18,7 @@ function ($scope, $state, $transition$, $filter, RegistryService, Notifications)
Notifications.error('Failure', err, 'Unable to update registry'); Notifications.error('Failure', err, 'Unable to update registry');
}) })
.finally(function final() { .finally(function final() {
$scope.state.deploymentInProgress = false; $scope.state.actionInProgress = false;
}); });
}; };

View file

@ -110,9 +110,9 @@
<!-- actions --> <!-- actions -->
<div class="form-group"> <div class="form-group">
<div class="col-sm-12"> <div class="col-sm-12">
<button type="button" class="btn btn-primary btn-sm" ng-click="saveApplicationSettings()" ng-disabled="state.deploymentInProgress" button-spinner="state.deploymentInProgress"> <button type="button" class="btn btn-primary btn-sm" ng-click="saveApplicationSettings()" ng-disabled="state.actionInProgress" button-spinner="state.actionInProgress">
<span ng-hide="state.deploymentInProgress">Save settings</span> <span ng-hide="state.actionInProgress">Save settings</span>
<span ng-show="state.deploymentInProgress">Saving...</span> <span ng-show="state.actionInProgress">Saving...</span>
</button> </button>
</div> </div>
</div> </div>

View file

@ -3,7 +3,7 @@ angular.module('settings', [])
function ($scope, $state, Notifications, SettingsService, StateManager, DEFAULT_TEMPLATES_URL) { function ($scope, $state, Notifications, SettingsService, StateManager, DEFAULT_TEMPLATES_URL) {
$scope.state = { $scope.state = {
deploymentInProgress: false actionInProgress: false
}; };
$scope.formValues = { $scope.formValues = {
@ -49,7 +49,7 @@ function ($scope, $state, Notifications, SettingsService, StateManager, DEFAULT_
settings.AllowBindMountsForRegularUsers = !$scope.formValues.restrictBindMounts; settings.AllowBindMountsForRegularUsers = !$scope.formValues.restrictBindMounts;
settings.AllowPrivilegedModeForRegularUsers = !$scope.formValues.restrictPrivilegedMode; settings.AllowPrivilegedModeForRegularUsers = !$scope.formValues.restrictPrivilegedMode;
$scope.state.deploymentInProgress = true; $scope.state.actionInProgress = true;
updateSettings(settings, false); updateSettings(settings, false);
}; };
@ -72,7 +72,7 @@ function ($scope, $state, Notifications, SettingsService, StateManager, DEFAULT_
Notifications.error('Failure', err, 'Unable to update settings'); Notifications.error('Failure', err, 'Unable to update settings');
}) })
.finally(function final() { .finally(function final() {
$scope.state.deploymentInProgress = false; $scope.state.actionInProgress = false;
}); });
} }

View file

@ -240,9 +240,9 @@
<!-- actions --> <!-- actions -->
<div class="form-group"> <div class="form-group">
<div class="col-sm-12"> <div class="col-sm-12">
<button type="button" class="btn btn-primary btn-sm" ng-click="saveSettings()" ng-disabled="state.deploymentInProgress" button-spinner="state.deploymentInProgress"> <button type="button" class="btn btn-primary btn-sm" ng-click="saveSettings()" ng-disabled="state.actionInProgress" button-spinner="state.actionInProgress">
<span ng-hide="state.deploymentInProgress">Save settings</span> <span ng-hide="state.actionInProgress">Save settings</span>
<span ng-show="state.deploymentInProgress">Saving...</span> <span ng-show="state.actionInProgress">Saving...</span>
</button> </button>
</div> </div>
</div> </div>

View file

@ -7,7 +7,7 @@ function ($q, $scope, Notifications, SettingsService, FileUploadService) {
failedConnectivityCheck: false, failedConnectivityCheck: false,
uploadInProgress: false, uploadInProgress: false,
connectivityCheckInProgress: false, connectivityCheckInProgress: false,
deploymentInProgress: false actionInProgress: false
}; };
$scope.formValues = { $scope.formValues = {
@ -57,7 +57,7 @@ function ($q, $scope, Notifications, SettingsService, FileUploadService) {
var uploadRequired = ($scope.LDAPSettings.TLSConfig.TLS || $scope.LDAPSettings.StartTLS) && !$scope.LDAPSettings.TLSConfig.TLSSkipVerify; var uploadRequired = ($scope.LDAPSettings.TLSConfig.TLS || $scope.LDAPSettings.StartTLS) && !$scope.LDAPSettings.TLSConfig.TLSSkipVerify;
$scope.state.uploadInProgress = uploadRequired; $scope.state.uploadInProgress = uploadRequired;
$scope.state.deploymentInProgress = true; $scope.state.actionInProgress = true;
$q.when(!uploadRequired || FileUploadService.uploadLDAPTLSFiles(TLSCAFile, null, null)) $q.when(!uploadRequired || FileUploadService.uploadLDAPTLSFiles(TLSCAFile, null, null))
.then(function success(data) { .then(function success(data) {
return SettingsService.update(settings); return SettingsService.update(settings);
@ -70,7 +70,7 @@ function ($q, $scope, Notifications, SettingsService, FileUploadService) {
}) })
.finally(function final() { .finally(function final() {
$scope.state.uploadInProgress = false; $scope.state.uploadInProgress = false;
$scope.state.deploymentInProgress = false; $scope.state.actionInProgress = false;
}); });
}; };

View file

@ -72,9 +72,9 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="col-sm-12"> <div class="col-sm-12">
<button type="button" class="btn btn-sm btn-primary" ng-disabled="state.deploymentInProgress" ng-click="deployStack()" button-spinner="state.deploymentInProgress"> <button type="button" class="btn btn-sm btn-primary" ng-disabled="state.actionInProgress" ng-click="deployStack()" button-spinner="state.actionInProgress">
<span ng-hide="state.deploymentInProgress">Update the stack</span> <span ng-hide="state.actionInProgress">Update the stack</span>
<span ng-show="state.deploymentInProgress">Deployment in progress...</span> <span ng-show="state.actionInProgress">Deployment in progress...</span>
</button> </button>
</div> </div>
</div> </div>

View file

@ -3,7 +3,7 @@ angular.module('stack', [])
function ($q, $scope, $state, $stateParams, $document, StackService, NodeService, ServiceService, TaskService, ServiceHelper, CodeMirrorService, Notifications, FormHelper) { function ($q, $scope, $state, $stateParams, $document, StackService, NodeService, ServiceService, TaskService, ServiceHelper, CodeMirrorService, Notifications, FormHelper) {
$scope.state = { $scope.state = {
deploymentInProgress: false actionInProgress: false
}; };
$scope.deployStack = function () { $scope.deployStack = function () {
@ -12,7 +12,7 @@ function ($q, $scope, $state, $stateParams, $document, StackService, NodeService
var stackFile = $scope.editor.getValue(); var stackFile = $scope.editor.getValue();
var env = FormHelper.removeInvalidEnvVars($scope.stack.Env); var env = FormHelper.removeInvalidEnvVars($scope.stack.Env);
$scope.state.deploymentInProgress = true; $scope.state.actionInProgress = true;
StackService.updateStack($scope.stack.Id, stackFile, env) StackService.updateStack($scope.stack.Id, stackFile, env)
.then(function success(data) { .then(function success(data) {
Notifications.success('Stack successfully deployed'); Notifications.success('Stack successfully deployed');
@ -22,7 +22,7 @@ function ($q, $scope, $state, $stateParams, $document, StackService, NodeService
Notifications.error('Failure', err, 'Unable to create stack'); Notifications.error('Failure', err, 'Unable to create stack');
}) })
.finally(function final() { .finally(function final() {
$scope.state.deploymentInProgress = false; $scope.state.actionInProgress = false;
}); });
}; };

View file

@ -49,9 +49,9 @@
<!-- !team-leaders --> <!-- !team-leaders -->
<div class="form-group"> <div class="form-group">
<div class="col-sm-12"> <div class="col-sm-12">
<button type="button" class="btn btn-primary btn-sm" ng-disabled="state.deploymentInProgress || !state.validName || formValues.Name === ''" ng-click="addTeam()" button-spinner="state.deploymentInProgress"> <button type="button" class="btn btn-primary btn-sm" ng-disabled="state.actionInProgress || !state.validName || formValues.Name === ''" ng-click="addTeam()" button-spinner="state.actionInProgress">
<span ng-hide="state.deploymentInProgress"><i class="fa fa-plus" aria-hidden="true"></i> Create team</span> <span ng-hide="state.actionInProgress"><i class="fa fa-plus" aria-hidden="true"></i> Create team</span>
<span ng-show="state.deploymentInProgress">Creating team...</span> <span ng-show="state.actionInProgress">Creating team...</span>
</button> </button>
<span class="text-danger" ng-if="state.teamCreationError" style="margin: 5px;"> <span class="text-danger" ng-if="state.teamCreationError" style="margin: 5px;">
<i class="fa fa-exclamation-circle" aria-hidden="true"></i> {{ state.teamCreationError }} <i class="fa fa-exclamation-circle" aria-hidden="true"></i> {{ state.teamCreationError }}

View file

@ -6,7 +6,7 @@ function ($q, $scope, $state, TeamService, UserService, TeamMembershipService, M
selectedItemCount: 0, selectedItemCount: 0,
validName: false, validName: false,
pagination_count: Pagination.getPaginationCount('teams'), pagination_count: Pagination.getPaginationCount('teams'),
deploymentInProgress: false actionInProgress: false
}; };
$scope.sortType = 'Name'; $scope.sortType = 'Name';
$scope.sortReverse = false; $scope.sortReverse = false;
@ -55,7 +55,7 @@ function ($q, $scope, $state, TeamService, UserService, TeamMembershipService, M
}; };
$scope.addTeam = function() { $scope.addTeam = function() {
$scope.state.deploymentInProgress = true; $scope.state.actionInProgress = true;
$scope.state.teamCreationError = ''; $scope.state.teamCreationError = '';
var teamName = $scope.formValues.Name; var teamName = $scope.formValues.Name;
var leaderIds = []; var leaderIds = [];
@ -72,7 +72,7 @@ function ($q, $scope, $state, TeamService, UserService, TeamMembershipService, M
Notifications.error('Failure', err, 'Unable to create team'); Notifications.error('Failure', err, 'Unable to create team');
}) })
.finally(function final() { .finally(function final() {
$scope.state.deploymentInProgress = false; $scope.state.actionInProgress = false;
}); });
}; };

View file

@ -64,9 +64,9 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="col-sm-12"> <div class="col-sm-12">
<button type="button" class="btn btn-primary btn-sm" ng-disabled="state.deploymentInProgress || !formValues.name" ng-click="createTemplate()" button-spinner="state.deploymentInProgress"> <button type="button" class="btn btn-primary btn-sm" ng-disabled="state.actionInProgress || !formValues.name" ng-click="createTemplate()" button-spinner="state.actionInProgress">
<span ng-hide="state.deploymentInProgress">Deploy the stack</span> <span ng-hide="state.actionInProgress">Deploy the stack</span>
<span ng-show="state.deploymentInProgress">Deployment in progress...</span> <span ng-show="state.actionInProgress">Deployment in progress...</span>
</button> </button>
<span class="text-danger" ng-if="state.formValidationError" style="margin-left: 5px;">{{ state.formValidationError }}</span> <span class="text-danger" ng-if="state.formValidationError" style="margin-left: 5px;">{{ state.formValidationError }}</span>
</div> </div>
@ -296,9 +296,9 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="col-sm-12"> <div class="col-sm-12">
<button type="button" class="btn btn-primary btn-sm" ng-disabled="state.deploymentInProgress || !formValues.network" ng-click="createTemplate()" button-spinner="state.deploymentInProgress"> <button type="button" class="btn btn-primary btn-sm" ng-disabled="state.actionInProgress || !formValues.network" ng-click="createTemplate()" button-spinner="state.actionInProgress">
<span ng-hide="state.deploymentInProgress">Deploy the container</span> <span ng-hide="state.actionInProgress">Deploy the container</span>
<span ng-show="state.deploymentInProgress">Deployment in progress...</span> <span ng-show="state.actionInProgress">Deployment in progress...</span>
</button> </button>
<span class="small text-muted" style="margin-left: 10px" ng-if="globalNetworkCount === 0 && applicationState.endpoint.mode.provider === 'DOCKER_SWARM' && !state.formValidationError"> <span class="small text-muted" style="margin-left: 10px" ng-if="globalNetworkCount === 0 && applicationState.endpoint.mode.provider === 'DOCKER_SWARM' && !state.formValidationError">
When using Swarm, we recommend deploying containers in a shared network. Looks like you don't have any shared network, head over the <a ui-sref="networks">networks view</a> to create one. When using Swarm, we recommend deploying containers in a shared network. Looks like you don't have any shared network, head over the <a ui-sref="networks">networks view</a> to create one.

View file

@ -7,7 +7,7 @@ function ($scope, $q, $state, $transition$, $anchorScroll, $filter, ContainerSer
hideDescriptions: $transition$.params().hide_descriptions, hideDescriptions: $transition$.params().hide_descriptions,
formValidationError: '', formValidationError: '',
showDeploymentSelector: false, showDeploymentSelector: false,
deploymentInProgress: false, actionInProgress: false,
filters: { filters: {
Categories: '!', Categories: '!',
Platform: '!', Platform: '!',
@ -86,7 +86,7 @@ function ($scope, $q, $state, $transition$, $anchorScroll, $filter, ContainerSer
Notifications.error('Failure', err, err.msg); Notifications.error('Failure', err, err.msg);
}) })
.finally(function final() { .finally(function final() {
$scope.state.deploymentInProgress = false; $scope.state.actionInProgress = false;
}); });
} }
@ -114,7 +114,7 @@ function ($scope, $q, $state, $transition$, $anchorScroll, $filter, ContainerSer
$state.go('stacks', {}, {reload: true}); $state.go('stacks', {}, {reload: true});
}) })
.finally(function final() { .finally(function final() {
$scope.state.deploymentInProgress = false; $scope.state.actionInProgress = false;
}); });
} }
@ -131,7 +131,7 @@ function ($scope, $q, $state, $transition$, $anchorScroll, $filter, ContainerSer
var template = $scope.state.selectedTemplate; var template = $scope.state.selectedTemplate;
var templatesKey = $scope.templatesKey; var templatesKey = $scope.templatesKey;
$scope.state.deploymentInProgress = true; $scope.state.actionInProgress = true;
if (template.Type === 'stack') { if (template.Type === 'stack') {
createStackFromTemplate(template, userId, accessControlData); createStackFromTemplate(template, userId, accessControlData);
} else { } else {

View file

@ -97,9 +97,9 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="col-sm-12"> <div class="col-sm-12">
<button type="button" class="btn btn-primary btn-sm" ng-disabled="state.deploymentInProgress || !state.validUsername || formValues.Username === '' || (AuthenticationMethod === 1 && formValues.Password === '') || (AuthenticationMethod === 1 && formValues.Password !== formValues.ConfirmPassword)" ng-click="addUser()" button-spinner="state.deploymentInProgress"> <button type="button" class="btn btn-primary btn-sm" ng-disabled="state.actionInProgress || !state.validUsername || formValues.Username === '' || (AuthenticationMethod === 1 && formValues.Password === '') || (AuthenticationMethod === 1 && formValues.Password !== formValues.ConfirmPassword)" ng-click="addUser()" button-spinner="state.actionInProgress">
<span ng-hide="state.deploymentInProgress"><i class="fa fa-plus" aria-hidden="true"></i> Create user</span> <span ng-hide="state.actionInProgress"><i class="fa fa-plus" aria-hidden="true"></i> Create user</span>
<span ng-show="state.deploymentInProgress">Creating user...</span> <span ng-show="state.actionInProgress">Creating user...</span>
</button> </button>
<span class="text-danger" ng-if="state.userCreationError" style="margin: 5px;"> <span class="text-danger" ng-if="state.userCreationError" style="margin: 5px;">
<i class="fa fa-exclamation-circle" aria-hidden="true"></i> {{ state.userCreationError }} <i class="fa fa-exclamation-circle" aria-hidden="true"></i> {{ state.userCreationError }}

View file

@ -6,7 +6,7 @@ function ($q, $scope, $state, $sanitize, UserService, TeamService, TeamMembershi
selectedItemCount: 0, selectedItemCount: 0,
validUsername: false, validUsername: false,
pagination_count: Pagination.getPaginationCount('users'), pagination_count: Pagination.getPaginationCount('users'),
deploymentInProgress: false actionInProgress: false
}; };
$scope.sortType = 'RoleName'; $scope.sortType = 'RoleName';
$scope.sortReverse = false; $scope.sortReverse = false;
@ -58,7 +58,7 @@ function ($q, $scope, $state, $sanitize, UserService, TeamService, TeamMembershi
}; };
$scope.addUser = function() { $scope.addUser = function() {
$scope.state.deploymentInProgress = true; $scope.state.actionInProgress = true;
$scope.state.userCreationError = ''; $scope.state.userCreationError = '';
var username = $sanitize($scope.formValues.Username); var username = $sanitize($scope.formValues.Username);
var password = $sanitize($scope.formValues.Password); var password = $sanitize($scope.formValues.Password);
@ -76,7 +76,7 @@ function ($q, $scope, $state, $sanitize, UserService, TeamService, TeamMembershi
Notifications.error('Failure', err, 'Unable to create user'); Notifications.error('Failure', err, 'Unable to create user');
}) })
.finally(function final() { .finally(function final() {
$scope.state.deploymentInProgress = false; $scope.state.actionInProgress = false;
}); });
}; };