From d68708add71d959f6819796061ab57816bb2b368 Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Sun, 12 Nov 2017 20:27:28 +0100 Subject: [PATCH 1/3] feat(ux): replace spinners (#1383) --- app/__module.js | 1 + app/app.js | 11 +- app/components/config/config.html | 1 - app/components/config/configController.js | 8 - app/components/configs/configs.html | 1 - app/components/configs/configsController.js | 16 - app/components/container/container.html | 626 +++++++++--------- .../container/containerController.js | 41 +- .../containerConsole/containerConsole.html | 17 +- .../containerConsoleController.js | 17 +- .../containerInspectController.js | 9 +- .../containerLogs/containerLogsController.js | 5 - .../containerLogs/containerlogs.html | 4 +- .../containerStats/containerStats.html | 4 +- .../containerStatsController.js | 9 - app/components/containers/containers.html | 1 - .../containers/containersController.js | 18 +- .../createConfig/createConfigController.js | 6 - app/components/createConfig/createconfig.html | 2 - .../createContainerController.js | 9 +- .../createContainer/createcontainer.html | 7 +- .../createNetwork/createNetworkController.js | 13 +- .../createNetwork/createnetwork.html | 10 +- .../createRegistryController.js | 7 +- .../createRegistry/createregistry.html | 13 +- .../createSecret/createSecretController.js | 8 +- app/components/createSecret/createsecret.html | 7 +- .../createService/createServiceController.js | 12 +- .../createService/createservice.html | 11 +- .../createStack/createStackController.js | 9 +- app/components/createStack/createstack.html | 13 +- .../createVolume/createVolumeController.js | 12 +- app/components/createVolume/createvolume.html | 11 +- app/components/dashboard/dashboard.html | 7 +- .../dashboard/dashboardController.js | 4 - app/components/endpoint/endpoint.html | 10 +- app/components/endpoint/endpointController.js | 10 +- .../endpointAccess/endpointAccess.html | 4 +- .../endpointAccessController.js | 4 - app/components/endpoints/endpoints.html | 8 +- .../endpoints/endpointsController.js | 20 +- app/components/engine/engine.html | 1 - app/components/engine/engineController.js | 6 +- app/components/events/events.html | 1 - app/components/events/eventsController.js | 4 - app/components/image/image.html | 15 +- app/components/image/imageController.js | 24 +- app/components/images/images.html | 7 +- app/components/images/imagesController.js | 30 +- app/components/initAdmin/initAdmin.html | 6 +- .../initAdmin/initAdminController.js | 8 +- app/components/initEndpoint/initEndpoint.html | 12 +- .../initEndpoint/initEndpointController.js | 15 +- app/components/network/network.html | 4 +- app/components/network/networkController.js | 17 - app/components/networks/networks.html | 1 - app/components/networks/networksController.js | 16 - app/components/node/nodeController.js | 2 - app/components/registries/registries.html | 7 +- .../registries/registriesController.js | 24 +- app/components/registry/registry.html | 10 +- app/components/registry/registryController.js | 12 +- .../registryAccess/registryAccess.html | 4 +- .../registryAccessController.js | 4 - app/components/secret/secret.html | 1 - app/components/secret/secretController.js | 8 - app/components/secrets/secrets.html | 1 - app/components/secrets/secretsController.js | 16 - app/components/service/service.html | 1 - app/components/service/serviceController.js | 11 - .../serviceLogs/serviceLogsController.js | 5 - app/components/serviceLogs/servicelogs.html | 4 +- app/components/services/services.html | 1 - app/components/services/servicesController.js | 19 - app/components/settings/settings.html | 11 +- app/components/settings/settingsController.js | 13 +- .../settingsAuthentication.html | 17 +- .../settingsAuthenticationController.js | 16 +- app/components/stack/stack.html | 7 +- app/components/stack/stackController.js | 13 +- app/components/stacks/stacks.html | 1 - app/components/stacks/stacksController.js | 19 - app/components/swarm/swarm.html | 1 - app/components/swarm/swarmController.js | 5 - .../swarmVisualizer/swarmVisualizer.html | 1 - .../swarmVisualizerController.js | 4 - app/components/task/task.html | 4 +- app/components/task/taskController.js | 4 - app/components/team/team.html | 4 +- app/components/team/teamController.js | 32 - app/components/teams/teams.html | 7 +- app/components/teams/teamsController.js | 23 +- app/components/templates/templates.html | 19 +- .../templates/templatesController.js | 12 +- app/components/user/user.html | 4 +- app/components/user/userController.js | 16 - app/components/userSettings/userSettings.html | 4 +- .../userSettings/userSettingsController.js | 3 - app/components/users/users.html | 7 +- app/components/users/usersController.js | 23 +- app/components/volume/volume.html | 4 +- app/components/volume/volumeController.js | 8 - app/components/volumes/volumes.html | 1 - app/components/volumes/volumesController.js | 24 +- app/config.js | 6 +- .../porAccessControlFormController.js | 5 - .../porAccessControlPanelController.js | 10 - app/directives/buttonSpinner.js | 14 + app/directives/header.js | 2 +- app/rest/api/auth.js | 2 +- app/rest/api/endpoint.js | 2 +- app/rest/api/registry.js | 2 +- app/rest/api/resourceControl.js | 2 +- app/rest/api/settings.js | 4 +- app/rest/api/stack.js | 4 +- app/rest/api/team.js | 2 +- app/rest/api/teamMembership.js | 2 +- app/rest/api/user.js | 10 +- app/rest/docker/config.js | 2 +- app/rest/docker/container.js | 9 +- app/rest/docker/containerCommit.js | 2 +- app/rest/docker/containerLogs.js | 3 +- app/rest/docker/exec.js | 2 +- app/rest/docker/image.js | 8 +- app/rest/docker/network.js | 2 +- app/rest/docker/secret.js | 2 +- app/rest/docker/service.js | 3 +- app/rest/docker/system.js | 4 +- app/rest/docker/volume.js | 2 +- app/services/fileUpload.js | 11 +- assets/css/app.css | 28 +- bower.json | 3 +- vendor.yml | 4 + 133 files changed, 701 insertions(+), 1061 deletions(-) create mode 100644 app/directives/buttonSpinner.js diff --git a/app/__module.js b/app/__module.js index e4468a0d0..54ab077ce 100644 --- a/app/__module.js +++ b/app/__module.js @@ -9,6 +9,7 @@ angular.module('portainer', [ 'LocalStorageModule', 'angular-jwt', 'angular-google-analytics', + 'angular-loading-bar', 'portainer.templates', 'portainer.filters', 'portainer.rest', diff --git a/app/app.js b/app/app.js index 21fa6ce67..1d798a4ea 100644 --- a/app/app.js +++ b/app/app.js @@ -1,5 +1,5 @@ angular.module('portainer') -.run(['$rootScope', '$state', 'Authentication', 'authManager', 'StateManager', 'EndpointProvider', 'Notifications', 'Analytics', function ($rootScope, $state, Authentication, authManager, StateManager, EndpointProvider, Notifications, Analytics) { +.run(['$rootScope', '$state', 'Authentication', 'authManager', 'StateManager', 'EndpointProvider', 'Notifications', 'Analytics', 'cfpLoadingBar', function ($rootScope, $state, Authentication, authManager, StateManager, EndpointProvider, Notifications, Analytics, cfpLoadingBar) { 'use strict'; EndpointProvider.initialize(); @@ -18,6 +18,15 @@ angular.module('portainer') }); $rootScope.$state = $state; + + // Workaround to prevent the loading bar from going backward + // https://github.com/chieffancypants/angular-loading-bar/issues/273 + var originalSet = cfpLoadingBar.set; + cfpLoadingBar.set = function overrideSet(n) { + if (n > cfpLoadingBar.status()) { + originalSet.apply(cfpLoadingBar, arguments); + } + }; }]); diff --git a/app/components/config/config.html b/app/components/config/config.html index ec7497c79..a334dec47 100644 --- a/app/components/config/config.html +++ b/app/components/config/config.html @@ -3,7 +3,6 @@ - Configs > {{ config.Name }} diff --git a/app/components/config/configController.js b/app/components/config/configController.js index 6ae37c21f..67bc39e3f 100644 --- a/app/components/config/configController.js +++ b/app/components/config/configController.js @@ -3,7 +3,6 @@ angular.module('config', []) function ($scope, $transition$, $state, $document, ConfigService, Notifications, CodeMirrorService) { $scope.removeConfig = function removeConfig(configId) { - $('#loadingViewSpinner').show(); ConfigService.remove(configId) .then(function success(data) { Notifications.success('Config successfully removed'); @@ -11,9 +10,6 @@ function ($scope, $transition$, $state, $document, ConfigService, Notifications, }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to remove config'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); }; @@ -27,7 +23,6 @@ function ($scope, $transition$, $state, $document, ConfigService, Notifications, } function initView() { - $('#loadingViewSpinner').show(); ConfigService.config($transition$.params().id) .then(function success(data) { $scope.config = data; @@ -35,9 +30,6 @@ function ($scope, $transition$, $state, $document, ConfigService, Notifications, }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to retrieve config details'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } diff --git a/app/components/configs/configs.html b/app/components/configs/configs.html index 3464a8508..9c5fb4624 100644 --- a/app/components/configs/configs.html +++ b/app/components/configs/configs.html @@ -3,7 +3,6 @@ - Configs diff --git a/app/components/configs/configsController.js b/app/components/configs/configsController.js index 64f894986..d777aaf61 100644 --- a/app/components/configs/configsController.js +++ b/app/components/configs/configsController.js @@ -30,17 +30,8 @@ function ($scope, $stateParams, $state, ConfigService, Notifications, Pagination }; $scope.removeAction = function () { - $('#loadingViewSpinner').show(); - var counter = 0; - var complete = function () { - counter = counter - 1; - if (counter === 0) { - $('#loadingViewSpinner').hide(); - } - }; angular.forEach($scope.configs, function (config) { if (config.Checked) { - counter = counter + 1; ConfigService.remove(config.Id) .then(function success() { Notifications.success('Config deleted', config.Id); @@ -49,16 +40,12 @@ function ($scope, $stateParams, $state, ConfigService, Notifications, Pagination }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to remove config'); - }) - .finally(function final() { - complete(); }); } }); }; function initView() { - $('#loadingViewSpinner').show(); ConfigService.configs() .then(function success(data) { $scope.configs = data; @@ -66,9 +53,6 @@ function ($scope, $stateParams, $state, ConfigService, Notifications, Pagination .catch(function error(err) { $scope.configs = []; Notifications.error('Failure', err, 'Unable to retrieve configs'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } diff --git a/app/components/container/container.html b/app/components/container/container.html index 2608d9323..15d960dda 100644 --- a/app/components/container/container.html +++ b/app/components/container/container.html @@ -1,330 +1,334 @@ - Containers > {{ container.Name|trimcontainername }} -
-
- - - -
- - - - - - - - - -
-
-
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ID{{ container.Id }}
Name - {{ container.Name|trimcontainername }} - - -
- - - -
-
IP address{{ container.NetworkSettings.IPAddress }}
Status - - - {{ container.State|getstatetext }} since {{ activityTime }} with exit code {{ container.State.ExitCode }} -
Created{{ container.Created|getisodate }}
Start time{{ container.State.StartedAt|getisodate }}
Finished{{ container.State.FinishedAt|getisodate }}
- -
-
-
-
-
- - - - - - -
-
- - - - - - - - - - - - - - - - - - -
Status - - {{ container.State.Health.Status }} -
Failure count{{ container.State.Health.FailingStreak }}
Last output{{ container.State.Health.Log[container.State.Health.Log.length - 1].Output }}
-
-
-
-
- -
-
- - - -
- -
-
- - You can create an image from this container, this allows you to backup important data or save - helpful configurations. You'll be able to spin up another container based on this image afterward. - -
+
+
+ + + +
+ + + + + + + + +
- - -
- -
- - -
-
- Note: if you don't specify the tag in the image name, latest will be used. -
-
- -
-
- - -
-
- -
-
+ + +
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Image{{ container.Image }}
Port configuration -
- {{ portMapping.container }} {{ portMapping.host }} -
-
CMD{{ container.Config.Cmd|command }}
ENV - - - - - -
{{ var|key: '=' }}{{ var|value: '=' }}
-
Labels - - - - - -
{{ k }}{{ v }}
-
Restart policies - - - - - - - - - -
Name{{ container.HostConfig.RestartPolicy.Name }}
MaximumRetryCount - {{ container.HostConfig.RestartPolicy.MaximumRetryCount }} -
-
-
-
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ID{{ container.Id }}
Name + {{ container.Name|trimcontainername }} + + +
+ + + +
+
IP address{{ container.NetworkSettings.IPAddress }}
Status + + + {{ container.State|getstatetext }} since {{ activityTime }} with exit code {{ container.State.ExitCode }} +
Created{{ container.Created|getisodate }}
Start time{{ container.State.StartedAt|getisodate }}
Finished{{ container.State.FinishedAt|getisodate }}
+ +
+
+
+
-
-
-
- - - - - - - - - - - - - - - - - -
Host/volumePath in container
{{ vol.Source }}{{ vol.Name }}{{ vol.Destination }}
-
-
+ + + + + +
+
+ + + + + + + + + + + + + + + + + + +
Status + + {{ container.State.Health.Status }} +
Failure count{{ container.State.Health.FailingStreak }}
Last output{{ container.State.Health.Log[container.State.Health.Log.length - 1].Output }}
+
+
+
-
-
-
- - -
- Items per page: - -
-
- - - - - - - - - - - - - - - - - - - - - -
Network NameIP AddressGatewayMacAddressActions
{{ key }}{{ value.IPAddress || '-' }}{{ value.Gateway || '-' }}{{ value.MacAddress || '-' }} - -
No networks connected.
-
- -
-
-
- -
- -
- +
+
+ + + + + +
+
+ + You can create an image from this container, this allows you to backup important data or save + helpful configurations. You'll be able to spin up another container based on this image afterward. + +
-
- + + +
+
+ + +
+
+ Note: if you don't specify the tag in the image name, latest will be used. +
+
+ +
+
+ +
+
+ + + +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Image{{ container.Image }}
Port configuration +
+ {{ portMapping.container }} {{ portMapping.host }} +
+
CMD{{ container.Config.Cmd|command }}
ENV + + + + + +
{{ var|key: '=' }}{{ var|value: '=' }}
+
Labels + + + + + +
{{ k }}{{ v }}
+
Restart policies + + + + + + + + + +
Name{{ container.HostConfig.RestartPolicy.Name }}
MaximumRetryCount + {{ container.HostConfig.RestartPolicy.MaximumRetryCount }} +
+
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + +
Host/volumePath in container
{{ vol.Source }}{{ vol.Name }}{{ vol.Destination }}
+
+
+
+
+ +
+
+ + +
+ Items per page: +
- - -
+ + + + + + + + + + + + + + + + + + + + + + +
Network NameIP AddressGatewayMacAddressActions
{{ key }}{{ value.IPAddress || '-' }}{{ value.Gateway || '-' }}{{ value.MacAddress || '-' }} + +
No networks connected.
+
+ +
+
+
+ +
+ +
+ +
+
+ +
+
+
+
+ +
-
diff --git a/app/components/container/containerController.js b/app/components/container/containerController.js index e7a18a95f..c75f6894a 100644 --- a/app/components/container/containerController.js +++ b/app/components/container/containerController.js @@ -7,15 +7,17 @@ function ($q, $scope, $state, $transition$, $filter, Container, ContainerCommit, Image: '', Registry: '' }; - $scope.state = {}; - $scope.state.pagination_count = Pagination.getPaginationCount('container_networks'); + $scope.state = { + joinNetworkInProgress: false, + leaveNetworkInProgress: false, + pagination_count: Pagination.getPaginationCount('container_networks') + }; $scope.changePaginationCount = function() { Pagination.setPaginationCount('container_networks', $scope.state.pagination_count); }; var update = function () { - $('#loadingViewSpinner').show(); Container.get({id: $transition$.params().id}, function (d) { var container = new ContainerDetailsViewModel(d); $scope.container = container; @@ -41,15 +43,12 @@ function ($q, $scope, $state, $transition$, $filter, Container, ContainerCommit, } }); } - $('#loadingViewSpinner').hide(); }, function (e) { - $('#loadingViewSpinner').hide(); Notifications.error('Failure', e, 'Unable to retrieve container info'); }); }; $scope.start = function () { - $('#loadingViewSpinner').show(); Container.start({id: $scope.container.Id}, {}, function (d) { update(); Notifications.success('Container started', $transition$.params().id); @@ -60,7 +59,6 @@ function ($q, $scope, $state, $transition$, $filter, Container, ContainerCommit, }; $scope.stop = function () { - $('#loadingViewSpinner').show(); Container.stop({id: $transition$.params().id}, function (d) { update(); Notifications.success('Container stopped', $transition$.params().id); @@ -71,7 +69,6 @@ function ($q, $scope, $state, $transition$, $filter, Container, ContainerCommit, }; $scope.kill = function () { - $('#loadingViewSpinner').show(); Container.kill({id: $transition$.params().id}, function (d) { update(); Notifications.success('Container killed', $transition$.params().id); @@ -82,23 +79,19 @@ function ($q, $scope, $state, $transition$, $filter, Container, ContainerCommit, }; $scope.commit = function () { - $('#createImageSpinner').show(); var image = $scope.config.Image; var registry = $scope.config.Registry; var imageConfig = ImageHelper.createImageConfigForCommit(image, registry.URL); ContainerCommit.commit({id: $transition$.params().id, tag: imageConfig.tag, repo: imageConfig.repo}, function (d) { - $('#createImageSpinner').hide(); update(); Notifications.success('Container commited', $transition$.params().id); }, function (e) { - $('#createImageSpinner').hide(); update(); Notifications.error('Failure', e, 'Unable to commit container'); }); }; $scope.pause = function () { - $('#loadingViewSpinner').show(); Container.pause({id: $transition$.params().id}, function (d) { update(); Notifications.success('Container paused', $transition$.params().id); @@ -109,7 +102,6 @@ function ($q, $scope, $state, $transition$, $filter, Container, ContainerCommit, }; $scope.unpause = function () { - $('#loadingViewSpinner').show(); Container.unpause({id: $transition$.params().id}, function (d) { update(); Notifications.success('Container unpaused', $transition$.params().id); @@ -138,7 +130,6 @@ function ($q, $scope, $state, $transition$, $filter, Container, ContainerCommit, }; $scope.remove = function(cleanAssociatedVolumes) { - $('#loadingViewSpinner').show(); ContainerService.remove($scope.container, cleanAssociatedVolumes) .then(function success() { Notifications.success('Container successfully removed'); @@ -146,14 +137,10 @@ function ($q, $scope, $state, $transition$, $filter, Container, ContainerCommit, }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to remove container'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); }; $scope.restart = function () { - $('#loadingViewSpinner').show(); Container.restart({id: $transition$.params().id}, function (d) { update(); Notifications.success('Container restarted', $transition$.params().id); @@ -180,19 +167,18 @@ function ($q, $scope, $state, $transition$, $filter, Container, ContainerCommit, }; $scope.containerLeaveNetwork = function containerLeaveNetwork(container, networkId) { - $('#loadingViewSpinner').show(); + $scope.state.leaveNetworkInProgress = true; Network.disconnect({id: networkId}, { Container: $transition$.params().id, Force: false }, function (d) { if (container.message) { - $('#loadingViewSpinner').hide(); Notifications.error('Error', d, 'Unable to disconnect container from network'); } else { - $('#loadingViewSpinner').hide(); Notifications.success('Container left network', $transition$.params().id); $state.go('container', {id: $transition$.params().id}, {reload: true}); } + $scope.state.leaveNetworkInProgress = false; }, function (e) { - $('#loadingViewSpinner').hide(); Notifications.error('Failure', e, 'Unable to disconnect container from network'); + $scope.state.leaveNetworkInProgress = false; }); }; @@ -219,7 +205,6 @@ function ($q, $scope, $state, $transition$, $filter, Container, ContainerCommit, }; function recreateContainer(pullImage) { - $('#loadingViewSpinner').show(); var container = $scope.container; var config = ContainerHelper.configFromContainer(container.Model); ContainerService.remove(container, true) @@ -254,9 +239,6 @@ function ($q, $scope, $state, $transition$, $filter, Container, ContainerCommit, }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to re-create container'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } @@ -272,19 +254,18 @@ function ($q, $scope, $state, $transition$, $filter, Container, ContainerCommit, }; $scope.containerJoinNetwork = function containerJoinNetwork(container, networkId) { - $('#joinNetworkSpinner').show(); + $scope.state.joinNetworkInProgress = true; Network.connect({id: networkId}, { Container: $transition$.params().id }, function (d) { if (container.message) { - $('#joinNetworkSpinner').hide(); Notifications.error('Error', d, 'Unable to connect container to network'); } else { - $('#joinNetworkSpinner').hide(); Notifications.success('Container joined network', $transition$.params().id); $state.go('container', {id: $transition$.params().id}, {reload: true}); } + $scope.state.joinNetworkInProgress = false; }, function (e) { - $('#joinNetworkSpinner').hide(); Notifications.error('Failure', e, 'Unable to connect container to network'); + $scope.state.joinNetworkInProgress = false; }); }; diff --git a/app/components/containerConsole/containerConsole.html b/app/components/containerConsole/containerConsole.html index 716b5ffb8..bb662f38f 100644 --- a/app/components/containerConsole/containerConsole.html +++ b/app/components/containerConsole/containerConsole.html @@ -1,7 +1,5 @@ - - - + Containers > {{ container.Name|trimcontainername }} > Console @@ -10,11 +8,7 @@
- -
- -
-
+
@@ -54,8 +48,11 @@
-
- +
+
diff --git a/app/components/containerConsole/containerConsoleController.js b/app/components/containerConsole/containerConsoleController.js index 949a72f12..d6de4884f 100644 --- a/app/components/containerConsole/containerConsoleController.js +++ b/app/components/containerConsole/containerConsoleController.js @@ -1,9 +1,11 @@ angular.module('containerConsole', []) .controller('ContainerConsoleController', ['$scope', '$transition$', 'Container', 'Image', 'EndpointProvider', 'Notifications', 'ContainerHelper', 'ContainerService', 'ExecService', function ($scope, $transition$, Container, Image, EndpointProvider, Notifications, ContainerHelper, ContainerService, ExecService) { - $scope.state = {}; - $scope.state.loaded = false; - $scope.state.connected = false; + $scope.state = { + loaded: false, + connected: false + }; + $scope.formValues = {}; var socket, term; @@ -19,25 +21,20 @@ function ($scope, $transition$, Container, Image, EndpointProvider, Notification $scope.container = d; if (d.message) { Notifications.error('Error', d, 'Unable to retrieve container details'); - $('#loadingViewSpinner').hide(); } else { Image.get({id: d.Image}, function(imgData) { $scope.imageOS = imgData.Os; $scope.formValues.command = imgData.Os === 'windows' ? 'powershell' : 'bash'; $scope.state.loaded = true; - $('#loadingViewSpinner').hide(); }, function (e) { Notifications.error('Failure', e, 'Unable to retrieve image details'); - $('#loadingViewSpinner').hide(); }); } }, function (e) { Notifications.error('Failure', e, 'Unable to retrieve container details'); - $('#loadingViewSpinner').hide(); }); $scope.connect = function() { - $('#loadConsoleSpinner').show(); var termWidth = Math.floor(($('#terminal-container').width() - 20) / 8.39); var termHeight = 30; var command = $scope.formValues.isCustomCommand ? @@ -67,9 +64,6 @@ function ($scope, $transition$, Container, Image, EndpointProvider, Notification }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to exec into container'); - }) - .finally(function final() { - $('#loadConsoleSpinner').hide(); }); }; @@ -88,7 +82,6 @@ function ($scope, $transition$, Container, Image, EndpointProvider, Notification $scope.state.connected = true; socket.onopen = function(evt) { - $('#loadConsoleSpinner').hide(); term = new Terminal(); term.on('data', function (data) { diff --git a/app/components/containerInspect/containerInspectController.js b/app/components/containerInspect/containerInspectController.js index ea4219814..66024767d 100644 --- a/app/components/containerInspect/containerInspectController.js +++ b/app/components/containerInspect/containerInspectController.js @@ -2,21 +2,18 @@ angular.module('containerInspect', ['angular-json-tree']) .controller('ContainerInspectController', ['$scope', '$transition$', 'Notifications', 'ContainerService', function ($scope, $transition$, Notifications, ContainerService) { - $scope.state = { DisplayTextView: false }; + $scope.state = { + DisplayTextView: false + }; $scope.containerInfo = {}; function initView() { - $('#loadingViewSpinner').show(); - ContainerService.inspect($transition$.params().id) .then(function success(d) { $scope.containerInfo = d; }) .catch(function error(e) { Notifications.error('Failure', e, 'Unable to inspect container'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } diff --git a/app/components/containerLogs/containerLogsController.js b/app/components/containerLogs/containerLogsController.js index ced15ee57..941dbcc51 100644 --- a/app/components/containerLogs/containerLogsController.js +++ b/app/components/containerLogs/containerLogsController.js @@ -8,20 +8,15 @@ function ($scope, $transition$, $anchorScroll, ContainerLogs, Container) { $scope.stderr = ''; $scope.tailLines = 2000; - $('#loadingViewSpinner').show(); Container.get({id: $transition$.params().id}, function (d) { $scope.container = d; - $('#loadingViewSpinner').hide(); }, function (e) { - $('#loadingViewSpinner').hide(); Notifications.error('Failure', e, 'Unable to retrieve container info'); }); function getLogs() { - $('#loadingViewSpinner').show(); getLogsStdout(); getLogsStderr(); - $('#loadingViewSpinner').hide(); } function getLogsStderr() { diff --git a/app/components/containerLogs/containerlogs.html b/app/components/containerLogs/containerlogs.html index fe12b3732..6eb56250b 100644 --- a/app/components/containerLogs/containerlogs.html +++ b/app/components/containerLogs/containerlogs.html @@ -1,7 +1,5 @@ - - - + Containers > {{ container.Name|trimcontainername }} > Logs diff --git a/app/components/containerStats/containerStats.html b/app/components/containerStats/containerStats.html index 70a7ca9a7..c95dcfafa 100644 --- a/app/components/containerStats/containerStats.html +++ b/app/components/containerStats/containerStats.html @@ -1,7 +1,5 @@ - - - + Containers > {{ container.Name|trimcontainername }} > Stats diff --git a/app/components/containerStats/containerStatsController.js b/app/components/containerStats/containerStatsController.js index 06a8a8618..53f324c3d 100644 --- a/app/components/containerStats/containerStatsController.js +++ b/app/components/containerStats/containerStatsController.js @@ -80,7 +80,6 @@ function ($q, $scope, $transition$, $document, $interval, ContainerService, Char }; function startChartUpdate(networkChart, cpuChart, memoryChart) { - $('#loadingViewSpinner').show(); $q.all({ stats: ContainerService.containerStats($transition$.params().id), top: ContainerService.containerTop($transition$.params().id) @@ -99,9 +98,6 @@ function ($q, $scope, $transition$, $document, $interval, ContainerService, Char .catch(function error(err) { stopRepeater(); Notifications.error('Failure', err, 'Unable to retrieve container statistics'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } @@ -143,17 +139,12 @@ function ($q, $scope, $transition$, $document, $interval, ContainerService, Char } function initView() { - $('#loadingViewSpinner').show(); - ContainerService.container($transition$.params().id) .then(function success(data) { $scope.container = data; }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to retrieve container information'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); $document.ready(function() { diff --git a/app/components/containers/containers.html b/app/components/containers/containers.html index 59f783530..2e5cb8491 100644 --- a/app/components/containers/containers.html +++ b/app/components/containers/containers.html @@ -3,7 +3,6 @@ - Containers diff --git a/app/components/containers/containersController.js b/app/components/containers/containersController.js index 4f9ac54b3..420eedc1d 100644 --- a/app/components/containers/containersController.js +++ b/app/components/containers/containersController.js @@ -1,6 +1,6 @@ angular.module('containers', []) - .controller('ContainersController', ['$q', '$scope', '$filter', 'Container', 'ContainerService', 'ContainerHelper', 'SystemService', 'Notifications', 'Pagination', 'EntityListService', 'ModalService', 'ResourceControlService', 'EndpointProvider', 'LocalStorage', - function ($q, $scope, $filter, Container, ContainerService, ContainerHelper, SystemService, Notifications, Pagination, EntityListService, ModalService, ResourceControlService, EndpointProvider, LocalStorage) { + .controller('ContainersController', ['$q', '$scope', '$state', '$filter', 'Container', 'ContainerService', 'ContainerHelper', 'SystemService', 'Notifications', 'Pagination', 'EntityListService', 'ModalService', 'ResourceControlService', 'EndpointProvider', 'LocalStorage', + function ($q, $scope, $state, $filter, Container, ContainerService, ContainerHelper, SystemService, Notifications, Pagination, EntityListService, ModalService, ResourceControlService, EndpointProvider, LocalStorage) { $scope.state = {}; $scope.state.pagination_count = Pagination.getPaginationCount('containers'); $scope.state.displayAll = LocalStorage.getFilterContainerShowAll(); @@ -24,7 +24,6 @@ angular.module('containers', []) $scope.cleanAssociatedVolumes = false; var update = function (data) { - $('#loadContainersSpinner').show(); $scope.state.selectedItemCount = 0; Container.query(data, function (d) { var containers = d; @@ -45,21 +44,17 @@ angular.module('containers', []) return model; }); updateSelectionFlags(); - $('#loadContainersSpinner').hide(); }, function (e) { - $('#loadContainersSpinner').hide(); Notifications.error('Failure', e, 'Unable to retrieve containers'); $scope.containers = []; }); }; var batch = function (items, action, msg) { - $('#loadContainersSpinner').show(); var counter = 0; var complete = function () { counter = counter - 1; if (counter === 0) { - $('#loadContainersSpinner').hide(); update({all: $scope.state.displayAll ? 1 : 0}); } }; @@ -78,12 +73,13 @@ angular.module('containers', []) else if (action === Container.remove) { ContainerService.remove(c, $scope.cleanAssociatedVolumes) .then(function success() { + var index = items.indexOf(c); + items.splice(index, 1); Notifications.success('Container successfully removed'); + complete(); }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to remove container'); - }) - .finally(function final() { complete(); }); } @@ -108,13 +104,9 @@ angular.module('containers', []) Notifications.error('Failure', e, 'An error occured'); complete(); }); - } } }); - if (counter === 0) { - $('#loadContainersSpinner').hide(); - } }; $scope.selectItems = function (allSelected) { diff --git a/app/components/createConfig/createConfigController.js b/app/components/createConfig/createConfigController.js index f02a334e3..6d390f97f 100644 --- a/app/components/createConfig/createConfigController.js +++ b/app/components/createConfig/createConfigController.js @@ -58,14 +58,11 @@ function ($scope, $state, $document, Notifications, ConfigService, Authenticatio } $scope.create = function () { - $('#createResourceSpinner').show(); - var accessControlData = $scope.formValues.AccessControlData; var userDetails = Authentication.getUserDetails(); var isAdmin = userDetails.role === 1 ? true : false; if (!validateForm(accessControlData, isAdmin)) { - $('#createResourceSpinner').hide(); return; } @@ -83,9 +80,6 @@ function ($scope, $state, $document, Notifications, ConfigService, Authenticatio }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to create config'); - }) - .finally(function final() { - $('#createResourceSpinner').hide(); }); }; diff --git a/app/components/createConfig/createconfig.html b/app/components/createConfig/createconfig.html index 5eee991ca..4256bf487 100644 --- a/app/components/createConfig/createconfig.html +++ b/app/components/createConfig/createconfig.html @@ -62,8 +62,6 @@
- Cancel -
diff --git a/app/components/createContainer/createContainerController.js b/app/components/createContainer/createContainerController.js index ebc5255c8..7258a5fab 100644 --- a/app/components/createContainer/createContainerController.js +++ b/app/components/createContainer/createContainerController.js @@ -20,7 +20,8 @@ function ($q, $scope, $state, $timeout, $transition$, $filter, Container, Contai }; $scope.state = { - formValidationError: '' + formValidationError: '', + deploymentInProgress: false }; $scope.refreshSlider = function () { @@ -570,16 +571,16 @@ function ($q, $scope, $state, $timeout, $transition$, $filter, Container, Contai if (!confirm) { return false; } - $('#createContainerSpinner').show(); + var accessControlData = $scope.formValues.AccessControlData; var userDetails = Authentication.getUserDetails(); var isAdmin = userDetails.role === 1 ? true : false; if (!validateForm(accessControlData, isAdmin)) { - $('#createContainerSpinner').hide(); return; } + $scope.state.deploymentInProgress = true; var config = prepareConfiguration(); createContainer(config, accessControlData); }) @@ -605,7 +606,7 @@ function ($q, $scope, $state, $timeout, $transition$, $filter, Container, Contai Notifications.error('Failure', err, 'Unable to create container'); }) .finally(function final() { - $('#createContainerSpinner').hide(); + $scope.state.deploymentInProgress = false; }); }); } diff --git a/app/components/createContainer/createcontainer.html b/app/components/createContainer/createcontainer.html index c784d7517..d368d4fd7 100644 --- a/app/components/createContainer/createcontainer.html +++ b/app/components/createContainer/createcontainer.html @@ -112,9 +112,10 @@
- - Cancel - + {{ state.formValidationError }} diff --git a/app/components/createNetwork/createNetworkController.js b/app/components/createNetwork/createNetworkController.js index dc804b7a3..33a60dcb0 100644 --- a/app/components/createNetwork/createNetworkController.js +++ b/app/components/createNetwork/createNetworkController.js @@ -11,7 +11,8 @@ function ($q, $scope, $state, PluginService, Notifications, NetworkService, Labe }; $scope.state = { - formValidationError: '' + formValidationError: '', + deploymentInProgress: false }; $scope.availableNetworkDrivers = []; @@ -89,18 +90,16 @@ function ($q, $scope, $state, PluginService, Notifications, NetworkService, Labe } $scope.create = function () { - $('#createResourceSpinner').show(); - var networkConfiguration = prepareConfiguration(); var accessControlData = $scope.formValues.AccessControlData; var userDetails = Authentication.getUserDetails(); var isAdmin = userDetails.role === 1 ? true : false; if (!validateForm(accessControlData, isAdmin)) { - $('#createResourceSpinner').hide(); return; } + $scope.state.deploymentInProgress = true; NetworkService.create(networkConfiguration) .then(function success(data) { var networkIdentifier = data.Id; @@ -115,12 +114,11 @@ function ($q, $scope, $state, PluginService, Notifications, NetworkService, Labe Notifications.error('Failure', err, 'An error occured during network creation'); }) .finally(function final() { - $('#createResourceSpinner').hide(); + $scope.state.deploymentInProgress = false; }); }; function initView() { - $('#loadingViewSpinner').show(); var endpointProvider = $scope.applicationState.endpoint.mode.provider; var apiVersion = $scope.applicationState.endpoint.apiVersion; if(endpointProvider !== 'DOCKER_SWARM') { @@ -130,9 +128,6 @@ function ($q, $scope, $state, PluginService, Notifications, NetworkService, Labe }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to retrieve network drivers'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } } diff --git a/app/components/createNetwork/createnetwork.html b/app/components/createNetwork/createnetwork.html index 4d5636a10..2d85187dc 100644 --- a/app/components/createNetwork/createnetwork.html +++ b/app/components/createNetwork/createnetwork.html @@ -1,7 +1,5 @@ - - - + Networks > Add network @@ -130,8 +128,10 @@
- - Cancel + {{ state.formValidationError }}
diff --git a/app/components/createRegistry/createRegistryController.js b/app/components/createRegistry/createRegistryController.js index d4017f98c..b8dbe77a2 100644 --- a/app/components/createRegistry/createRegistryController.js +++ b/app/components/createRegistry/createRegistryController.js @@ -3,7 +3,8 @@ angular.module('createRegistry', []) function ($scope, $state, RegistryService, Notifications) { $scope.state = { - RegistryType: 'quay' + RegistryType: 'quay', + deploymentInProgress: false }; $scope.formValues = { @@ -27,13 +28,13 @@ function ($scope, $state, RegistryService, Notifications) { }; $scope.addRegistry = function() { - $('#createRegistrySpinner').show(); var registryName = $scope.formValues.Name; var registryURL = $scope.formValues.URL.replace(/^https?\:\/\//i, ''); var authentication = $scope.formValues.Authentication; var username = $scope.formValues.Username; var password = $scope.formValues.Password; + $scope.state.deploymentInProgress = true; RegistryService.createRegistry(registryName, registryURL, authentication, username, password) .then(function success(data) { Notifications.success('Registry successfully created'); @@ -43,7 +44,7 @@ function ($scope, $state, RegistryService, Notifications) { Notifications.error('Failure', err, 'Unable to create registry'); }) .finally(function final() { - $('#createRegistrySpinner').hide(); + $scope.state.deploymentInProgress = false; }); }; }]); diff --git a/app/components/createRegistry/createregistry.html b/app/components/createRegistry/createregistry.html index f1204ba6f..177b8395a 100644 --- a/app/components/createRegistry/createregistry.html +++ b/app/components/createRegistry/createregistry.html @@ -1,7 +1,5 @@ - - - + Registries > Add registry @@ -104,10 +102,15 @@
+
+ Actions +
- - +
diff --git a/app/components/createSecret/createSecretController.js b/app/components/createSecret/createSecretController.js index ce94e676b..5e0030287 100644 --- a/app/components/createSecret/createSecretController.js +++ b/app/components/createSecret/createSecretController.js @@ -11,7 +11,8 @@ function ($scope, $state, Notifications, SecretService, LabelHelper, Authenticat }; $scope.state = { - formValidationError: '' + formValidationError: '', + deploymentInProgress: false }; $scope.addLabel = function() { @@ -55,17 +56,16 @@ function ($scope, $state, Notifications, SecretService, LabelHelper, Authenticat } $scope.create = function () { - $('#createResourceSpinner').show(); var accessControlData = $scope.formValues.AccessControlData; var userDetails = Authentication.getUserDetails(); var isAdmin = userDetails.role === 1 ? true : false; if (!validateForm(accessControlData, isAdmin)) { - $('#createResourceSpinner').hide(); return; } + $scope.state.deploymentInProgress = true; var secretConfiguration = prepareConfiguration(); SecretService.create(secretConfiguration) .then(function success(data) { @@ -81,7 +81,7 @@ function ($scope, $state, Notifications, SecretService, LabelHelper, Authenticat Notifications.error('Failure', err, 'Unable to create secret'); }) .finally(function final() { - $('#createResourceSpinner').hide(); + $scope.state.deploymentInProgress = false; }); }; }]); diff --git a/app/components/createSecret/createsecret.html b/app/components/createSecret/createsecret.html index dbf4efe06..46531fb0e 100644 --- a/app/components/createSecret/createsecret.html +++ b/app/components/createSecret/createsecret.html @@ -75,9 +75,10 @@
- - Cancel - + {{ state.formValidationError }}
diff --git a/app/components/createService/createServiceController.js b/app/components/createService/createServiceController.js index 487104a20..6a874fb85 100644 --- a/app/components/createService/createServiceController.js +++ b/app/components/createService/createServiceController.js @@ -39,7 +39,8 @@ function ($q, $scope, $state, $timeout, Service, ServiceHelper, ConfigService, C }; $scope.state = { - formValidationError: '' + formValidationError: '', + deploymentInProgress: false }; $scope.refreshSlider = function () { @@ -366,7 +367,7 @@ function ($q, $scope, $state, $timeout, Service, ServiceHelper, ConfigService, C Notifications.error('Failure', err, 'Unable to create service'); }) .finally(function final() { - $('#createServiceSpinner').hide(); + $scope.state.deploymentInProgress = false; }); } @@ -383,17 +384,16 @@ function ($q, $scope, $state, $timeout, Service, ServiceHelper, ConfigService, C } $scope.create = function createService() { - $('#createServiceSpinner').show(); var accessControlData = $scope.formValues.AccessControlData; var userDetails = Authentication.getUserDetails(); var isAdmin = userDetails.role === 1 ? true : false; if (!validateForm(accessControlData, isAdmin)) { - $('#createServiceSpinner').hide(); return; } + $scope.state.deploymentInProgress = true; var config = prepareConfiguration(); createNewService(config, accessControlData); }; @@ -422,7 +422,6 @@ function ($q, $scope, $state, $timeout, Service, ServiceHelper, ConfigService, C } function initView() { - $('#loadingViewSpinner').show(); var apiVersion = $scope.applicationState.endpoint.apiVersion; var provider = $scope.applicationState.endpoint.mode.provider; @@ -448,9 +447,6 @@ function ($q, $scope, $state, $timeout, Service, ServiceHelper, ConfigService, C }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to initialize view'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } diff --git a/app/components/createService/createservice.html b/app/components/createService/createservice.html index 14467cfd0..a80636d6e 100644 --- a/app/components/createService/createservice.html +++ b/app/components/createService/createservice.html @@ -1,7 +1,5 @@ - - - + Services > Add service @@ -109,9 +107,10 @@
- - Cancel - + {{ state.formValidationError }}
diff --git a/app/components/createStack/createStackController.js b/app/components/createStack/createStackController.js index bb358ee58..96b40722a 100644 --- a/app/components/createStack/createStackController.js +++ b/app/components/createStack/createStackController.js @@ -18,7 +18,8 @@ function ($scope, $state, $document, StackService, CodeMirrorService, Authentica $scope.state = { Method: 'editor', - formValidationError: '' + formValidationError: '', + deploymentInProgress: false }; $scope.addEnvironmentVariable = function() { @@ -62,8 +63,6 @@ function ($scope, $state, $document, StackService, CodeMirrorService, Authentica } $scope.deployStack = function () { - $('#createResourceSpinner').show(); - var name = $scope.formValues.Name; var accessControlData = $scope.formValues.AccessControlData; @@ -72,10 +71,10 @@ function ($scope, $state, $document, StackService, CodeMirrorService, Authentica var userId = userDetails.ID; if (!validateForm(accessControlData, isAdmin)) { - $('#createResourceSpinner').hide(); return; } + $scope.state.deploymentInProgress = true; createStack(name) .then(function success(data) { Notifications.success('Stack successfully deployed'); @@ -93,7 +92,7 @@ function ($scope, $state, $document, StackService, CodeMirrorService, Authentica Notifications.error('Failure', err, 'Unable to apply resource control on the stack'); }) .finally(function final() { - $('#createResourceSpinner').hide(); + $scope.state.deploymentInProgress = false; }); }; diff --git a/app/components/createStack/createstack.html b/app/components/createStack/createstack.html index fabbbbab7..3f8db82cf 100644 --- a/app/components/createStack/createstack.html +++ b/app/components/createStack/createstack.html @@ -1,7 +1,5 @@ - - - + Stacks > Add stack @@ -169,12 +167,13 @@
- - Cancel - + || !formValues.Name" ng-click="deployStack()" button-spinner="state.deploymentInProgress"> + Deploy the stack + Deployment in progress... + {{ state.formValidationError }}
diff --git a/app/components/createVolume/createVolumeController.js b/app/components/createVolume/createVolumeController.js index 107042181..e71a007ba 100644 --- a/app/components/createVolume/createVolumeController.js +++ b/app/components/createVolume/createVolumeController.js @@ -9,7 +9,8 @@ function ($q, $scope, $state, VolumeService, PluginService, ResourceControlServi }; $scope.state = { - formValidationError: '' + formValidationError: '', + deploymentInProgress: false }; $scope.availableVolumeDrivers = []; @@ -35,7 +36,6 @@ function ($q, $scope, $state, VolumeService, PluginService, ResourceControlServi } $scope.create = function () { - $('#createVolumeSpinner').show(); var name = $scope.formValues.Name; var driver = $scope.formValues.Driver; @@ -46,10 +46,10 @@ function ($q, $scope, $state, VolumeService, PluginService, ResourceControlServi var isAdmin = userDetails.role === 1 ? true : false; if (!validateForm(accessControlData, isAdmin)) { - $('#createVolumeSpinner').hide(); return; } + $scope.state.deploymentInProgress = true; VolumeService.createVolume(volumeConfiguration) .then(function success(data) { var volumeIdentifier = data.Id; @@ -64,12 +64,11 @@ function ($q, $scope, $state, VolumeService, PluginService, ResourceControlServi Notifications.error('Failure', err, 'An error occured during volume creation'); }) .finally(function final() { - $('#createVolumeSpinner').hide(); + $scope.state.deploymentInProgress = false; }); }; function initView() { - $('#loadingViewSpinner').show(); var endpointProvider = $scope.applicationState.endpoint.mode.provider; var apiVersion = $scope.applicationState.endpoint.apiVersion; if (endpointProvider !== 'DOCKER_SWARM') { @@ -79,9 +78,6 @@ function ($q, $scope, $state, VolumeService, PluginService, ResourceControlServi }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to retrieve volume drivers'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } } diff --git a/app/components/createVolume/createvolume.html b/app/components/createVolume/createvolume.html index c9e795dd7..1a0825ba7 100644 --- a/app/components/createVolume/createvolume.html +++ b/app/components/createVolume/createvolume.html @@ -1,7 +1,5 @@ - - - + Volumes > Add volume @@ -73,9 +71,10 @@
- - Cancel - + {{ state.formValidationError }}
diff --git a/app/components/dashboard/dashboard.html b/app/components/dashboard/dashboard.html index 4eb2a64ad..98abf59a2 100644 --- a/app/components/dashboard/dashboard.html +++ b/app/components/dashboard/dashboard.html @@ -1,7 +1,5 @@ - - - + Dashboard @@ -171,6 +169,3 @@
- -
-
diff --git a/app/components/dashboard/dashboardController.js b/app/components/dashboard/dashboardController.js index 82ca08184..7a367c14d 100644 --- a/app/components/dashboard/dashboardController.js +++ b/app/components/dashboard/dashboardController.js @@ -65,8 +65,6 @@ function ($scope, $q, Container, ContainerHelper, Image, Network, Volume, System } function initView() { - $('#loadingViewSpinner').show(); - var endpointProvider = $scope.applicationState.endpoint.mode.provider; var endpointRole = $scope.applicationState.endpoint.mode.role; @@ -86,9 +84,7 @@ function ($scope, $q, Container, ContainerHelper, Image, Network, Volume, System prepareInfoData(d[4]); $scope.serviceCount = d[5].length; $scope.stackCount = d[6].length; - $('#loadingViewSpinner').hide(); }, function(e) { - $('#loadingViewSpinner').hide(); Notifications.error('Failure', e, 'Unable to load dashboard data'); }); } diff --git a/app/components/endpoint/endpoint.html b/app/components/endpoint/endpoint.html index f7a113ab1..860418f12 100644 --- a/app/components/endpoint/endpoint.html +++ b/app/components/endpoint/endpoint.html @@ -1,7 +1,5 @@ - - - + Endpoints > {{ endpoint.Name }} @@ -55,9 +53,11 @@
- + Cancel -
diff --git a/app/components/endpoint/endpointController.js b/app/components/endpoint/endpointController.js index 0d7eef87a..2094150b5 100644 --- a/app/components/endpoint/endpointController.js +++ b/app/components/endpoint/endpointController.js @@ -7,7 +7,8 @@ function ($scope, $state, $transition$, $filter, EndpointService, Notifications) } $scope.state = { - uploadInProgress: false + uploadInProgress: false, + deploymentInProgress: false }; $scope.formValues = { @@ -35,13 +36,14 @@ function ($scope, $state, $transition$, $filter, EndpointService, Notifications) type: $scope.endpointType }; - $('updateResourceSpinner').show(); + $scope.state.deploymentInProgress = true; EndpointService.updateEndpoint(endpoint.Id, endpointParams) .then(function success(data) { Notifications.success('Endpoint updated', $scope.endpoint.Name); $state.go('endpoints'); }, function error(err) { Notifications.error('Failure', err, 'Unable to update endpoint'); + $scope.state.deploymentInProgress = false; }, function update(evt) { if (evt.upload) { $scope.state.uploadInProgress = evt.upload; @@ -50,7 +52,6 @@ function ($scope, $state, $transition$, $filter, EndpointService, Notifications) }; function initView() { - $('#loadingViewSpinner').show(); EndpointService.endpoint($transition$.params().id) .then(function success(data) { var endpoint = data; @@ -64,9 +65,6 @@ function ($scope, $state, $transition$, $filter, EndpointService, Notifications) }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to retrieve endpoint details'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } diff --git a/app/components/endpointAccess/endpointAccess.html b/app/components/endpointAccess/endpointAccess.html index 695dc6955..fcf65c3c4 100644 --- a/app/components/endpointAccess/endpointAccess.html +++ b/app/components/endpointAccess/endpointAccess.html @@ -1,7 +1,5 @@ - - - + Endpoints > {{ endpoint.Name }} > Access management diff --git a/app/components/endpointAccess/endpointAccessController.js b/app/components/endpointAccess/endpointAccessController.js index 06206418a..f4d96710b 100644 --- a/app/components/endpointAccess/endpointAccessController.js +++ b/app/components/endpointAccess/endpointAccessController.js @@ -7,16 +7,12 @@ function ($scope, $transition$, EndpointService, Notifications) { }; function initView() { - $('#loadingViewSpinner').show(); EndpointService.endpoint($transition$.params().id) .then(function success(data) { $scope.endpoint = data; }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to retrieve endpoint details'); - }) - .finally(function final(){ - $('#loadingViewSpinner').hide(); }); } diff --git a/app/components/endpoints/endpoints.html b/app/components/endpoints/endpoints.html index 4812eabe8..1c74e876c 100644 --- a/app/components/endpoints/endpoints.html +++ b/app/components/endpoints/endpoints.html @@ -3,7 +3,6 @@ - Endpoint management @@ -66,8 +65,11 @@
- - + +
diff --git a/app/components/endpoints/endpointsController.js b/app/components/endpoints/endpointsController.js index 01e9670e5..2843c1649 100644 --- a/app/components/endpoints/endpointsController.js +++ b/app/components/endpoints/endpointsController.js @@ -4,7 +4,8 @@ function ($scope, $state, $filter, EndpointService, EndpointProvider, Notificati $scope.state = { uploadInProgress: false, selectedItemCount: 0, - pagination_count: Pagination.getPaginationCount('endpoints') + pagination_count: Pagination.getPaginationCount('endpoints'), + deploymentInProgress: false }; $scope.sortType = 'Name'; $scope.sortReverse = true; @@ -59,11 +60,13 @@ function ($scope, $state, $filter, EndpointService, EndpointProvider, Notificati var TLSCertFile = TLSSkipClientVerify ? null : securityData.TLSCert; var TLSKeyFile = TLSSkipClientVerify ? null : securityData.TLSKey; + $scope.state.deploymentInProgress = true; EndpointService.createRemoteEndpoint(name, URL, PublicURL, TLS, TLSSkipVerify, TLSSkipClientVerify, TLSCAFile, TLSCertFile, TLSKeyFile).then(function success(data) { Notifications.success('Endpoint created', name); $state.reload(); }, function error(err) { $scope.state.uploadInProgress = false; + $scope.state.deploymentInProgress = false; Notifications.error('Failure', err, 'Unable to create endpoint'); }, function update(evt) { if (evt.upload) { @@ -73,32 +76,20 @@ function ($scope, $state, $filter, EndpointService, EndpointProvider, Notificati }; $scope.removeAction = function () { - $('#loadEndpointsSpinner').show(); - var counter = 0; - var complete = function () { - counter = counter - 1; - if (counter === 0) { - $('#loadEndpointsSpinner').hide(); - } - }; angular.forEach($scope.endpoints, function (endpoint) { if (endpoint.Checked) { - counter = counter + 1; EndpointService.deleteEndpoint(endpoint.Id).then(function success(data) { Notifications.success('Endpoint deleted', endpoint.Name); var index = $scope.endpoints.indexOf(endpoint); $scope.endpoints.splice(index, 1); - complete(); }, function error(err) { Notifications.error('Failure', err, 'Unable to remove endpoint'); - complete(); }); } }); }; function fetchEndpoints() { - $('#loadEndpointsSpinner').show(); EndpointService.endpoints() .then(function success(data) { $scope.endpoints = data; @@ -106,9 +97,6 @@ function ($scope, $state, $filter, EndpointService, EndpointProvider, Notificati .catch(function error(err) { Notifications.error('Failure', err, 'Unable to retrieve endpoints'); $scope.endpoints = []; - }) - .finally(function final() { - $('#loadEndpointsSpinner').hide(); }); } diff --git a/app/components/engine/engine.html b/app/components/engine/engine.html index e81f1cdbf..50da2664a 100644 --- a/app/components/engine/engine.html +++ b/app/components/engine/engine.html @@ -3,7 +3,6 @@ - Docker
diff --git a/app/components/engine/engineController.js b/app/components/engine/engineController.js index 9d7c04163..dd3c10181 100644 --- a/app/components/engine/engineController.js +++ b/app/components/engine/engineController.js @@ -1,9 +1,8 @@ angular.module('engine', []) .controller('EngineController', ['$q', '$scope', 'SystemService', 'Notifications', function ($q, $scope, SystemService, Notifications) { - + function initView() { - $('#loadingViewSpinner').show(); $q.all({ version: SystemService.version(), info: SystemService.info() @@ -16,9 +15,6 @@ function ($q, $scope, SystemService, Notifications) { $scope.info = {}; $scope.version = {}; Notifications.error('Failure', err, 'Unable to retrieve engine details'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } diff --git a/app/components/events/events.html b/app/components/events/events.html index 829bc38e3..1170728be 100644 --- a/app/components/events/events.html +++ b/app/components/events/events.html @@ -3,7 +3,6 @@ - Events diff --git a/app/components/events/eventsController.js b/app/components/events/eventsController.js index 97bb1b91a..dc2f2ac31 100644 --- a/app/components/events/eventsController.js +++ b/app/components/events/eventsController.js @@ -19,16 +19,12 @@ function ($scope, Notifications, SystemService, Pagination) { var from = moment().subtract(24, 'hour').unix(); var to = moment().unix(); - $('#loadEventsSpinner').show(); SystemService.events(from, to) .then(function success(data) { $scope.events = data; }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to load events'); - }) - .finally(function final() { - $('#loadEventsSpinner').hide(); }); } diff --git a/app/components/image/image.html b/app/components/image/image.html index 7e4341611..be6d2b9fc 100644 --- a/app/components/image/image.html +++ b/app/components/image/image.html @@ -1,7 +1,5 @@ - - - + Images > {{ image.Id }} @@ -41,6 +39,16 @@ or on the trash icon to delete a tag.
+
+ + +
@@ -69,7 +77,6 @@
-
diff --git a/app/components/image/imageController.js b/app/components/image/imageController.js index 394c7956a..a90b7bb08 100644 --- a/app/components/image/imageController.js +++ b/app/components/image/imageController.js @@ -21,7 +21,6 @@ function ($q, $scope, $transition$, $state, $timeout, ImageService, RegistryServ }; $scope.tagImage = function() { - $('#loadingViewSpinner').show(); var image = $scope.formValues.Image; var registry = $scope.formValues.Registry; @@ -32,14 +31,11 @@ function ($q, $scope, $transition$, $state, $timeout, ImageService, RegistryServ }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to tag image'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); }; $scope.pushTag = function(repository) { - $('#loadingViewSpinner').show(); + $('#uploadResourceHint').show(); RegistryService.retrieveRegistryFromRepository(repository) .then(function success(data) { var registry = data; @@ -52,12 +48,12 @@ function ($q, $scope, $transition$, $state, $timeout, ImageService, RegistryServ Notifications.error('Failure', err, 'Unable to push image to repository'); }) .finally(function final() { - $('#loadingViewSpinner').hide(); + $('#uploadResourceHint').hide(); }); }; $scope.pullTag = function(repository) { - $('#loadingViewSpinner').show(); + $('#downloadResourceHint').show(); RegistryService.retrieveRegistryFromRepository(repository) .then(function success(data) { var registry = data; @@ -70,12 +66,11 @@ function ($q, $scope, $transition$, $state, $timeout, ImageService, RegistryServ Notifications.error('Failure', err, 'Unable to pull image'); }) .finally(function final() { - $('#loadingViewSpinner').hide(); + $('#downloadResourceHint').hide(); }); }; $scope.removeTag = function(repository) { - $('#loadingViewSpinner').show(); ImageService.deleteImage(repository, false) .then(function success() { if ($scope.image.RepoTags.length === 1) { @@ -88,14 +83,10 @@ function ($q, $scope, $transition$, $state, $timeout, ImageService, RegistryServ }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to remove image'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); }; $scope.removeImage = function (id) { - $('#loadingViewSpinner').show(); ImageService.deleteImage(id, false) .then(function success() { Notifications.success('Image successfully deleted', id); @@ -103,14 +94,10 @@ function ($q, $scope, $transition$, $state, $timeout, ImageService, RegistryServ }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to remove image'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); }; function initView() { - $('#loadingViewSpinner').show(); var endpointProvider = $scope.applicationState.endpoint.mode.provider; $q.all({ image: ImageService.image($transition$.params().id), @@ -123,9 +110,6 @@ function ($q, $scope, $transition$, $state, $timeout, ImageService, RegistryServ .catch(function error(err) { Notifications.error('Failure', err, 'Unable to retrieve image details'); $state.go('images'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } diff --git a/app/components/images/images.html b/app/components/images/images.html index 818f55b72..bedf5cab8 100644 --- a/app/components/images/images.html +++ b/app/components/images/images.html @@ -3,7 +3,6 @@ - Images @@ -29,8 +28,10 @@
- - +
diff --git a/app/components/images/imagesController.js b/app/components/images/imagesController.js index 6770f44a9..0a76b343e 100644 --- a/app/components/images/imagesController.js +++ b/app/components/images/imagesController.js @@ -1,11 +1,14 @@ angular.module('images', []) .controller('ImagesController', ['$scope', '$state', 'ImageService', 'Notifications', 'Pagination', 'ModalService', function ($scope, $state, ImageService, Notifications, Pagination, ModalService) { - $scope.state = {}; - $scope.state.pagination_count = Pagination.getPaginationCount('images'); + $scope.state = { + pagination_count: Pagination.getPaginationCount('images'), + deploymentInProgress: false, + selectedItemCount: 0 + }; + $scope.sortType = 'RepoTags'; $scope.sortReverse = true; - $scope.state.selectedItemCount = 0; $scope.formValues = { Image: '', @@ -39,9 +42,10 @@ function ($scope, $state, ImageService, Notifications, Pagination, ModalService) }; $scope.pullImage = function() { - $('#pullImageSpinner').show(); var image = $scope.formValues.Image; var registry = $scope.formValues.Registry; + + $scope.state.deploymentInProgress = true; ImageService.pullImage(image, registry, false) .then(function success(data) { Notifications.success('Image successfully pulled', image); @@ -51,7 +55,7 @@ function ($scope, $state, ImageService, Notifications, Pagination, ModalService) Notifications.error('Failure', err, 'Unable to pull image'); }) .finally(function final() { - $('#pullImageSpinner').hide(); + $scope.state.deploymentInProgress = false; }); }; @@ -64,17 +68,8 @@ function ($scope, $state, ImageService, Notifications, Pagination, ModalService) $scope.removeAction = function (force) { force = !!force; - $('#loadImagesSpinner').show(); - var counter = 0; - var complete = function () { - counter = counter - 1; - if (counter === 0) { - $('#loadImagesSpinner').hide(); - } - }; angular.forEach($scope.images, function (i) { if (i.Checked) { - counter = counter + 1; ImageService.deleteImage(i.Id, force) .then(function success(data) { Notifications.success('Image deleted', i.Id); @@ -83,16 +78,12 @@ function ($scope, $state, ImageService, Notifications, Pagination, ModalService) }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to remove image'); - }) - .finally(function final() { - complete(); }); } }); }; function fetchImages() { - $('#loadImagesSpinner').show(); var endpointProvider = $scope.applicationState.endpoint.mode.provider; var apiVersion = $scope.applicationState.endpoint.apiVersion; ImageService.images(true) @@ -102,9 +93,6 @@ function ($scope, $state, ImageService, Notifications, Pagination, ModalService) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to retrieve images'); $scope.images = []; - }) - .finally(function final() { - $('#loadImagesSpinner').hide(); }); } diff --git a/app/components/initAdmin/initAdmin.html b/app/components/initAdmin/initAdmin.html index 6fbcccaf9..1cff49755 100644 --- a/app/components/initAdmin/initAdmin.html +++ b/app/components/initAdmin/initAdmin.html @@ -64,8 +64,10 @@
- - +
diff --git a/app/components/initAdmin/initAdminController.js b/app/components/initAdmin/initAdminController.js index 0959fcd2e..4e22f9e9d 100644 --- a/app/components/initAdmin/initAdminController.js +++ b/app/components/initAdmin/initAdminController.js @@ -10,11 +10,15 @@ function ($scope, $state, $sanitize, Notifications, Authentication, StateManager ConfirmPassword: '' }; + $scope.state = { + deploymentInProgress: false + }; + $scope.createAdminUser = function() { - $('#createResourceSpinner').show(); var username = $sanitize($scope.formValues.Username); var password = $sanitize($scope.formValues.Password); + $scope.state.deploymentInProgress = true; UserService.initAdministrator(username, password) .then(function success() { return Authentication.login(username, password); @@ -41,7 +45,7 @@ function ($scope, $state, $sanitize, Notifications, Authentication, StateManager Notifications.error('Failure', err, 'Unable to create administrator user'); }) .finally(function final() { - $('#createResourceSpinner').hide(); + $scope.state.deploymentInProgress = false; }); }; diff --git a/app/components/initEndpoint/initEndpoint.html b/app/components/initEndpoint/initEndpoint.html index b7722989b..54512ece6 100644 --- a/app/components/initEndpoint/initEndpoint.html +++ b/app/components/initEndpoint/initEndpoint.html @@ -66,8 +66,10 @@
- - +
@@ -184,8 +186,10 @@
- - +
diff --git a/app/components/initEndpoint/initEndpointController.js b/app/components/initEndpoint/initEndpointController.js index 7b72f7f73..9837d4193 100644 --- a/app/components/initEndpoint/initEndpointController.js +++ b/app/components/initEndpoint/initEndpointController.js @@ -9,7 +9,8 @@ function ($scope, $state, EndpointService, StateManager, EndpointProvider, Notif $scope.logo = StateManager.getState().application.logo; $scope.state = { - uploadInProgress: false + uploadInProgress: false, + deploymentInProgress: false }; $scope.formValues = { @@ -25,11 +26,11 @@ function ($scope, $state, EndpointService, StateManager, EndpointProvider, Notif }; $scope.createLocalEndpoint = function() { - $('#createResourceSpinner').show(); var name = 'local'; var URL = 'unix:///var/run/docker.sock'; - var endpointID = 1; + + $scope.state.deploymentInProgress = true; EndpointService.createLocalEndpoint(name, URL, false, true) .then(function success(data) { endpointID = data.Id; @@ -44,12 +45,11 @@ function ($scope, $state, EndpointService, StateManager, EndpointProvider, Notif EndpointService.deleteEndpoint(endpointID); }) .finally(function final() { - $('#createResourceSpinner').hide(); + $scope.state.deploymentInProgress = false; }); }; $scope.createRemoteEndpoint = function() { - $('#createResourceSpinner').show(); var name = $scope.formValues.Name; var URL = $scope.formValues.URL; var PublicURL = URL.split(':')[0]; @@ -59,8 +59,9 @@ function ($scope, $state, EndpointService, StateManager, EndpointProvider, Notif var TLSCAFile = TLSSkipVerify ? null : $scope.formValues.TLSCACert; var TLSCertFile = TLSSKipClientVerify ? null : $scope.formValues.TLSCert; var TLSKeyFile = TLSSKipClientVerify ? null : $scope.formValues.TLSKey; - var endpointID = 1; + + $scope.state.deploymentInProgress = true; EndpointService.createRemoteEndpoint(name, URL, PublicURL, TLS, TLSSkipVerify, TLSSKipClientVerify, TLSCAFile, TLSCertFile, TLSKeyFile) .then(function success(data) { endpointID = data.Id; @@ -75,7 +76,7 @@ function ($scope, $state, EndpointService, StateManager, EndpointProvider, Notif EndpointService.deleteEndpoint(endpointID); }) .finally(function final() { - $('#createResourceSpinner').hide(); + $scope.state.deploymentInProgress = false; }); }; }]); diff --git a/app/components/network/network.html b/app/components/network/network.html index 8439a7e9f..54fb4af3d 100644 --- a/app/components/network/network.html +++ b/app/components/network/network.html @@ -1,7 +1,5 @@ - - - + Networks > {{ network.Name }} diff --git a/app/components/network/networkController.js b/app/components/network/networkController.js index 87da9d9e8..dfb2b6530 100644 --- a/app/components/network/networkController.js +++ b/app/components/network/networkController.js @@ -3,35 +3,27 @@ angular.module('network', []) function ($scope, $state, $transition$, $filter, Network, NetworkService, Container, ContainerHelper, Notifications) { $scope.removeNetwork = function removeNetwork(networkId) { - $('#loadingViewSpinner').show(); Network.remove({id: $transition$.params().id}, function (d) { if (d.message) { - $('#loadingViewSpinner').hide(); Notifications.error('Error', d, 'Unable to remove network'); } else { - $('#loadingViewSpinner').hide(); Notifications.success('Network removed', $transition$.params().id); $state.go('networks', {}); } }, function (e) { - $('#loadingViewSpinner').hide(); Notifications.error('Failure', e, 'Unable to remove network'); }); }; $scope.containerLeaveNetwork = function containerLeaveNetwork(network, containerId) { - $('#loadingViewSpinner').show(); Network.disconnect({id: $transition$.params().id}, { Container: containerId, Force: false }, function (d) { if (d.message) { - $('#loadingViewSpinner').hide(); Notifications.error('Error', d, 'Unable to disconnect container from network'); } else { - $('#loadingViewSpinner').hide(); Notifications.success('Container left network', $transition$.params().id); $state.go('network', {id: network.Id}, {reload: true}); } }, function (e) { - $('#loadingViewSpinner').hide(); Notifications.error('Failure', e, 'Unable to disconnect container from network'); }); }; @@ -63,9 +55,7 @@ function ($scope, $state, $transition$, $filter, Network, NetworkService, Contai } }); filterContainersInNetwork(network, containersInNetwork); - $('#loadingViewSpinner').hide(); }, function error(err) { - $('#loadingViewSpinner').hide(); Notifications.error('Failure', err, 'Unable to retrieve containers in network'); }); } else { @@ -73,9 +63,7 @@ function ($scope, $state, $transition$, $filter, Network, NetworkService, Contai filters: { network: [$transition$.params().id] } }, function success(data) { filterContainersInNetwork(network, data); - $('#loadingViewSpinner').hide(); }, function error(err) { - $('#loadingViewSpinner').hide(); Notifications.error('Failure', err, 'Unable to retrieve containers in network'); }); } @@ -83,7 +71,6 @@ function ($scope, $state, $transition$, $filter, Network, NetworkService, Contai } function initView() { - $('#loadingViewSpinner').show(); NetworkService.network($transition$.params().id) .then(function success(data) { $scope.network = data; @@ -93,11 +80,7 @@ function ($scope, $state, $transition$, $filter, Network, NetworkService, Contai } }) .catch(function error(err) { - $('#loadingViewSpinner').hide(); Notifications.error('Failure', err, 'Unable to retrieve network info'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } diff --git a/app/components/networks/networks.html b/app/components/networks/networks.html index 59c64627d..ce2f9ce35 100644 --- a/app/components/networks/networks.html +++ b/app/components/networks/networks.html @@ -3,7 +3,6 @@ - Networks diff --git a/app/components/networks/networksController.js b/app/components/networks/networksController.js index 1909358ed..d3a95b33a 100644 --- a/app/components/networks/networksController.js +++ b/app/components/networks/networksController.js @@ -35,17 +35,8 @@ function ($scope, $state, Network, NetworkService, Notifications, Pagination) { }; $scope.removeAction = function () { - $('#loadNetworksSpinner').show(); - var counter = 0; - var complete = function () { - counter = counter - 1; - if (counter === 0) { - $('#loadNetworksSpinner').hide(); - } - }; angular.forEach($scope.networks, function (network) { if (network.Checked) { - counter = counter + 1; Network.remove({id: network.Id}, function (d) { if (d.message) { Notifications.error('Error', d, 'Unable to remove network'); @@ -54,18 +45,14 @@ function ($scope, $state, Network, NetworkService, Notifications, Pagination) { var index = $scope.networks.indexOf(network); $scope.networks.splice(index, 1); } - complete(); }, function (e) { Notifications.error('Failure', e, 'Unable to remove network'); - complete(); }); } }); }; function initView() { - $('#loadNetworksSpinner').show(); - NetworkService.networks(true, true, true, true) .then(function success(data) { $scope.networks = data; @@ -73,9 +60,6 @@ function ($scope, $state, Network, NetworkService, Notifications, Pagination) { .catch(function error(err) { $scope.networks = []; Notifications.error('Failure', err, 'Unable to retrieve networks'); - }) - .finally(function final() { - $('#loadNetworksSpinner').hide(); }); } diff --git a/app/components/node/nodeController.js b/app/components/node/nodeController.js index 524038c49..e572219a1 100644 --- a/app/components/node/nodeController.js +++ b/app/components/node/nodeController.js @@ -68,11 +68,9 @@ function ($scope, $state, $transition$, LabelHelper, Node, NodeHelper, Task, Pag config.Labels = LabelHelper.fromKeyValueToLabelHash(node.Labels); Node.update({ id: node.Id, version: node.Version }, config, function (data) { - $('#loadServicesSpinner').hide(); Notifications.success('Node successfully updated', 'Node updated'); $state.go('node', {id: node.Id}, {reload: true}); }, function (e) { - $('#loadServicesSpinner').hide(); Notifications.error('Failure', e, 'Failed to update node'); }); }; diff --git a/app/components/registries/registries.html b/app/components/registries/registries.html index fac2ee8d5..4eba3201e 100644 --- a/app/components/registries/registries.html +++ b/app/components/registries/registries.html @@ -3,7 +3,6 @@ - Registry management @@ -57,8 +56,10 @@
- - +
diff --git a/app/components/registries/registriesController.js b/app/components/registries/registriesController.js index dd98be5b3..fb3205198 100644 --- a/app/components/registries/registriesController.js +++ b/app/components/registries/registriesController.js @@ -4,14 +4,15 @@ function ($q, $scope, $state, RegistryService, DockerHubService, ModalService, N $scope.state = { selectedItemCount: 0, - pagination_count: Pagination.getPaginationCount('registries') + pagination_count: Pagination.getPaginationCount('registries'), + deploymentInProgress: false }; $scope.sortType = 'Name'; $scope.sortReverse = true; $scope.updateDockerHub = function() { - $('#updateDockerhubSpinner').show(); var dockerhub = $scope.dockerhub; + $scope.state.deploymentInProgress = true; DockerHubService.update(dockerhub) .then(function success(data) { Notifications.success('DockerHub registry updated'); @@ -20,7 +21,7 @@ function ($q, $scope, $state, RegistryService, DockerHubService, ModalService, N Notifications.error('Failure', err, 'Unable to update DockerHub details'); }) .finally(function final() { - $('#updateDockerhubSpinner').hide(); + $scope.state.deploymentInProgress = false; }); }; @@ -61,19 +62,9 @@ function ($q, $scope, $state, RegistryService, DockerHubService, ModalService, N }; function removeRegistries() { - $('#loadingViewSpinner').show(); - var counter = 0; - var complete = function () { - counter = counter - 1; - if (counter === 0) { - $('#loadingViewSpinner').hide(); - } - }; - var registries = $scope.registries; angular.forEach(registries, function (registry) { if (registry.Checked) { - counter = counter + 1; RegistryService.deleteRegistry(registry.Id) .then(function success(data) { var index = registries.indexOf(registry); @@ -82,16 +73,12 @@ function ($q, $scope, $state, RegistryService, DockerHubService, ModalService, N }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to remove registry'); - }) - .finally(function final() { - complete(); }); } }); } function initView() { - $('#loadingViewSpinner').show(); $q.all({ registries: RegistryService.registries(), dockerhub: DockerHubService.dockerhub() @@ -103,9 +90,6 @@ function ($q, $scope, $state, RegistryService, DockerHubService, ModalService, N .catch(function error(err) { $scope.registries = []; Notifications.error('Failure', err, 'Unable to retrieve registries'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } diff --git a/app/components/registry/registry.html b/app/components/registry/registry.html index 971d99848..829344dab 100644 --- a/app/components/registry/registry.html +++ b/app/components/registry/registry.html @@ -1,7 +1,5 @@ - - - + Registries > {{ registry.Name }} @@ -66,9 +64,11 @@
- + Cancel -
diff --git a/app/components/registry/registryController.js b/app/components/registry/registryController.js index 9c5adb82c..efc107ef6 100644 --- a/app/components/registry/registryController.js +++ b/app/components/registry/registryController.js @@ -2,9 +2,13 @@ angular.module('registry', []) .controller('RegistryController', ['$scope', '$state', '$transition$', '$filter', 'RegistryService', 'Notifications', function ($scope, $state, $transition$, $filter, RegistryService, Notifications) { + $scope.state = { + deploymentInProgress: false + }; + $scope.updateRegistry = function() { - $('#updateRegistrySpinner').show(); var registry = $scope.registry; + $scope.state.deploymentInProgress = true; RegistryService.updateRegistry(registry) .then(function success(data) { Notifications.success('Registry successfully updated'); @@ -14,12 +18,11 @@ function ($scope, $state, $transition$, $filter, RegistryService, Notifications) Notifications.error('Failure', err, 'Unable to update registry'); }) .finally(function final() { - $('#updateRegistrySpinner').hide(); + $scope.state.deploymentInProgress = false; }); }; function initView() { - $('#loadingViewSpinner').show(); var registryID = $transition$.params().id; RegistryService.registry(registryID) .then(function success(data) { @@ -27,9 +30,6 @@ function ($scope, $state, $transition$, $filter, RegistryService, Notifications) }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to retrieve registry details'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } diff --git a/app/components/registryAccess/registryAccess.html b/app/components/registryAccess/registryAccess.html index 44ff3d130..7fc8ac972 100644 --- a/app/components/registryAccess/registryAccess.html +++ b/app/components/registryAccess/registryAccess.html @@ -1,7 +1,5 @@ - - - + Registries > {{ registry.Name }} > Access management diff --git a/app/components/registryAccess/registryAccessController.js b/app/components/registryAccess/registryAccessController.js index 89ce007ea..25bd9f483 100644 --- a/app/components/registryAccess/registryAccessController.js +++ b/app/components/registryAccess/registryAccessController.js @@ -7,16 +7,12 @@ function ($scope, $transition$, RegistryService, Notifications) { }; function initView() { - $('#loadingViewSpinner').show(); RegistryService.registry($transition$.params().id) .then(function success(data) { $scope.registry = data; }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to retrieve registry details'); - }) - .finally(function final(){ - $('#loadingViewSpinner').hide(); }); } diff --git a/app/components/secret/secret.html b/app/components/secret/secret.html index e90fd7420..59092df01 100644 --- a/app/components/secret/secret.html +++ b/app/components/secret/secret.html @@ -3,7 +3,6 @@ - Secrets > {{ secret.Name }} diff --git a/app/components/secret/secretController.js b/app/components/secret/secretController.js index 93944f8c4..f6ff1fa17 100644 --- a/app/components/secret/secretController.js +++ b/app/components/secret/secretController.js @@ -3,7 +3,6 @@ angular.module('secret', []) function ($scope, $transition$, $state, SecretService, Notifications) { $scope.removeSecret = function removeSecret(secretId) { - $('#loadingViewSpinner').show(); SecretService.remove(secretId) .then(function success(data) { Notifications.success('Secret successfully removed'); @@ -11,23 +10,16 @@ function ($scope, $transition$, $state, SecretService, Notifications) { }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to remove secret'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); }; function initView() { - $('#loadingViewSpinner').show(); SecretService.secret($transition$.params().id) .then(function success(data) { $scope.secret = data; }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to retrieve secret details'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } diff --git a/app/components/secrets/secrets.html b/app/components/secrets/secrets.html index efd4107b3..3586364af 100644 --- a/app/components/secrets/secrets.html +++ b/app/components/secrets/secrets.html @@ -3,7 +3,6 @@ - Secrets diff --git a/app/components/secrets/secretsController.js b/app/components/secrets/secretsController.js index fc71dd58b..7c176c741 100644 --- a/app/components/secrets/secretsController.js +++ b/app/components/secrets/secretsController.js @@ -30,17 +30,8 @@ function ($scope, $state, SecretService, Notifications, Pagination) { }; $scope.removeAction = function () { - $('#loadingViewSpinner').show(); - var counter = 0; - var complete = function () { - counter = counter - 1; - if (counter === 0) { - $('#loadingViewSpinner').hide(); - } - }; angular.forEach($scope.secrets, function (secret) { if (secret.Checked) { - counter = counter + 1; SecretService.remove(secret.Id) .then(function success() { Notifications.success('Secret deleted', secret.Id); @@ -49,16 +40,12 @@ function ($scope, $state, SecretService, Notifications, Pagination) { }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to remove secret'); - }) - .finally(function final() { - complete(); }); } }); }; function initView() { - $('#loadingViewSpinner').show(); SecretService.secrets() .then(function success(data) { $scope.secrets = data; @@ -66,9 +53,6 @@ function ($scope, $state, SecretService, Notifications, Pagination) { .catch(function error(err) { $scope.secrets = []; Notifications.error('Failure', err, 'Unable to retrieve secrets'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } diff --git a/app/components/service/service.html b/app/components/service/service.html index f54a46b69..9cf5c4c00 100644 --- a/app/components/service/service.html +++ b/app/components/service/service.html @@ -3,7 +3,6 @@ - Services > {{ service.Name }} diff --git a/app/components/service/serviceController.js b/app/components/service/serviceController.js index bf3f6d514..cca9cbb64 100644 --- a/app/components/service/serviceController.js +++ b/app/components/service/serviceController.js @@ -200,7 +200,6 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll, }; $scope.updateService = function updateService(service) { - $('#loadingViewSpinner').show(); var config = ServiceHelper.serviceToConfig(service.Model); config.Name = service.Name; config.Labels = LabelHelper.fromKeyValueToLabelHash(service.ServiceLabels); @@ -264,7 +263,6 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll, }; Service.update({ id: service.Id, version: service.Version }, config, function (data) { - $('#loadingViewSpinner').hide(); if (data.message && data.message.match(/^rpc error:/)) { Notifications.error(data.message, 'Error'); } else { @@ -273,7 +271,6 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll, $scope.cancelChanges({}); initView(); }, function (e) { - $('#loadingViewSpinner').hide(); Notifications.error('Failure', e, 'Unable to update service'); }); }; @@ -289,7 +286,6 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll, }; function removeService() { - $('#loadingViewSpinner').show(); ServiceService.remove($scope.service) .then(function success(data) { Notifications.success('Service successfully deleted'); @@ -297,9 +293,6 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll, }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to remove service'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } @@ -322,7 +315,6 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll, } function initView() { - $('#loadingViewSpinner').show(); var apiVersion = $scope.applicationState.endpoint.apiVersion; ServiceService.service($transition$.params().id) .then(function success(data) { @@ -371,9 +363,6 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll, $scope.secrets = []; $scope.configs = []; Notifications.error('Failure', err, 'Unable to retrieve service details'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } diff --git a/app/components/serviceLogs/serviceLogsController.js b/app/components/serviceLogs/serviceLogsController.js index 0c25122ac..9faa370ab 100644 --- a/app/components/serviceLogs/serviceLogsController.js +++ b/app/components/serviceLogs/serviceLogsController.js @@ -9,10 +9,8 @@ function ($scope, $transition$, $anchorScroll, ServiceLogs, Service) { $scope.tailLines = 2000; function getLogs() { - $('#loadingViewSpinner').show(); getLogsStdout(); getLogsStderr(); - $('#loadingViewSpinner').hide(); } function getLogsStderr() { @@ -48,13 +46,10 @@ function ($scope, $transition$, $anchorScroll, ServiceLogs, Service) { } function getService() { - $('#loadingViewSpinner').show(); Service.get({id: $transition$.params().id}, function (d) { $scope.service = d; - $('#loadingViewSpinner').hide(); }, function (e) { Notifications.error('Failure', e, 'Unable to retrieve service info'); - $('#loadingViewSpinner').hide(); }); } diff --git a/app/components/serviceLogs/servicelogs.html b/app/components/serviceLogs/servicelogs.html index 3bbe090e2..86970d1a1 100644 --- a/app/components/serviceLogs/servicelogs.html +++ b/app/components/serviceLogs/servicelogs.html @@ -1,7 +1,5 @@ - - - + Services > {{ service.Spec.Name }} > Logs diff --git a/app/components/services/services.html b/app/components/services/services.html index 2ff52b79a..5d6357878 100644 --- a/app/components/services/services.html +++ b/app/components/services/services.html @@ -3,7 +3,6 @@ - Services diff --git a/app/components/services/servicesController.js b/app/components/services/servicesController.js index ca5fbbe6b..f3c6a82ca 100644 --- a/app/components/services/servicesController.js +++ b/app/components/services/servicesController.js @@ -25,15 +25,12 @@ function ($q, $scope, $transition$, $state, Service, ServiceService, ServiceHelp }; $scope.scaleService = function scaleService(service) { - $('#loadServicesSpinner').show(); var config = ServiceHelper.serviceToConfig(service.Model); config.Mode.Replicated.Replicas = service.Replicas; Service.update({ id: service.Id, version: service.Version }, config, function (data) { - $('#loadServicesSpinner').hide(); Notifications.success('Service successfully scaled', 'New replica count: ' + service.Replicas); $state.reload(); }, function (e) { - $('#loadServicesSpinner').hide(); service.Scale = false; service.Replicas = service.ReplicaCount; Notifications.error('Failure', e, 'Unable to scale service'); @@ -51,17 +48,8 @@ function ($q, $scope, $transition$, $state, Service, ServiceService, ServiceHelp }; function removeServices() { - $('#loadServicesSpinner').show(); - var counter = 0; - var complete = function () { - counter = counter - 1; - if (counter === 0) { - $('#loadServicesSpinner').hide(); - } - }; angular.forEach($scope.services, function (service) { if (service.Checked) { - counter = counter + 1; ServiceService.remove(service) .then(function success(data) { Notifications.success('Service successfully deleted'); @@ -70,9 +58,6 @@ function ($q, $scope, $transition$, $state, Service, ServiceService, ServiceHelp }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to remove service'); - }) - .finally(function final() { - complete(); }); } }); @@ -94,7 +79,6 @@ function ($q, $scope, $transition$, $state, Service, ServiceService, ServiceHelp } function initView() { - $('#loadServicesSpinner').show(); $q.all({ services: Service.query({}).$promise, tasks: Task.query({filters: {'desired-state': ['running','accepted']}}).$promise, @@ -118,9 +102,6 @@ function ($q, $scope, $transition$, $state, Service, ServiceService, ServiceHelp .catch(function error(err) { $scope.services = []; Notifications.error('Failure', err, 'Unable to retrieve services'); - }) - .finally(function final() { - $('#loadServicesSpinner').hide(); }); } diff --git a/app/components/settings/settings.html b/app/components/settings/settings.html index 7c5b5f0a0..2e0449022 100644 --- a/app/components/settings/settings.html +++ b/app/components/settings/settings.html @@ -1,7 +1,5 @@ - - - + Settings @@ -112,9 +110,10 @@
- - - +
diff --git a/app/components/settings/settingsController.js b/app/components/settings/settingsController.js index 3c122a053..abe9fef57 100644 --- a/app/components/settings/settingsController.js +++ b/app/components/settings/settingsController.js @@ -2,6 +2,10 @@ angular.module('settings', []) .controller('SettingsController', ['$scope', '$state', 'Notifications', 'SettingsService', 'StateManager', 'DEFAULT_TEMPLATES_URL', function ($scope, $state, Notifications, SettingsService, StateManager, DEFAULT_TEMPLATES_URL) { + $scope.state = { + deploymentInProgress: false + }; + $scope.formValues = { customLogo: false, customTemplates: false, @@ -45,6 +49,7 @@ function ($scope, $state, Notifications, SettingsService, StateManager, DEFAULT_ settings.AllowBindMountsForRegularUsers = !$scope.formValues.restrictBindMounts; settings.AllowPrivilegedModeForRegularUsers = !$scope.formValues.restrictPrivilegedMode; + $scope.state.deploymentInProgress = true; updateSettings(settings, false); }; @@ -54,8 +59,6 @@ function ($scope, $state, Notifications, SettingsService, StateManager, DEFAULT_ } function updateSettings(settings, resetForm) { - $('#loadingViewSpinner').show(); - SettingsService.update(settings) .then(function success(data) { Notifications.success('Settings updated'); @@ -69,12 +72,11 @@ function ($scope, $state, Notifications, SettingsService, StateManager, DEFAULT_ Notifications.error('Failure', err, 'Unable to update settings'); }) .finally(function final() { - $('#loadingViewSpinner').hide(); + $scope.state.deploymentInProgress = false; }); } function initView() { - $('#loadingViewSpinner').show(); SettingsService.settings() .then(function success(data) { var settings = data; @@ -91,9 +93,6 @@ function ($scope, $state, Notifications, SettingsService, StateManager, DEFAULT_ }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to retrieve application settings'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } diff --git a/app/components/settingsAuthentication/settingsAuthentication.html b/app/components/settingsAuthentication/settingsAuthentication.html index 38506d751..07e3ec491 100644 --- a/app/components/settingsAuthentication/settingsAuthentication.html +++ b/app/components/settingsAuthentication/settingsAuthentication.html @@ -1,7 +1,5 @@ - - - + Settings > Authentication @@ -100,8 +98,10 @@
- - +
@@ -240,9 +240,10 @@
- - - +
diff --git a/app/components/settingsAuthentication/settingsAuthenticationController.js b/app/components/settingsAuthentication/settingsAuthenticationController.js index faf16873b..a52ed8049 100644 --- a/app/components/settingsAuthentication/settingsAuthenticationController.js +++ b/app/components/settingsAuthentication/settingsAuthenticationController.js @@ -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(); }); } diff --git a/app/components/stack/stack.html b/app/components/stack/stack.html index c98c6bdd1..f09031292 100644 --- a/app/components/stack/stack.html +++ b/app/components/stack/stack.html @@ -3,7 +3,6 @@ - Stacks > {{ stack.Name }} @@ -73,8 +72,10 @@
- - +
diff --git a/app/components/stack/stackController.js b/app/components/stack/stackController.js index b8147f899..198a00cc0 100644 --- a/app/components/stack/stackController.js +++ b/app/components/stack/stackController.js @@ -2,14 +2,17 @@ angular.module('stack', []) .controller('StackController', ['$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.deployStack = function () { - $('#createResourceSpinner').show(); + $scope.state = { + deploymentInProgress: false + }; + $scope.deployStack = function () { // The codemirror editor does not work with ng-model so we need to retrieve // the value directly from the editor. var stackFile = $scope.editor.getValue(); var env = FormHelper.removeInvalidEnvVars($scope.stack.Env); + $scope.state.deploymentInProgress = true; StackService.updateStack($scope.stack.Id, stackFile, env) .then(function success(data) { Notifications.success('Stack successfully deployed'); @@ -19,7 +22,7 @@ function ($q, $scope, $state, $stateParams, $document, StackService, NodeService Notifications.error('Failure', err, 'Unable to create stack'); }) .finally(function final() { - $('#createResourceSpinner').hide(); + $scope.state.deploymentInProgress = false; }); }; @@ -32,7 +35,6 @@ function ($q, $scope, $state, $stateParams, $document, StackService, NodeService }; function initView() { - $('#loadingViewSpinner').show(); var stackId = $stateParams.id; StackService.stack(stackId) @@ -77,9 +79,6 @@ function ($q, $scope, $state, $stateParams, $document, StackService, NodeService }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to retrieve tasks details'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } diff --git a/app/components/stacks/stacks.html b/app/components/stacks/stacks.html index 8d585eea8..4e9a8c1c6 100644 --- a/app/components/stacks/stacks.html +++ b/app/components/stacks/stacks.html @@ -3,7 +3,6 @@ - Stacks diff --git a/app/components/stacks/stacksController.js b/app/components/stacks/stacksController.js index 352891acd..9217a4ea1 100644 --- a/app/components/stacks/stacksController.js +++ b/app/components/stacks/stacksController.js @@ -46,19 +46,8 @@ function ($scope, Notifications, Pagination, StackService, ModalService) { }; function deleteSelectedStacks() { - $('#loadingViewSpinner').show(); - var counter = 0; - - var complete = function () { - counter = counter - 1; - if (counter === 0) { - $('#loadingViewSpinner').hide(); - } - }; - angular.forEach($scope.stacks, function (stack) { if (stack.Checked) { - counter = counter + 1; StackService.remove(stack) .then(function success() { Notifications.success('Stack deleted', stack.Name); @@ -67,17 +56,12 @@ function ($scope, Notifications, Pagination, StackService, ModalService) { }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to remove stack ' + stack.Name); - }) - .finally(function final() { - complete(); }); } }); } function initView() { - $('#loadingViewSpinner').show(); - StackService.stacks(true) .then(function success(data) { var stacks = data; @@ -93,9 +77,6 @@ function ($scope, Notifications, Pagination, StackService, ModalService) { .catch(function error(err) { $scope.stacks = []; Notifications.error('Failure', err, 'Unable to retrieve stacks'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } diff --git a/app/components/swarm/swarm.html b/app/components/swarm/swarm.html index d9b8372c7..30c2fe519 100644 --- a/app/components/swarm/swarm.html +++ b/app/components/swarm/swarm.html @@ -3,7 +3,6 @@ - Swarm diff --git a/app/components/swarm/swarmController.js b/app/components/swarm/swarmController.js index 131345df1..e117cd06a 100644 --- a/app/components/swarm/swarmController.js +++ b/app/components/swarm/swarmController.js @@ -72,8 +72,6 @@ function ($q, $scope, SystemService, NodeService, Pagination, Notifications, Sta } function initView() { - $('#loadingViewSpinner').show(); - if (StateManager.getState().application.authentication) { var userDetails = Authentication.getUserDetails(); var isAdmin = userDetails.role === 1 ? true: false; @@ -99,9 +97,6 @@ function ($q, $scope, SystemService, NodeService, Pagination, Notifications, Sta }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to retrieve cluster details'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } diff --git a/app/components/swarmVisualizer/swarmVisualizer.html b/app/components/swarmVisualizer/swarmVisualizer.html index 2d71cb53b..95148417e 100644 --- a/app/components/swarmVisualizer/swarmVisualizer.html +++ b/app/components/swarmVisualizer/swarmVisualizer.html @@ -3,7 +3,6 @@ - Swarm > Cluster visualizer diff --git a/app/components/swarmVisualizer/swarmVisualizerController.js b/app/components/swarmVisualizer/swarmVisualizerController.js index c4aabeb4c..c46ec3d87 100644 --- a/app/components/swarmVisualizer/swarmVisualizerController.js +++ b/app/components/swarmVisualizer/swarmVisualizerController.js @@ -47,7 +47,6 @@ function ($q, $scope, $document, NodeService, ServiceService, TaskService, Notif } function initView() { - $('#loadingViewSpinner').show(); $q.all({ nodes: NodeService.nodes(), services: ServiceService.services(), @@ -64,9 +63,6 @@ function ($q, $scope, $document, NodeService, ServiceService, TaskService, Notif }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to initialize cluster visualizer'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } diff --git a/app/components/task/task.html b/app/components/task/task.html index 6bc5d5510..200e0f1c3 100644 --- a/app/components/task/task.html +++ b/app/components/task/task.html @@ -1,7 +1,5 @@ - - - + Services > {{ service.Name }} > {{ task.Id }} diff --git a/app/components/task/taskController.js b/app/components/task/taskController.js index 39c41feb7..9b4400e31 100644 --- a/app/components/task/taskController.js +++ b/app/components/task/taskController.js @@ -3,7 +3,6 @@ angular.module('task', []) function ($scope, $transition$, TaskService, Service, Notifications) { function initView() { - $('#loadingViewSpinner').show(); TaskService.task($transition$.params().id) .then(function success(data) { var task = data; @@ -16,9 +15,6 @@ function ($scope, $transition$, TaskService, Service, Notifications) { }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to retrieve task details'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } diff --git a/app/components/team/team.html b/app/components/team/team.html index d292f6fd8..17a1a2798 100644 --- a/app/components/team/team.html +++ b/app/components/team/team.html @@ -1,7 +1,5 @@ - - - + Teams > {{ team.Name }} diff --git a/app/components/team/teamController.js b/app/components/team/teamController.js index ae57c2813..d174fa5cb 100644 --- a/app/components/team/teamController.js +++ b/app/components/team/teamController.js @@ -44,7 +44,6 @@ function ($q, $scope, $state, $transition$, TeamService, UserService, TeamMember }; $scope.promoteToLeader = function(user) { - $('#loadingViewSpinner').show(); TeamMembershipService.updateMembership(user.MembershipId, user.Id, $scope.team.Id, 1) .then(function success(data) { $scope.leaderCount++; @@ -53,14 +52,10 @@ function ($q, $scope, $state, $transition$, TeamService, UserService, TeamMember }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to update user role'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); }; $scope.demoteToMember = function(user) { - $('#loadingViewSpinner').show(); TeamMembershipService.updateMembership(user.MembershipId, user.Id, $scope.team.Id, 2) .then(function success(data) { user.TeamRole = 'Member'; @@ -69,14 +64,10 @@ function ($q, $scope, $state, $transition$, TeamService, UserService, TeamMember }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to update user role'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); }; $scope.addAllUsers = function() { - $('#loadingViewSpinner').show(); var teamMembershipQueries = []; angular.forEach($scope.users, function (user) { teamMembershipQueries.push(TeamMembershipService.createMembership(user.Id, $scope.team.Id, 2)); @@ -95,14 +86,10 @@ function ($q, $scope, $state, $transition$, TeamService, UserService, TeamMember }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to update team members'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); }; $scope.addUser = function(user) { - $('#loadingViewSpinner').show(); TeamMembershipService.createMembership(user.Id, $scope.team.Id, 2) .then(function success(data) { removeUserFromArray(user.Id, $scope.users); @@ -113,14 +100,10 @@ function ($q, $scope, $state, $transition$, TeamService, UserService, TeamMember }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to update team members'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); }; $scope.removeAllUsers = function() { - $('#loadingViewSpinner').show(); var teamMembershipQueries = []; angular.forEach($scope.teamMembers, function (user) { teamMembershipQueries.push(TeamMembershipService.deleteMembership(user.MembershipId)); @@ -133,14 +116,10 @@ function ($q, $scope, $state, $transition$, TeamService, UserService, TeamMember }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to update team members'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); }; $scope.removeUser = function(user) { - $('#loadingViewSpinner').show(); TeamMembershipService.deleteMembership(user.MembershipId) .then(function success() { removeUserFromArray(user.Id, $scope.teamMembers); @@ -149,14 +128,10 @@ function ($q, $scope, $state, $transition$, TeamService, UserService, TeamMember }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to update team members'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); }; function deleteTeam() { - $('#loadingViewSpinner').show(); TeamService.deleteTeam($scope.team.Id) .then(function success(data) { Notifications.success('Team successfully deleted', $scope.team.Name); @@ -164,9 +139,6 @@ function ($q, $scope, $state, $transition$, TeamService, UserService, TeamMember }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to remove team'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } @@ -205,7 +177,6 @@ function ($q, $scope, $state, $transition$, TeamService, UserService, TeamMember } function initView() { - $('#loadingViewSpinner').show(); $scope.isAdmin = Authentication.getUserDetails().role === 1 ? true: false; $q.all({ team: TeamService.team($transition$.params().id), @@ -219,9 +190,6 @@ function ($q, $scope, $state, $transition$, TeamService, UserService, TeamMember }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to retrieve team details'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } diff --git a/app/components/teams/teams.html b/app/components/teams/teams.html index 6e42cb2c7..c6c7b9657 100644 --- a/app/components/teams/teams.html +++ b/app/components/teams/teams.html @@ -3,7 +3,6 @@ - Teams management @@ -50,8 +49,10 @@
- - + {{ state.teamCreationError }} diff --git a/app/components/teams/teamsController.js b/app/components/teams/teamsController.js index 413091460..267a4f0a0 100644 --- a/app/components/teams/teamsController.js +++ b/app/components/teams/teamsController.js @@ -5,7 +5,8 @@ function ($q, $scope, $state, TeamService, UserService, TeamMembershipService, M userGroupGroupCreationError: '', selectedItemCount: 0, validName: false, - pagination_count: Pagination.getPaginationCount('teams') + pagination_count: Pagination.getPaginationCount('teams'), + deploymentInProgress: false }; $scope.sortType = 'Name'; $scope.sortReverse = false; @@ -54,7 +55,7 @@ function ($q, $scope, $state, TeamService, UserService, TeamMembershipService, M }; $scope.addTeam = function() { - $('#createTeamSpinner').show(); + $scope.state.deploymentInProgress = true; $scope.state.teamCreationError = ''; var teamName = $scope.formValues.Name; var leaderIds = []; @@ -71,22 +72,13 @@ function ($q, $scope, $state, TeamService, UserService, TeamMembershipService, M Notifications.error('Failure', err, 'Unable to create team'); }) .finally(function final() { - $('#createTeamSpinner').hide(); + $scope.state.deploymentInProgress = false; }); }; function deleteSelectedTeams() { - $('#loadingViewSpinner').show(); - var counter = 0; - var complete = function () { - counter = counter - 1; - if (counter === 0) { - $('#loadingViewSpinner').hide(); - } - }; angular.forEach($scope.teams, function (team) { if (team.Checked) { - counter = counter + 1; TeamService.deleteTeam(team.Id) .then(function success(data) { var index = $scope.teams.indexOf(team); @@ -95,9 +87,6 @@ function ($q, $scope, $state, TeamService, UserService, TeamMembershipService, M }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to remove team'); - }) - .finally(function final() { - complete(); }); } }); @@ -114,7 +103,6 @@ function ($q, $scope, $state, TeamService, UserService, TeamMembershipService, M }; function initView() { - $('#loadingViewSpinner').show(); var userDetails = Authentication.getUserDetails(); var isAdmin = userDetails.role === 1 ? true: false; $scope.isAdmin = isAdmin; @@ -130,9 +118,6 @@ function ($q, $scope, $state, TeamService, UserService, TeamMembershipService, M $scope.teams = []; $scope.users = []; Notifications.error('Failure', err, 'Unable to retrieve teams'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } diff --git a/app/components/templates/templates.html b/app/components/templates/templates.html index 94ffe752c..274173635 100644 --- a/app/components/templates/templates.html +++ b/app/components/templates/templates.html @@ -3,7 +3,6 @@ - Templates @@ -60,10 +59,15 @@ +
+ Actions +
- - + {{ state.formValidationError }}
@@ -287,10 +291,15 @@
+
+ Actions +
- - + When using Swarm, we recommend deploying containers in a shared network. Looks like you don't have any shared network, head over the networks view to create one. diff --git a/app/components/templates/templatesController.js b/app/components/templates/templatesController.js index 8ca34a100..d8e9f2234 100644 --- a/app/components/templates/templatesController.js +++ b/app/components/templates/templatesController.js @@ -7,6 +7,7 @@ function ($scope, $q, $state, $transition$, $anchorScroll, $filter, ContainerSer hideDescriptions: $transition$.params().hide_descriptions, formValidationError: '', showDeploymentSelector: false, + deploymentInProgress: false, filters: { Categories: '!', Platform: '!', @@ -85,7 +86,7 @@ function ($scope, $q, $state, $transition$, $anchorScroll, $filter, ContainerSer Notifications.error('Failure', err, err.msg); }) .finally(function final() { - $('#createResourceSpinner').hide(); + $scope.state.deploymentInProgress = false; }); } @@ -113,26 +114,24 @@ function ($scope, $q, $state, $transition$, $anchorScroll, $filter, ContainerSer $state.go('stacks', {}, {reload: true}); }) .finally(function final() { - $('#createResourceSpinner').hide(); + $scope.state.deploymentInProgress = false; }); } $scope.createTemplate = function() { - $('#createResourceSpinner').show(); - var userDetails = Authentication.getUserDetails(); var userId = userDetails.ID; var accessControlData = $scope.formValues.AccessControlData; var isAdmin = userDetails.role === 1 ? true : false; if (!validateForm(accessControlData, isAdmin)) { - $('#createResourceSpinner').hide(); return; } var template = $scope.state.selectedTemplate; var templatesKey = $scope.templatesKey; + $scope.state.deploymentInProgress = true; if (template.Type === 'stack') { createStackFromTemplate(template, userId, accessControlData); } else { @@ -234,9 +233,6 @@ function ($scope, $q, $state, $transition$, $anchorScroll, $filter, ContainerSer .catch(function error(err) { $scope.templates = []; Notifications.error('Failure', err, 'An error occured during apps initialization.'); - }) - .finally(function final(){ - $('#loadingViewSpinner').hide(); }); } diff --git a/app/components/user/user.html b/app/components/user/user.html index b1a6d3478..95bb95561 100644 --- a/app/components/user/user.html +++ b/app/components/user/user.html @@ -1,7 +1,5 @@ - - - + Users > {{ user.Username }} diff --git a/app/components/user/userController.js b/app/components/user/userController.js index fcb6c76b3..9a2d7385a 100644 --- a/app/components/user/userController.js +++ b/app/components/user/userController.js @@ -23,7 +23,6 @@ function ($q, $scope, $state, $transition$, UserService, ModalService, Notificat }; $scope.updatePermissions = function() { - $('#loadingViewSpinner').show(); var role = $scope.formValues.Administrator ? 1 : 2; UserService.updateUser($scope.user.Id, undefined, role) .then(function success(data) { @@ -33,14 +32,10 @@ function ($q, $scope, $state, $transition$, UserService, ModalService, Notificat }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to update user permissions'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); }; $scope.updatePassword = function() { - $('#loadingViewSpinner').show(); UserService.updateUser($scope.user.Id, $scope.formValues.newPassword, undefined) .then(function success(data) { Notifications.success('Password successfully updated'); @@ -48,14 +43,10 @@ function ($q, $scope, $state, $transition$, UserService, ModalService, Notificat }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to update user password'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); }; function deleteUser() { - $('#loadingViewSpinner').show(); UserService.deleteUser($scope.user.Id) .then(function success(data) { Notifications.success('User successfully deleted', $scope.user.Username); @@ -63,14 +54,10 @@ function ($q, $scope, $state, $transition$, UserService, ModalService, Notificat }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to remove user'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } function initView() { - $('#loadingViewSpinner').show(); $q.all({ user: UserService.user($transition$.params().id), settings: SettingsService.publicSettings() @@ -83,9 +70,6 @@ function ($q, $scope, $state, $transition$, UserService, ModalService, Notificat }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to retrieve user information'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } diff --git a/app/components/userSettings/userSettings.html b/app/components/userSettings/userSettings.html index e9dc4b386..745caa91b 100644 --- a/app/components/userSettings/userSettings.html +++ b/app/components/userSettings/userSettings.html @@ -1,7 +1,5 @@ - - - + User settings diff --git a/app/components/userSettings/userSettingsController.js b/app/components/userSettings/userSettingsController.js index f746bce81..50501eb4c 100644 --- a/app/components/userSettings/userSettingsController.js +++ b/app/components/userSettings/userSettingsController.js @@ -34,9 +34,6 @@ function ($scope, $state, $sanitize, Authentication, UserService, Notifications, }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to retrieve application settings'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } diff --git a/app/components/users/users.html b/app/components/users/users.html index 79c9999d3..8cb96e493 100644 --- a/app/components/users/users.html +++ b/app/components/users/users.html @@ -3,7 +3,6 @@ - User management @@ -98,8 +97,10 @@
- - + {{ state.userCreationError }} diff --git a/app/components/users/usersController.js b/app/components/users/usersController.js index 0184e84f0..d4b11151f 100644 --- a/app/components/users/usersController.js +++ b/app/components/users/usersController.js @@ -5,7 +5,8 @@ function ($q, $scope, $state, $sanitize, UserService, TeamService, TeamMembershi userCreationError: '', selectedItemCount: 0, validUsername: false, - pagination_count: Pagination.getPaginationCount('users') + pagination_count: Pagination.getPaginationCount('users'), + deploymentInProgress: false }; $scope.sortType = 'RoleName'; $scope.sortReverse = false; @@ -57,7 +58,7 @@ function ($q, $scope, $state, $sanitize, UserService, TeamService, TeamMembershi }; $scope.addUser = function() { - $('#createUserSpinner').show(); + $scope.state.deploymentInProgress = true; $scope.state.userCreationError = ''; var username = $sanitize($scope.formValues.Username); var password = $sanitize($scope.formValues.Password); @@ -75,22 +76,13 @@ function ($q, $scope, $state, $sanitize, UserService, TeamService, TeamMembershi Notifications.error('Failure', err, 'Unable to create user'); }) .finally(function final() { - $('#createUserSpinner').hide(); + $scope.state.deploymentInProgress = false; }); }; function deleteSelectedUsers() { - $('#loadUsersSpinner').show(); - var counter = 0; - var complete = function () { - counter = counter - 1; - if (counter === 0) { - $('#loadUsersSpinner').hide(); - } - }; angular.forEach($scope.users, function (user) { if (user.Checked) { - counter = counter + 1; UserService.deleteUser(user.Id) .then(function success(data) { var index = $scope.users.indexOf(user); @@ -99,9 +91,6 @@ function ($q, $scope, $state, $sanitize, UserService, TeamService, TeamMembershi }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to remove user'); - }) - .finally(function final() { - complete(); }); } }); @@ -133,7 +122,6 @@ function ($q, $scope, $state, $sanitize, UserService, TeamService, TeamMembershi } function initView() { - $('#loadUsersSpinner').show(); var userDetails = Authentication.getUserDetails(); var isAdmin = userDetails.role === 1 ? true: false; $scope.isAdmin = isAdmin; @@ -154,9 +142,6 @@ function ($q, $scope, $state, $sanitize, UserService, TeamService, TeamMembershi Notifications.error('Failure', err, 'Unable to retrieve users and teams'); $scope.users = []; $scope.teams = []; - }) - .finally(function final() { - $('#loadUsersSpinner').hide(); }); } diff --git a/app/components/volume/volume.html b/app/components/volume/volume.html index 2b9d40af4..a16803988 100644 --- a/app/components/volume/volume.html +++ b/app/components/volume/volume.html @@ -1,7 +1,5 @@ - - - + Volumes > {{ volume.Id }} diff --git a/app/components/volume/volumeController.js b/app/components/volume/volumeController.js index 12b7053a5..2d1bb7b82 100644 --- a/app/components/volume/volumeController.js +++ b/app/components/volume/volumeController.js @@ -3,7 +3,6 @@ angular.module('volume', []) function ($scope, $state, $transition$, VolumeService, ContainerService, Notifications) { $scope.removeVolume = function removeVolume() { - $('#loadingViewSpinner').show(); VolumeService.remove($scope.volume) .then(function success(data) { Notifications.success('Volume successfully removed', $transition$.params().id); @@ -11,9 +10,6 @@ function ($scope, $state, $transition$, VolumeService, ContainerService, Notific }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to remove volume'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); }; @@ -24,7 +20,6 @@ function ($scope, $state, $transition$, VolumeService, ContainerService, Notific } function initView() { - $('#loadingViewSpinner').show(); VolumeService.volume($transition$.params().id) .then(function success(data) { var volume = data; @@ -41,9 +36,6 @@ function ($scope, $state, $transition$, VolumeService, ContainerService, Notific }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to retrieve volume details'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } diff --git a/app/components/volumes/volumes.html b/app/components/volumes/volumes.html index fb9dd94b0..eaa98378f 100644 --- a/app/components/volumes/volumes.html +++ b/app/components/volumes/volumes.html @@ -3,7 +3,6 @@ - Volumes diff --git a/app/components/volumes/volumesController.js b/app/components/volumes/volumesController.js index 2bc0453e8..836692b32 100644 --- a/app/components/volumes/volumesController.js +++ b/app/components/volumes/volumesController.js @@ -34,19 +34,8 @@ function ($q, $scope, VolumeService, Notifications, Pagination) { }; $scope.removeAction = function () { - $('#loadVolumesSpinner').show(); - var counter = 0; - - var complete = function () { - counter = counter - 1; - if (counter === 0) { - $('#loadVolumesSpinner').hide(); - } - }; - angular.forEach($scope.volumes, function (volume) { if (volume.Checked) { - counter = counter + 1; VolumeService.remove(volume) .then(function success() { Notifications.success('Volume deleted', volume.Id); @@ -55,25 +44,21 @@ function ($q, $scope, VolumeService, Notifications, Pagination) { }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to remove volume'); - }) - .finally(function final() { - complete(); }); } }); }; function initView() { - $('#loadVolumesSpinner').show(); - + $q.all({ attached: VolumeService.volumes({ - filters: { + filters: { 'dangling': ['false'] } }), dangling: VolumeService.volumes({ - filters: { + filters: { 'dangling': ['true'] } }) @@ -88,9 +73,6 @@ function ($q, $scope, VolumeService, Notifications, Pagination) { })); }).catch(function error(err) { Notifications.error('Failure', err, 'Unable to retrieve volumes'); - }) - .finally(function final() { - $('#loadVolumesSpinner').hide(); }); } initView(); diff --git a/app/config.js b/app/config.js index 197bd6e76..6e35e4642 100644 --- a/app/config.js +++ b/app/config.js @@ -1,5 +1,6 @@ angular.module('portainer') - .config(['$stateProvider', '$urlRouterProvider', '$httpProvider', 'localStorageServiceProvider', 'jwtOptionsProvider', 'AnalyticsProvider', '$uibTooltipProvider', '$compileProvider', function ($stateProvider, $urlRouterProvider, $httpProvider, localStorageServiceProvider, jwtOptionsProvider, AnalyticsProvider, $uibTooltipProvider, $compileProvider) { + .config(['$stateProvider', '$urlRouterProvider', '$httpProvider', 'localStorageServiceProvider', 'jwtOptionsProvider', 'AnalyticsProvider', '$uibTooltipProvider', '$compileProvider', 'cfpLoadingBarProvider', + function ($stateProvider, $urlRouterProvider, $httpProvider, localStorageServiceProvider, jwtOptionsProvider, AnalyticsProvider, $uibTooltipProvider, $compileProvider, cfpLoadingBarProvider) { 'use strict'; var environment = '@@ENVIRONMENT'; @@ -32,6 +33,9 @@ angular.module('portainer') 'outsideClick': 'outsideClick' }); + cfpLoadingBarProvider.includeSpinner = false; + cfpLoadingBarProvider.parentSelector = '#loadingbar-placeholder'; + $urlRouterProvider.otherwise('/auth'); configureRoutes($stateProvider); }]); diff --git a/app/directives/accessControlForm/porAccessControlFormController.js b/app/directives/accessControlForm/porAccessControlFormController.js index c567bf290..1daed21a0 100644 --- a/app/directives/accessControlForm/porAccessControlFormController.js +++ b/app/directives/accessControlForm/porAccessControlFormController.js @@ -31,8 +31,6 @@ function ($q, UserService, TeamService, Notifications, Authentication, ResourceC } function initComponent() { - $('#loadingViewSpinner').show(); - var userDetails = Authentication.getUserDetails(); var isAdmin = userDetails.role === 1 ? true: false; ctrl.isAdmin = isAdmin; @@ -66,9 +64,6 @@ function ($q, UserService, TeamService, Notifications, Authentication, ResourceC }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to retrieve access control information'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } diff --git a/app/directives/accessControlPanel/porAccessControlPanelController.js b/app/directives/accessControlPanel/porAccessControlPanelController.js index 36cec2a97..5672135e0 100644 --- a/app/directives/accessControlPanel/porAccessControlPanelController.js +++ b/app/directives/accessControlPanel/porAccessControlPanelController.js @@ -71,8 +71,6 @@ function ($q, $state, UserService, TeamService, ResourceControlService, Notifica } function updateOwnership() { - $('#loadingViewSpinner').show(); - var resourceId = ctrl.resourceId; var ownershipParameters = processOwnershipFormValues(); @@ -84,15 +82,10 @@ function ($q, $state, UserService, TeamService, ResourceControlService, Notifica }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to update access control'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } function initComponent() { - $('#loadingViewSpinner').show(); - var userDetails = Authentication.getUserDetails(); var isAdmin = userDetails.role === 1 ? true: false; var userId = userDetails.ID; @@ -146,9 +139,6 @@ function ($q, $state, UserService, TeamService, ResourceControlService, Notifica }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to retrieve access control information'); - }) - .finally(function final() { - $('#loadingViewSpinner').hide(); }); } diff --git a/app/directives/buttonSpinner.js b/app/directives/buttonSpinner.js new file mode 100644 index 000000000..7d6bd614c --- /dev/null +++ b/app/directives/buttonSpinner.js @@ -0,0 +1,14 @@ +angular +.module('portainer') +.directive('buttonSpinner', function buttonSpinner() { + var directive = { + restrict: 'A', + scope: { + spinning: '=buttonSpinner' + }, + transclude: true, + template: ' ' + }; + + return directive; +}); diff --git a/app/directives/header.js b/app/directives/header.js index 18451ce9b..a2facd4e6 100644 --- a/app/directives/header.js +++ b/app/directives/header.js @@ -6,7 +6,7 @@ angular 'ngModel': '=' }, transclude: true, - template: '
', + template: '
', restrict: 'EA' }; return directive; diff --git a/app/rest/api/auth.js b/app/rest/api/auth.js index 17d4dc22d..179225cd2 100644 --- a/app/rest/api/auth.js +++ b/app/rest/api/auth.js @@ -3,7 +3,7 @@ angular.module('portainer.rest') 'use strict'; return $resource(API_ENDPOINT_AUTH, {}, { login: { - method: 'POST' + method: 'POST', ignoreLoadingBar: true } }); }]); diff --git a/app/rest/api/endpoint.js b/app/rest/api/endpoint.js index bef6f960b..f4a0e76ce 100644 --- a/app/rest/api/endpoint.js +++ b/app/rest/api/endpoint.js @@ -2,7 +2,7 @@ angular.module('portainer.rest') .factory('Endpoints', ['$resource', 'API_ENDPOINT_ENDPOINTS', function EndpointsFactory($resource, API_ENDPOINT_ENDPOINTS) { 'use strict'; return $resource(API_ENDPOINT_ENDPOINTS + '/:id/:action', {}, { - create: { method: 'POST' }, + create: { method: 'POST', ignoreLoadingBar: true }, query: { method: 'GET', isArray: true }, get: { method: 'GET', params: { id: '@id' } }, update: { method: 'PUT', params: { id: '@id' } }, diff --git a/app/rest/api/registry.js b/app/rest/api/registry.js index 819e19061..cbeec9f7c 100644 --- a/app/rest/api/registry.js +++ b/app/rest/api/registry.js @@ -2,7 +2,7 @@ angular.module('portainer.rest') .factory('Registries', ['$resource', 'API_ENDPOINT_REGISTRIES', function RegistriesFactory($resource, API_ENDPOINT_REGISTRIES) { 'use strict'; return $resource(API_ENDPOINT_REGISTRIES + '/:id/:action', {}, { - create: { method: 'POST' }, + create: { method: 'POST', ignoreLoadingBar: true }, query: { method: 'GET', isArray: true }, get: { method: 'GET', params: { id: '@id' } }, update: { method: 'PUT', params: { id: '@id' } }, diff --git a/app/rest/api/resourceControl.js b/app/rest/api/resourceControl.js index 5503ce0db..22a5af6b4 100644 --- a/app/rest/api/resourceControl.js +++ b/app/rest/api/resourceControl.js @@ -2,7 +2,7 @@ angular.module('portainer.rest') .factory('ResourceControl', ['$resource', 'API_ENDPOINT_RESOURCE_CONTROLS', function ResourceControlFactory($resource, API_ENDPOINT_RESOURCE_CONTROLS) { 'use strict'; return $resource(API_ENDPOINT_RESOURCE_CONTROLS + '/:id', {}, { - create: { method: 'POST' }, + create: { method: 'POST', ignoreLoadingBar: true }, get: { method: 'GET', params: { id: '@id' } }, update: { method: 'PUT', params: { id: '@id' } }, remove: { method: 'DELETE', params: { id: '@id'} } diff --git a/app/rest/api/settings.js b/app/rest/api/settings.js index 9a70d8885..184504f54 100644 --- a/app/rest/api/settings.js +++ b/app/rest/api/settings.js @@ -3,8 +3,8 @@ angular.module('portainer.rest') 'use strict'; return $resource(API_ENDPOINT_SETTINGS + '/:subResource/:action', {}, { get: { method: 'GET' }, - update: { method: 'PUT' }, - publicSettings: { method: 'GET', params: { subResource: 'public' } }, + update: { method: 'PUT', ignoreLoadingBar: true }, + publicSettings: { method: 'GET', params: { subResource: 'public' }, ignoreLoadingBar: true }, checkLDAPConnectivity: { method: 'PUT', params: { subResource: 'authentication', action: 'checkLDAP' } } }); }]); diff --git a/app/rest/api/stack.js b/app/rest/api/stack.js index 6512c5128..9899b0043 100644 --- a/app/rest/api/stack.js +++ b/app/rest/api/stack.js @@ -7,8 +7,8 @@ angular.module('portainer.rest') { get: { method: 'GET', params: { id: '@id' } }, query: { method: 'GET', isArray: true }, - create: { method: 'POST' }, - update: { method: 'PUT', params: { id: '@id' } }, + create: { method: 'POST', ignoreLoadingBar: true }, + update: { method: 'PUT', params: { id: '@id' }, ignoreLoadingBar: true }, remove: { method: 'DELETE', params: { id: '@id'} }, getStackFile: { method: 'GET', params: { id : '@id', action: 'stackfile' } } }); diff --git a/app/rest/api/team.js b/app/rest/api/team.js index 0c98e8742..85537f70f 100644 --- a/app/rest/api/team.js +++ b/app/rest/api/team.js @@ -2,7 +2,7 @@ angular.module('portainer.rest') .factory('Teams', ['$resource', 'API_ENDPOINT_TEAMS', function TeamsFactory($resource, API_ENDPOINT_TEAMS) { 'use strict'; return $resource(API_ENDPOINT_TEAMS + '/:id/:entity/:entityId', {}, { - create: { method: 'POST' }, + create: { method: 'POST', ignoreLoadingBar: true }, query: { method: 'GET', isArray: true }, get: { method: 'GET', params: { id: '@id' } }, update: { method: 'PUT', params: { id: '@id' } }, diff --git a/app/rest/api/teamMembership.js b/app/rest/api/teamMembership.js index 51d503265..f7293d591 100644 --- a/app/rest/api/teamMembership.js +++ b/app/rest/api/teamMembership.js @@ -2,7 +2,7 @@ angular.module('portainer.rest') .factory('TeamMemberships', ['$resource', 'API_ENDPOINT_TEAM_MEMBERSHIPS', function TeamMembershipsFactory($resource, API_ENDPOINT_TEAM_MEMBERSHIPS) { 'use strict'; return $resource(API_ENDPOINT_TEAM_MEMBERSHIPS + '/:id/:action', {}, { - create: { method: 'POST' }, + create: { method: 'POST', ignoreLoadingBar: true }, query: { method: 'GET', isArray: true }, update: { method: 'PUT', params: { id: '@id' } }, remove: { method: 'DELETE', params: { id: '@id'} } diff --git a/app/rest/api/user.js b/app/rest/api/user.js index 12a8df34a..6337d2949 100644 --- a/app/rest/api/user.js +++ b/app/rest/api/user.js @@ -2,15 +2,15 @@ angular.module('portainer.rest') .factory('Users', ['$resource', 'API_ENDPOINT_USERS', function UsersFactory($resource, API_ENDPOINT_USERS) { 'use strict'; return $resource(API_ENDPOINT_USERS + '/:id/:entity/:entityId', {}, { - create: { method: 'POST' }, + create: { method: 'POST', ignoreLoadingBar: true }, query: { method: 'GET', isArray: true }, get: { method: 'GET', params: { id: '@id' } }, - update: { method: 'PUT', params: { id: '@id' } }, + update: { method: 'PUT', params: { id: '@id' }, ignoreLoadingBar: true }, remove: { method: 'DELETE', params: { id: '@id'} }, queryMemberships: { method: 'GET', isArray: true, params: { id: '@id', entity: 'memberships' } }, // RPCs should be moved to a specific endpoint - checkPassword: { method: 'POST', params: { id: '@id', entity: 'passwd' } }, - checkAdminUser: { method: 'GET', params: { id: 'admin', entity: 'check' }, isArray: true }, - initAdminUser: { method: 'POST', params: { id: 'admin', entity: 'init' } } + checkPassword: { method: 'POST', params: { id: '@id', entity: 'passwd' }, ignoreLoadingBar: true }, + checkAdminUser: { method: 'GET', params: { id: 'admin', entity: 'check' }, isArray: true, ignoreLoadingBar: true }, + initAdminUser: { method: 'POST', params: { id: 'admin', entity: 'init' }, ignoreLoadingBar: true } }); }]); diff --git a/app/rest/docker/config.js b/app/rest/docker/config.js index 330692fbe..6504375c4 100644 --- a/app/rest/docker/config.js +++ b/app/rest/docker/config.js @@ -6,7 +6,7 @@ angular.module('portainer.rest') }, { get: { method: 'GET', params: { id: '@id' } }, query: { method: 'GET', isArray: true }, - create: { method: 'POST', params: { action: 'create' } }, + create: { method: 'POST', params: { action: 'create' }, ignoreLoadingBar: true }, remove: { method: 'DELETE', params: { id: '@id' } } }); }]); diff --git a/app/rest/docker/container.js b/app/rest/docker/container.js index 25ab3b2da..a3a37604b 100644 --- a/app/rest/docker/container.js +++ b/app/rest/docker/container.js @@ -15,11 +15,11 @@ angular.module('portainer.rest') unpause: {method: 'POST', params: {id: '@id', action: 'unpause'}}, stats: { method: 'GET', params: { id: '@id', stream: false, action: 'stats' }, - timeout: 4500 + timeout: 4500, ignoreLoadingBar: true }, top: { method: 'GET', params: { id: '@id', action: 'top' }, - timeout: 4500 + timeout: 4500, ignoreLoadingBar: true }, start: { method: 'POST', params: {id: '@id', action: 'start'}, @@ -27,7 +27,8 @@ angular.module('portainer.rest') }, create: { method: 'POST', params: {action: 'create'}, - transformResponse: genericHandler + transformResponse: genericHandler, + ignoreLoadingBar: true }, remove: { method: 'DELETE', params: {id: '@id', v: '@v', force: '@force'}, @@ -39,7 +40,7 @@ angular.module('portainer.rest') }, exec: { method: 'POST', params: {id: '@id', action: 'exec'}, - transformResponse: genericHandler + transformResponse: genericHandler, ignoreLoadingBar: true }, inspect: { method: 'GET', params: { id: '@id', action: 'json' } diff --git a/app/rest/docker/containerCommit.js b/app/rest/docker/containerCommit.js index c8007f47d..54b9d47eb 100644 --- a/app/rest/docker/containerCommit.js +++ b/app/rest/docker/containerCommit.js @@ -5,6 +5,6 @@ angular.module('portainer.rest') endpointId: EndpointProvider.endpointID }, { - commit: {method: 'POST', params: {container: '@id', repo: '@repo', tag: '@tag'}} + commit: {method: 'POST', params: {container: '@id', repo: '@repo', tag: '@tag'}, ignoreLoadingBar: true} }); }]); diff --git a/app/rest/docker/containerLogs.js b/app/rest/docker/containerLogs.js index 6b77fabb9..a08181686 100644 --- a/app/rest/docker/containerLogs.js +++ b/app/rest/docker/containerLogs.js @@ -11,7 +11,8 @@ angular.module('portainer.rest') 'stderr': params.stderr || 0, 'timestamps': params.timestamps || 0, 'tail': params.tail || 'all' - } + }, + ignoreLoadingBar: true }).success(callback).error(function (data, status, headers, config) { console.log(data); }); diff --git a/app/rest/docker/exec.js b/app/rest/docker/exec.js index 530975678..d852a3296 100644 --- a/app/rest/docker/exec.js +++ b/app/rest/docker/exec.js @@ -7,7 +7,7 @@ angular.module('portainer.rest') { resize: { method: 'POST', params: {id: '@id', action: 'resize', h: '@height', w: '@width'}, - transformResponse: genericHandler + transformResponse: genericHandler, ignoreLoadingBar: true } }); }]); diff --git a/app/rest/docker/image.js b/app/rest/docker/image.js index 439a10861..fa08c6dad 100644 --- a/app/rest/docker/image.js +++ b/app/rest/docker/image.js @@ -11,17 +11,19 @@ angular.module('portainer.rest') search: {method: 'GET', params: {action: 'search'}}, history: {method: 'GET', params: {action: 'history'}, isArray: true}, insert: {method: 'POST', params: {id: '@id', action: 'insert'}}, - tag: {method: 'POST', params: {id: '@id', action: 'tag', force: 0, repo: '@repo', tag: '@tag'}}, + tag: {method: 'POST', params: {id: '@id', action: 'tag', force: 0, repo: '@repo', tag: '@tag'}, ignoreLoadingBar: true}, inspect: {method: 'GET', params: {id: '@id', action: 'json'}}, push: { method: 'POST', params: {action: 'push', id: '@tag'}, isArray: true, transformResponse: jsonObjectsToArrayHandler, - headers: { 'X-Registry-Auth': HttpRequestHelper.registryAuthenticationHeader } + headers: { 'X-Registry-Auth': HttpRequestHelper.registryAuthenticationHeader }, + ignoreLoadingBar: true }, create: { method: 'POST', params: {action: 'create', fromImage: '@fromImage', tag: '@tag'}, isArray: true, transformResponse: jsonObjectsToArrayHandler, - headers: { 'X-Registry-Auth': HttpRequestHelper.registryAuthenticationHeader } + headers: { 'X-Registry-Auth': HttpRequestHelper.registryAuthenticationHeader }, + ignoreLoadingBar: true }, remove: { method: 'DELETE', params: {id: '@id', force: '@force'}, diff --git a/app/rest/docker/network.js b/app/rest/docker/network.js index 561b00a9d..dd1a1e045 100644 --- a/app/rest/docker/network.js +++ b/app/rest/docker/network.js @@ -8,7 +8,7 @@ angular.module('portainer.rest') { query: {method: 'GET', isArray: true}, get: {method: 'GET'}, - create: {method: 'POST', params: {action: 'create'}, transformResponse: genericHandler}, + create: {method: 'POST', params: {action: 'create'}, transformResponse: genericHandler, ignoreLoadingBar: true}, remove: { method: 'DELETE', transformResponse: genericHandler }, connect: {method: 'POST', params: {action: 'connect'}}, disconnect: {method: 'POST', params: {action: 'disconnect'}} diff --git a/app/rest/docker/secret.js b/app/rest/docker/secret.js index 38a593248..4edb6ca4d 100644 --- a/app/rest/docker/secret.js +++ b/app/rest/docker/secret.js @@ -6,7 +6,7 @@ angular.module('portainer.rest') }, { get: { method: 'GET', params: {id: '@id'} }, query: { method: 'GET', isArray: true }, - create: { method: 'POST', params: {action: 'create'} }, + create: { method: 'POST', params: {action: 'create'}, ignoreLoadingBar: true }, remove: { method: 'DELETE', params: {id: '@id'} } }); }]); diff --git a/app/rest/docker/service.js b/app/rest/docker/service.js index 466ded8e8..877d8fa30 100644 --- a/app/rest/docker/service.js +++ b/app/rest/docker/service.js @@ -9,7 +9,8 @@ angular.module('portainer.rest') query: { method: 'GET', isArray: true, params: {filters: '@filters'} }, create: { method: 'POST', params: {action: 'create'}, - headers: { 'X-Registry-Auth': HttpRequestHelper.registryAuthenticationHeader } + headers: { 'X-Registry-Auth': HttpRequestHelper.registryAuthenticationHeader }, + ignoreLoadingBar: true }, update: { method: 'POST', params: {id: '@id', action: 'update', version: '@version'} }, remove: { method: 'DELETE', params: {id: '@id'} } diff --git a/app/rest/docker/system.js b/app/rest/docker/system.js index 8636ef348..9e9a484d9 100644 --- a/app/rest/docker/system.js +++ b/app/rest/docker/system.js @@ -6,8 +6,8 @@ angular.module('portainer.rest') endpointId: EndpointProvider.endpointID }, { - info: { method: 'GET', params: { action: 'info' } }, - version: { method: 'GET', params: { action: 'version' } }, + info: { method: 'GET', params: { action: 'info' }, ignoreLoadingBar: true }, + version: { method: 'GET', params: { action: 'version' }, ignoreLoadingBar: true }, events: { method: 'GET', params: { action: 'events', since: '@since', until: '@until' }, isArray: true, transformResponse: jsonObjectsToArrayHandler diff --git a/app/rest/docker/volume.js b/app/rest/docker/volume.js index 1ae1264f9..32214303c 100644 --- a/app/rest/docker/volume.js +++ b/app/rest/docker/volume.js @@ -8,7 +8,7 @@ angular.module('portainer.rest') { query: { method: 'GET' }, get: { method: 'GET', params: {id: '@id'} }, - create: {method: 'POST', params: {action: 'create'}, transformResponse: genericHandler}, + create: {method: 'POST', params: {action: 'create'}, transformResponse: genericHandler, ignoreLoadingBar: true}, remove: { method: 'DELETE', transformResponse: genericHandler, params: {id: '@id'} } diff --git a/app/services/fileUpload.js b/app/services/fileUpload.js index da121eec6..4efc3b5cd 100644 --- a/app/services/fileUpload.js +++ b/app/services/fileUpload.js @@ -10,7 +10,16 @@ angular.module('portainer.services') service.createStack = function(stackName, swarmId, file, env) { var endpointID = EndpointProvider.endpointID(); - return Upload.upload({ url: 'api/endpoints/' + endpointID + '/stacks?method=file', data: { file: file, Name: stackName, SwarmID: swarmId, Env: Upload.json(env) } }); + return Upload.upload({ + url: 'api/endpoints/' + endpointID + '/stacks?method=file', + data: { + file: file, + Name: stackName, + SwarmID: swarmId, + Env: Upload.json(env) + }, + ignoreLoadingBar: true + }); }; service.uploadLDAPTLSFiles = function(TLSCAFile, TLSCertFile, TLSKeyFile) { diff --git a/assets/css/app.css b/assets/css/app.css index 3f6979afb..0e409c13d 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -1,8 +1,12 @@ -html, body, #content-wrapper, .page-content, #view { +html, body, #page-wrapper, #content-wrapper, .page-content, #view { height: 100%; width: 100%; } +#view { + position: relative; +} + .white-space-normal { white-space: normal !important; } @@ -359,6 +363,11 @@ ul.sidebar .sidebar-list a.active { padding-right: 0; } +.createResource { + margin-left: 5px; + font-size: 90%; +} + ul.sidebar .sidebar-list .sidebar-sublist a { text-indent: 35px; font-size: 12px; @@ -692,6 +701,19 @@ ul.sidebar .sidebar-list .sidebar-sublist a.active { } /*!toaster override*/ +/*angular-loading-bar override*/ +#loadingbar-placeholder { + margin-bottom: 0; + height: 3px; +} + +#loading-bar .bar { + position: relative; + height: 3px; + background: #738bc0; +} +/*!angular-loading-bar override*/ + .monospaced { font-family: monospace; font-weight: 600; @@ -713,3 +735,7 @@ json-tree .branch-preview { font-size: 11px; opacity: .5; } + +.row.header .meta .page { + padding-top: 7px; +} diff --git a/bower.json b/bower.json index faa85bf65..a40404d5a 100644 --- a/bower.json +++ b/bower.json @@ -53,7 +53,8 @@ "angularjs-slider": "^6.4.0", "angular-ui-router": "~1.0.6", "codemirror": "~5.30.0", - "js-yaml": "~3.10.0" + "js-yaml": "~3.10.0", + "angular-loading-bar": "~0.9.0" }, "resolutions": { "angular": "1.5.11" diff --git a/vendor.yml b/vendor.yml index 134914a7d..7602aaadb 100644 --- a/vendor.yml +++ b/vendor.yml @@ -48,6 +48,7 @@ css: - bower_components/codemirror/lib/codemirror.css - bower_components/codemirror/addon/lint/lint.css - bower_components/angular-json-tree/dist/angular-json-tree.css + - bower_components/angular-loading-bar/build/loading-bar.css minified: - bower_components/bootstrap/dist/css/bootstrap.min.css - bower_components/rdash-ui/dist/css/rdash.min.css @@ -60,6 +61,7 @@ css: - bower_components/codemirror/lib/codemirror.css - bower_components/codemirror/addon/lint/lint.css - bower_components/angular-json-tree/dist/angular-json-tree.css + - bower_components/angular-loading-bar/build/loading-bar.min.css angular: regular: - bower_components/angular/angular.js @@ -77,6 +79,7 @@ angular: - bower_components/angularjs-slider/dist/rzslider.js - bower_components/angular-multi-select/isteven-multi-select.js - bower_components/angular-json-tree/dist/angular-json-tree.js + - bower_components/angular-loading-bar/build/loading-bar.js minified: - bower_components/angular/angular.min.js - bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js @@ -93,3 +96,4 @@ angular: - bower_components/angularjs-slider/dist/rzslider.min.js - bower_components/angular-multi-select/isteven-multi-select.js - bower_components/angular-json-tree/dist/angular-json-tree.min.js + - bower_components/angular-loading-bar/build/loading-bar.min.js From efc3154617f10282704453b60aeddc73cb2fcc43 Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Sun, 12 Nov 2017 22:39:12 +0100 Subject: [PATCH 2/3] refactor(ux): rename deploymentInProgress variable (#1385) --- .../createContainer/createContainerController.js | 6 +++--- app/components/createContainer/createcontainer.html | 6 +++--- .../createNetwork/createNetworkController.js | 6 +++--- app/components/createNetwork/createnetwork.html | 6 +++--- .../createRegistry/createRegistryController.js | 6 +++--- app/components/createRegistry/createregistry.html | 6 +++--- .../createSecret/createSecretController.js | 6 +++--- app/components/createSecret/createsecret.html | 6 +++--- .../createService/createServiceController.js | 6 +++--- app/components/createService/createservice.html | 6 +++--- app/components/createStack/createStackController.js | 6 +++--- app/components/createStack/createstack.html | 8 ++++---- .../createVolume/createVolumeController.js | 6 +++--- app/components/createVolume/createvolume.html | 6 +++--- app/components/endpoint/endpoint.html | 6 +++--- app/components/endpoint/endpointController.js | 6 +++--- app/components/endpoints/endpoints.html | 6 +++--- app/components/endpoints/endpointsController.js | 6 +++--- app/components/images/images.html | 6 +++--- app/components/images/imagesController.js | 6 +++--- app/components/initAdmin/initAdmin.html | 6 +++--- app/components/initAdmin/initAdminController.js | 6 +++--- app/components/initEndpoint/initEndpoint.html | 12 ++++++------ .../initEndpoint/initEndpointController.js | 10 +++++----- app/components/registries/registries.html | 6 +++--- app/components/registries/registriesController.js | 6 +++--- app/components/registry/registry.html | 6 +++--- app/components/registry/registryController.js | 6 +++--- app/components/settings/settings.html | 6 +++--- app/components/settings/settingsController.js | 6 +++--- .../settingsAuthentication.html | 6 +++--- .../settingsAuthenticationController.js | 6 +++--- app/components/stack/stack.html | 6 +++--- app/components/stack/stackController.js | 6 +++--- app/components/teams/teams.html | 6 +++--- app/components/teams/teamsController.js | 6 +++--- app/components/templates/templates.html | 12 ++++++------ app/components/templates/templatesController.js | 8 ++++---- app/components/users/users.html | 6 +++--- app/components/users/usersController.js | 6 +++--- 40 files changed, 130 insertions(+), 130 deletions(-) diff --git a/app/components/createContainer/createContainerController.js b/app/components/createContainer/createContainerController.js index 7258a5fab..65c9fe817 100644 --- a/app/components/createContainer/createContainerController.js +++ b/app/components/createContainer/createContainerController.js @@ -21,7 +21,7 @@ function ($q, $scope, $state, $timeout, $transition$, $filter, Container, Contai $scope.state = { formValidationError: '', - deploymentInProgress: false + actionInProgress: false }; $scope.refreshSlider = function () { @@ -580,7 +580,7 @@ function ($q, $scope, $state, $timeout, $transition$, $filter, Container, Contai return; } - $scope.state.deploymentInProgress = true; + $scope.state.actionInProgress = true; var config = prepareConfiguration(); createContainer(config, accessControlData); }) @@ -606,7 +606,7 @@ function ($q, $scope, $state, $timeout, $transition$, $filter, Container, Contai Notifications.error('Failure', err, 'Unable to create container'); }) .finally(function final() { - $scope.state.deploymentInProgress = false; + $scope.state.actionInProgress = false; }); }); } diff --git a/app/components/createContainer/createcontainer.html b/app/components/createContainer/createcontainer.html index d368d4fd7..9f6edae53 100644 --- a/app/components/createContainer/createcontainer.html +++ b/app/components/createContainer/createcontainer.html @@ -112,9 +112,9 @@
- {{ state.formValidationError }} diff --git a/app/components/createNetwork/createNetworkController.js b/app/components/createNetwork/createNetworkController.js index 33a60dcb0..a973e4632 100644 --- a/app/components/createNetwork/createNetworkController.js +++ b/app/components/createNetwork/createNetworkController.js @@ -12,7 +12,7 @@ function ($q, $scope, $state, PluginService, Notifications, NetworkService, Labe $scope.state = { formValidationError: '', - deploymentInProgress: false + actionInProgress: false }; $scope.availableNetworkDrivers = []; @@ -99,7 +99,7 @@ function ($q, $scope, $state, PluginService, Notifications, NetworkService, Labe return; } - $scope.state.deploymentInProgress = true; + $scope.state.actionInProgress = true; NetworkService.create(networkConfiguration) .then(function success(data) { 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'); }) .finally(function final() { - $scope.state.deploymentInProgress = false; + $scope.state.actionInProgress = false; }); }; diff --git a/app/components/createNetwork/createnetwork.html b/app/components/createNetwork/createnetwork.html index 2d85187dc..20beaf626 100644 --- a/app/components/createNetwork/createnetwork.html +++ b/app/components/createNetwork/createnetwork.html @@ -128,9 +128,9 @@
- {{ state.formValidationError }} diff --git a/app/components/createRegistry/createRegistryController.js b/app/components/createRegistry/createRegistryController.js index b8dbe77a2..370c62e72 100644 --- a/app/components/createRegistry/createRegistryController.js +++ b/app/components/createRegistry/createRegistryController.js @@ -4,7 +4,7 @@ function ($scope, $state, RegistryService, Notifications) { $scope.state = { RegistryType: 'quay', - deploymentInProgress: false + actionInProgress: false }; $scope.formValues = { @@ -34,7 +34,7 @@ function ($scope, $state, RegistryService, Notifications) { var username = $scope.formValues.Username; var password = $scope.formValues.Password; - $scope.state.deploymentInProgress = true; + $scope.state.actionInProgress = true; RegistryService.createRegistry(registryName, registryURL, authentication, username, password) .then(function success(data) { Notifications.success('Registry successfully created'); @@ -44,7 +44,7 @@ function ($scope, $state, RegistryService, Notifications) { Notifications.error('Failure', err, 'Unable to create registry'); }) .finally(function final() { - $scope.state.deploymentInProgress = false; + $scope.state.actionInProgress = false; }); }; }]); diff --git a/app/components/createRegistry/createregistry.html b/app/components/createRegistry/createregistry.html index 177b8395a..2593bd91d 100644 --- a/app/components/createRegistry/createregistry.html +++ b/app/components/createRegistry/createregistry.html @@ -107,9 +107,9 @@
-
diff --git a/app/components/createSecret/createSecretController.js b/app/components/createSecret/createSecretController.js index 5e0030287..de81a7bc3 100644 --- a/app/components/createSecret/createSecretController.js +++ b/app/components/createSecret/createSecretController.js @@ -12,7 +12,7 @@ function ($scope, $state, Notifications, SecretService, LabelHelper, Authenticat $scope.state = { formValidationError: '', - deploymentInProgress: false + actionInProgress: false }; $scope.addLabel = function() { @@ -65,7 +65,7 @@ function ($scope, $state, Notifications, SecretService, LabelHelper, Authenticat return; } - $scope.state.deploymentInProgress = true; + $scope.state.actionInProgress = true; var secretConfiguration = prepareConfiguration(); SecretService.create(secretConfiguration) .then(function success(data) { @@ -81,7 +81,7 @@ function ($scope, $state, Notifications, SecretService, LabelHelper, Authenticat Notifications.error('Failure', err, 'Unable to create secret'); }) .finally(function final() { - $scope.state.deploymentInProgress = false; + $scope.state.actionInProgress = false; }); }; }]); diff --git a/app/components/createSecret/createsecret.html b/app/components/createSecret/createsecret.html index 46531fb0e..060259958 100644 --- a/app/components/createSecret/createsecret.html +++ b/app/components/createSecret/createsecret.html @@ -75,9 +75,9 @@
- {{ state.formValidationError }}
diff --git a/app/components/createService/createServiceController.js b/app/components/createService/createServiceController.js index 6a874fb85..24f8a7e0e 100644 --- a/app/components/createService/createServiceController.js +++ b/app/components/createService/createServiceController.js @@ -40,7 +40,7 @@ function ($q, $scope, $state, $timeout, Service, ServiceHelper, ConfigService, C $scope.state = { formValidationError: '', - deploymentInProgress: false + actionInProgress: false }; $scope.refreshSlider = function () { @@ -367,7 +367,7 @@ function ($q, $scope, $state, $timeout, Service, ServiceHelper, ConfigService, C Notifications.error('Failure', err, 'Unable to create service'); }) .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; } - $scope.state.deploymentInProgress = true; + $scope.state.actionInProgress = true; var config = prepareConfiguration(); createNewService(config, accessControlData); }; diff --git a/app/components/createService/createservice.html b/app/components/createService/createservice.html index a80636d6e..e89dd5a07 100644 --- a/app/components/createService/createservice.html +++ b/app/components/createService/createservice.html @@ -107,9 +107,9 @@
- {{ state.formValidationError }}
diff --git a/app/components/createStack/createStackController.js b/app/components/createStack/createStackController.js index 96b40722a..04f487490 100644 --- a/app/components/createStack/createStackController.js +++ b/app/components/createStack/createStackController.js @@ -19,7 +19,7 @@ function ($scope, $state, $document, StackService, CodeMirrorService, Authentica $scope.state = { Method: 'editor', formValidationError: '', - deploymentInProgress: false + actionInProgress: false }; $scope.addEnvironmentVariable = function() { @@ -74,7 +74,7 @@ function ($scope, $state, $document, StackService, CodeMirrorService, Authentica return; } - $scope.state.deploymentInProgress = true; + $scope.state.actionInProgress = true; createStack(name) .then(function success(data) { 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'); }) .finally(function final() { - $scope.state.deploymentInProgress = false; + $scope.state.actionInProgress = false; }); }; diff --git a/app/components/createStack/createstack.html b/app/components/createStack/createstack.html index 3f8db82cf..adc57f796 100644 --- a/app/components/createStack/createstack.html +++ b/app/components/createStack/createstack.html @@ -167,12 +167,12 @@
- {{ state.formValidationError }}
diff --git a/app/components/createVolume/createVolumeController.js b/app/components/createVolume/createVolumeController.js index e71a007ba..bffdf874e 100644 --- a/app/components/createVolume/createVolumeController.js +++ b/app/components/createVolume/createVolumeController.js @@ -10,7 +10,7 @@ function ($q, $scope, $state, VolumeService, PluginService, ResourceControlServi $scope.state = { formValidationError: '', - deploymentInProgress: false + actionInProgress: false }; $scope.availableVolumeDrivers = []; @@ -49,7 +49,7 @@ function ($q, $scope, $state, VolumeService, PluginService, ResourceControlServi return; } - $scope.state.deploymentInProgress = true; + $scope.state.actionInProgress = true; VolumeService.createVolume(volumeConfiguration) .then(function success(data) { 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'); }) .finally(function final() { - $scope.state.deploymentInProgress = false; + $scope.state.actionInProgress = false; }); }; diff --git a/app/components/createVolume/createvolume.html b/app/components/createVolume/createvolume.html index 1a0825ba7..6610f24fe 100644 --- a/app/components/createVolume/createvolume.html +++ b/app/components/createVolume/createvolume.html @@ -71,9 +71,9 @@
- {{ state.formValidationError }}
diff --git a/app/components/endpoint/endpoint.html b/app/components/endpoint/endpoint.html index 860418f12..76f1188bd 100644 --- a/app/components/endpoint/endpoint.html +++ b/app/components/endpoint/endpoint.html @@ -53,9 +53,9 @@
- Cancel
diff --git a/app/components/endpoint/endpointController.js b/app/components/endpoint/endpointController.js index 2094150b5..63316489b 100644 --- a/app/components/endpoint/endpointController.js +++ b/app/components/endpoint/endpointController.js @@ -8,7 +8,7 @@ function ($scope, $state, $transition$, $filter, EndpointService, Notifications) $scope.state = { uploadInProgress: false, - deploymentInProgress: false + actionInProgress: false }; $scope.formValues = { @@ -36,14 +36,14 @@ function ($scope, $state, $transition$, $filter, EndpointService, Notifications) type: $scope.endpointType }; - $scope.state.deploymentInProgress = true; + $scope.state.actionInProgress = true; EndpointService.updateEndpoint(endpoint.Id, endpointParams) .then(function success(data) { Notifications.success('Endpoint updated', $scope.endpoint.Name); $state.go('endpoints'); }, function error(err) { Notifications.error('Failure', err, 'Unable to update endpoint'); - $scope.state.deploymentInProgress = false; + $scope.state.actionInProgress = false; }, function update(evt) { if (evt.upload) { $scope.state.uploadInProgress = evt.upload; diff --git a/app/components/endpoints/endpoints.html b/app/components/endpoints/endpoints.html index 1c74e876c..5f9f0a183 100644 --- a/app/components/endpoints/endpoints.html +++ b/app/components/endpoints/endpoints.html @@ -65,9 +65,9 @@
-
diff --git a/app/components/endpoints/endpointsController.js b/app/components/endpoints/endpointsController.js index 2843c1649..8a33f34b4 100644 --- a/app/components/endpoints/endpointsController.js +++ b/app/components/endpoints/endpointsController.js @@ -5,7 +5,7 @@ function ($scope, $state, $filter, EndpointService, EndpointProvider, Notificati uploadInProgress: false, selectedItemCount: 0, pagination_count: Pagination.getPaginationCount('endpoints'), - deploymentInProgress: false + actionInProgress: false }; $scope.sortType = 'Name'; $scope.sortReverse = true; @@ -60,13 +60,13 @@ function ($scope, $state, $filter, EndpointService, EndpointProvider, Notificati var TLSCertFile = TLSSkipClientVerify ? null : securityData.TLSCert; 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) { Notifications.success('Endpoint created', name); $state.reload(); }, function error(err) { $scope.state.uploadInProgress = false; - $scope.state.deploymentInProgress = false; + $scope.state.actionInProgress = false; Notifications.error('Failure', err, 'Unable to create endpoint'); }, function update(evt) { if (evt.upload) { diff --git a/app/components/images/images.html b/app/components/images/images.html index bedf5cab8..acafa7ae0 100644 --- a/app/components/images/images.html +++ b/app/components/images/images.html @@ -28,9 +28,9 @@
-
diff --git a/app/components/images/imagesController.js b/app/components/images/imagesController.js index 0a76b343e..496393a50 100644 --- a/app/components/images/imagesController.js +++ b/app/components/images/imagesController.js @@ -3,7 +3,7 @@ angular.module('images', []) function ($scope, $state, ImageService, Notifications, Pagination, ModalService) { $scope.state = { pagination_count: Pagination.getPaginationCount('images'), - deploymentInProgress: false, + actionInProgress: false, selectedItemCount: 0 }; @@ -45,7 +45,7 @@ function ($scope, $state, ImageService, Notifications, Pagination, ModalService) var image = $scope.formValues.Image; var registry = $scope.formValues.Registry; - $scope.state.deploymentInProgress = true; + $scope.state.actionInProgress = true; ImageService.pullImage(image, registry, false) .then(function success(data) { 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'); }) .finally(function final() { - $scope.state.deploymentInProgress = false; + $scope.state.actionInProgress = false; }); }; diff --git a/app/components/initAdmin/initAdmin.html b/app/components/initAdmin/initAdmin.html index 1cff49755..2a8bd59ae 100644 --- a/app/components/initAdmin/initAdmin.html +++ b/app/components/initAdmin/initAdmin.html @@ -64,9 +64,9 @@
-
diff --git a/app/components/initAdmin/initAdminController.js b/app/components/initAdmin/initAdminController.js index 4e22f9e9d..0b0bcfee7 100644 --- a/app/components/initAdmin/initAdminController.js +++ b/app/components/initAdmin/initAdminController.js @@ -11,14 +11,14 @@ function ($scope, $state, $sanitize, Notifications, Authentication, StateManager }; $scope.state = { - deploymentInProgress: false + actionInProgress: false }; $scope.createAdminUser = function() { var username = $sanitize($scope.formValues.Username); var password = $sanitize($scope.formValues.Password); - $scope.state.deploymentInProgress = true; + $scope.state.actionInProgress = true; UserService.initAdministrator(username, password) .then(function success() { 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'); }) .finally(function final() { - $scope.state.deploymentInProgress = false; + $scope.state.actionInProgress = false; }); }; diff --git a/app/components/initEndpoint/initEndpoint.html b/app/components/initEndpoint/initEndpoint.html index 54512ece6..c526d2ec8 100644 --- a/app/components/initEndpoint/initEndpoint.html +++ b/app/components/initEndpoint/initEndpoint.html @@ -66,9 +66,9 @@
-
@@ -186,9 +186,9 @@
-
diff --git a/app/components/initEndpoint/initEndpointController.js b/app/components/initEndpoint/initEndpointController.js index 9837d4193..cbca5c66b 100644 --- a/app/components/initEndpoint/initEndpointController.js +++ b/app/components/initEndpoint/initEndpointController.js @@ -10,7 +10,7 @@ function ($scope, $state, EndpointService, StateManager, EndpointProvider, Notif $scope.state = { uploadInProgress: false, - deploymentInProgress: false + actionInProgress: false }; $scope.formValues = { @@ -30,7 +30,7 @@ function ($scope, $state, EndpointService, StateManager, EndpointProvider, Notif var URL = 'unix:///var/run/docker.sock'; var endpointID = 1; - $scope.state.deploymentInProgress = true; + $scope.state.actionInProgress = true; EndpointService.createLocalEndpoint(name, URL, false, true) .then(function success(data) { endpointID = data.Id; @@ -45,7 +45,7 @@ function ($scope, $state, EndpointService, StateManager, EndpointProvider, Notif EndpointService.deleteEndpoint(endpointID); }) .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 endpointID = 1; - $scope.state.deploymentInProgress = true; + $scope.state.actionInProgress = true; EndpointService.createRemoteEndpoint(name, URL, PublicURL, TLS, TLSSkipVerify, TLSSKipClientVerify, TLSCAFile, TLSCertFile, TLSKeyFile) .then(function success(data) { endpointID = data.Id; @@ -76,7 +76,7 @@ function ($scope, $state, EndpointService, StateManager, EndpointProvider, Notif EndpointService.deleteEndpoint(endpointID); }) .finally(function final() { - $scope.state.deploymentInProgress = false; + $scope.state.actionInProgress = false; }); }; }]); diff --git a/app/components/registries/registries.html b/app/components/registries/registries.html index 4eba3201e..e350b83a3 100644 --- a/app/components/registries/registries.html +++ b/app/components/registries/registries.html @@ -56,9 +56,9 @@
-
diff --git a/app/components/registries/registriesController.js b/app/components/registries/registriesController.js index fb3205198..4357cf972 100644 --- a/app/components/registries/registriesController.js +++ b/app/components/registries/registriesController.js @@ -5,14 +5,14 @@ function ($q, $scope, $state, RegistryService, DockerHubService, ModalService, N $scope.state = { selectedItemCount: 0, pagination_count: Pagination.getPaginationCount('registries'), - deploymentInProgress: false + actionInProgress: false }; $scope.sortType = 'Name'; $scope.sortReverse = true; $scope.updateDockerHub = function() { var dockerhub = $scope.dockerhub; - $scope.state.deploymentInProgress = true; + $scope.state.actionInProgress = true; DockerHubService.update(dockerhub) .then(function success(data) { 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'); }) .finally(function final() { - $scope.state.deploymentInProgress = false; + $scope.state.actionInProgress = false; }); }; diff --git a/app/components/registry/registry.html b/app/components/registry/registry.html index 829344dab..1cb8002d8 100644 --- a/app/components/registry/registry.html +++ b/app/components/registry/registry.html @@ -64,9 +64,9 @@
- Cancel
diff --git a/app/components/registry/registryController.js b/app/components/registry/registryController.js index efc107ef6..03b672320 100644 --- a/app/components/registry/registryController.js +++ b/app/components/registry/registryController.js @@ -3,12 +3,12 @@ angular.module('registry', []) function ($scope, $state, $transition$, $filter, RegistryService, Notifications) { $scope.state = { - deploymentInProgress: false + actionInProgress: false }; $scope.updateRegistry = function() { var registry = $scope.registry; - $scope.state.deploymentInProgress = true; + $scope.state.actionInProgress = true; RegistryService.updateRegistry(registry) .then(function success(data) { Notifications.success('Registry successfully updated'); @@ -18,7 +18,7 @@ function ($scope, $state, $transition$, $filter, RegistryService, Notifications) Notifications.error('Failure', err, 'Unable to update registry'); }) .finally(function final() { - $scope.state.deploymentInProgress = false; + $scope.state.actionInProgress = false; }); }; diff --git a/app/components/settings/settings.html b/app/components/settings/settings.html index 2e0449022..1cc2e712b 100644 --- a/app/components/settings/settings.html +++ b/app/components/settings/settings.html @@ -110,9 +110,9 @@
-
diff --git a/app/components/settings/settingsController.js b/app/components/settings/settingsController.js index abe9fef57..ef177641b 100644 --- a/app/components/settings/settingsController.js +++ b/app/components/settings/settingsController.js @@ -3,7 +3,7 @@ angular.module('settings', []) function ($scope, $state, Notifications, SettingsService, StateManager, DEFAULT_TEMPLATES_URL) { $scope.state = { - deploymentInProgress: false + actionInProgress: false }; $scope.formValues = { @@ -49,7 +49,7 @@ function ($scope, $state, Notifications, SettingsService, StateManager, DEFAULT_ settings.AllowBindMountsForRegularUsers = !$scope.formValues.restrictBindMounts; settings.AllowPrivilegedModeForRegularUsers = !$scope.formValues.restrictPrivilegedMode; - $scope.state.deploymentInProgress = true; + $scope.state.actionInProgress = true; updateSettings(settings, false); }; @@ -72,7 +72,7 @@ function ($scope, $state, Notifications, SettingsService, StateManager, DEFAULT_ Notifications.error('Failure', err, 'Unable to update settings'); }) .finally(function final() { - $scope.state.deploymentInProgress = false; + $scope.state.actionInProgress = false; }); } diff --git a/app/components/settingsAuthentication/settingsAuthentication.html b/app/components/settingsAuthentication/settingsAuthentication.html index 07e3ec491..b1a4917cf 100644 --- a/app/components/settingsAuthentication/settingsAuthentication.html +++ b/app/components/settingsAuthentication/settingsAuthentication.html @@ -240,9 +240,9 @@
-
diff --git a/app/components/settingsAuthentication/settingsAuthenticationController.js b/app/components/settingsAuthentication/settingsAuthenticationController.js index a52ed8049..36c266dc7 100644 --- a/app/components/settingsAuthentication/settingsAuthenticationController.js +++ b/app/components/settingsAuthentication/settingsAuthenticationController.js @@ -7,7 +7,7 @@ function ($q, $scope, Notifications, SettingsService, FileUploadService) { failedConnectivityCheck: false, uploadInProgress: false, connectivityCheckInProgress: false, - deploymentInProgress: false + actionInProgress: false }; $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; $scope.state.uploadInProgress = uploadRequired; - $scope.state.deploymentInProgress = true; + $scope.state.actionInProgress = true; $q.when(!uploadRequired || FileUploadService.uploadLDAPTLSFiles(TLSCAFile, null, null)) .then(function success(data) { return SettingsService.update(settings); @@ -70,7 +70,7 @@ function ($q, $scope, Notifications, SettingsService, FileUploadService) { }) .finally(function final() { $scope.state.uploadInProgress = false; - $scope.state.deploymentInProgress = false; + $scope.state.actionInProgress = false; }); }; diff --git a/app/components/stack/stack.html b/app/components/stack/stack.html index f09031292..07561503e 100644 --- a/app/components/stack/stack.html +++ b/app/components/stack/stack.html @@ -72,9 +72,9 @@
-
diff --git a/app/components/stack/stackController.js b/app/components/stack/stackController.js index 198a00cc0..63efdfeeb 100644 --- a/app/components/stack/stackController.js +++ b/app/components/stack/stackController.js @@ -3,7 +3,7 @@ angular.module('stack', []) function ($q, $scope, $state, $stateParams, $document, StackService, NodeService, ServiceService, TaskService, ServiceHelper, CodeMirrorService, Notifications, FormHelper) { $scope.state = { - deploymentInProgress: false + actionInProgress: false }; $scope.deployStack = function () { @@ -12,7 +12,7 @@ function ($q, $scope, $state, $stateParams, $document, StackService, NodeService var stackFile = $scope.editor.getValue(); var env = FormHelper.removeInvalidEnvVars($scope.stack.Env); - $scope.state.deploymentInProgress = true; + $scope.state.actionInProgress = true; StackService.updateStack($scope.stack.Id, stackFile, env) .then(function success(data) { 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'); }) .finally(function final() { - $scope.state.deploymentInProgress = false; + $scope.state.actionInProgress = false; }); }; diff --git a/app/components/teams/teams.html b/app/components/teams/teams.html index c6c7b9657..3b9c47037 100644 --- a/app/components/teams/teams.html +++ b/app/components/teams/teams.html @@ -49,9 +49,9 @@
- {{ state.teamCreationError }} diff --git a/app/components/teams/teamsController.js b/app/components/teams/teamsController.js index 267a4f0a0..41c0e1288 100644 --- a/app/components/teams/teamsController.js +++ b/app/components/teams/teamsController.js @@ -6,7 +6,7 @@ function ($q, $scope, $state, TeamService, UserService, TeamMembershipService, M selectedItemCount: 0, validName: false, pagination_count: Pagination.getPaginationCount('teams'), - deploymentInProgress: false + actionInProgress: false }; $scope.sortType = 'Name'; $scope.sortReverse = false; @@ -55,7 +55,7 @@ function ($q, $scope, $state, TeamService, UserService, TeamMembershipService, M }; $scope.addTeam = function() { - $scope.state.deploymentInProgress = true; + $scope.state.actionInProgress = true; $scope.state.teamCreationError = ''; var teamName = $scope.formValues.Name; var leaderIds = []; @@ -72,7 +72,7 @@ function ($q, $scope, $state, TeamService, UserService, TeamMembershipService, M Notifications.error('Failure', err, 'Unable to create team'); }) .finally(function final() { - $scope.state.deploymentInProgress = false; + $scope.state.actionInProgress = false; }); }; diff --git a/app/components/templates/templates.html b/app/components/templates/templates.html index 274173635..633e9cf92 100644 --- a/app/components/templates/templates.html +++ b/app/components/templates/templates.html @@ -64,9 +64,9 @@
- {{ state.formValidationError }}
@@ -296,9 +296,9 @@
- When using Swarm, we recommend deploying containers in a shared network. Looks like you don't have any shared network, head over the networks view to create one. diff --git a/app/components/templates/templatesController.js b/app/components/templates/templatesController.js index d8e9f2234..c6610886e 100644 --- a/app/components/templates/templatesController.js +++ b/app/components/templates/templatesController.js @@ -7,7 +7,7 @@ function ($scope, $q, $state, $transition$, $anchorScroll, $filter, ContainerSer hideDescriptions: $transition$.params().hide_descriptions, formValidationError: '', showDeploymentSelector: false, - deploymentInProgress: false, + actionInProgress: false, filters: { Categories: '!', Platform: '!', @@ -86,7 +86,7 @@ function ($scope, $q, $state, $transition$, $anchorScroll, $filter, ContainerSer Notifications.error('Failure', err, err.msg); }) .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}); }) .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 templatesKey = $scope.templatesKey; - $scope.state.deploymentInProgress = true; + $scope.state.actionInProgress = true; if (template.Type === 'stack') { createStackFromTemplate(template, userId, accessControlData); } else { diff --git a/app/components/users/users.html b/app/components/users/users.html index 8cb96e493..c11f56d30 100644 --- a/app/components/users/users.html +++ b/app/components/users/users.html @@ -97,9 +97,9 @@
- {{ state.userCreationError }} diff --git a/app/components/users/usersController.js b/app/components/users/usersController.js index d4b11151f..61159f62c 100644 --- a/app/components/users/usersController.js +++ b/app/components/users/usersController.js @@ -6,7 +6,7 @@ function ($q, $scope, $state, $sanitize, UserService, TeamService, TeamMembershi selectedItemCount: 0, validUsername: false, pagination_count: Pagination.getPaginationCount('users'), - deploymentInProgress: false + actionInProgress: false }; $scope.sortType = 'RoleName'; $scope.sortReverse = false; @@ -58,7 +58,7 @@ function ($q, $scope, $state, $sanitize, UserService, TeamService, TeamMembershi }; $scope.addUser = function() { - $scope.state.deploymentInProgress = true; + $scope.state.actionInProgress = true; $scope.state.userCreationError = ''; var username = $sanitize($scope.formValues.Username); 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'); }) .finally(function final() { - $scope.state.deploymentInProgress = false; + $scope.state.actionInProgress = false; }); }; From d9262d4b7fa9d19bf65f1f5623250c424fe6cee1 Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Mon, 13 Nov 2017 10:11:11 +0100 Subject: [PATCH 3/3] chore(version): bump version number --- api/portainer.go | 2 +- api/swagger.yaml | 4 ++-- bower.json | 2 +- distribution/portainer.spec | 2 +- package.json | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/portainer.go b/api/portainer.go index 26467a87c..c437f0df6 100644 --- a/api/portainer.go +++ b/api/portainer.go @@ -389,7 +389,7 @@ type ( const ( // APIVersion is the version number of the Portainer API. - APIVersion = "1.15.1" + APIVersion = "1.15.2" // DBVersion is the version number of the Portainer database. DBVersion = 6 // DefaultTemplatesURL represents the default URL for the templates definitions. diff --git a/api/swagger.yaml b/api/swagger.yaml index 61e2c723a..3e5abf7fc 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -56,7 +56,7 @@ info: **NOTE**: You can find more information on how to query the Docker API in the [Docker official documentation](https://docs.docker.com/engine/api/v1.30/) as well as in [this Portainer example](https://gist.github.com/deviantony/77026d402366b4b43fa5918d41bc42f8). - version: "1.15.1" + version: "1.15.2" title: "Portainer API" contact: email: "info@portainer.io" @@ -1869,7 +1869,7 @@ definitions: description: "Is analytics enabled" Version: type: "string" - example: "1.15.1" + example: "1.15.2" description: "Portainer API version" PublicSettingsInspectResponse: type: "object" diff --git a/bower.json b/bower.json index a40404d5a..c675f5646 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "portainer", - "version": "1.15.1", + "version": "1.15.2", "homepage": "https://github.com/portainer/portainer", "authors": [ "Anthony Lapenna " diff --git a/distribution/portainer.spec b/distribution/portainer.spec index a2d06e102..79a2bc69f 100644 --- a/distribution/portainer.spec +++ b/distribution/portainer.spec @@ -1,5 +1,5 @@ Name: portainer -Version: 1.15.1 +Version: 1.15.2 Release: 0 License: Zlib Summary: A lightweight docker management UI diff --git a/package.json b/package.json index eb476ea2a..56a743e66 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Portainer.io", "name": "portainer", "homepage": "http://portainer.io", - "version": "1.15.1", + "version": "1.15.2", "repository": { "type": "git", "url": "git@github.com:portainer/portainer.git"