1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-20 13:59:40 +02:00

feat(notifications): replace gritter with toastr (#793)

This commit is contained in:
Anthony Lapenna 2017-04-12 20:47:22 +01:00 committed by GitHub
parent 8e8b0578b2
commit f15cf3e8be
38 changed files with 277 additions and 728 deletions

View file

@ -1,6 +1,6 @@
angular.module('createVolume', [])
.controller('CreateVolumeController', ['$scope', '$state', 'VolumeService', 'InfoService', 'ResourceControlService', 'Authentication', 'Messages',
function ($scope, $state, VolumeService, InfoService, ResourceControlService, Authentication, Messages) {
.controller('CreateVolumeController', ['$scope', '$state', 'VolumeService', 'InfoService', 'ResourceControlService', 'Authentication', 'Notifications',
function ($scope, $state, VolumeService, InfoService, ResourceControlService, Authentication, Notifications) {
$scope.formValues = {
Ownership: $scope.applicationState.application.authentication ? 'private' : '',
@ -30,19 +30,19 @@ function ($scope, $state, VolumeService, InfoService, ResourceControlService, Au
if ($scope.formValues.Ownership === 'private') {
ResourceControlService.setVolumeResourceControl(Authentication.getUserDetails().ID, data.Name)
.then(function success() {
Messages.send("Volume created", data.Name);
Notifications.success("Volume created", data.Name);
$state.go('volumes', {}, {reload: true});
})
.catch(function error(err) {
Messages.error("Failure", err, 'Unable to apply resource control on volume');
Notifications.error("Failure", err, 'Unable to apply resource control on volume');
});
} else {
Messages.send("Volume created", data.Name);
Notifications.success("Volume created", data.Name);
$state.go('volumes', {}, {reload: true});
}
})
.catch(function error(err) {
Messages.error('Failure', err, 'Unable to create volume');
Notifications.error('Failure', err, 'Unable to create volume');
})
.finally(function final() {
$('#createVolumeSpinner').hide();
@ -56,7 +56,7 @@ function ($scope, $state, VolumeService, InfoService, ResourceControlService, Au
$scope.availableVolumeDrivers = data;
})
.catch(function error(err) {
Messages.error("Failure", err, 'Unable to retrieve volume plugin information');
Notifications.error("Failure", err, 'Unable to retrieve volume plugin information');
})
.finally(function final() {
$('#loadingViewSpinner').hide();