fix(toast): update styles and custom button (#7450)

EE-3829
pull/7459/head
Ali 2022-08-10 17:07:35 +12:00 committed by GitHub
parent c3ce4d8b53
commit 7bd971f838
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
65 changed files with 115 additions and 92 deletions

View File

@ -193,16 +193,20 @@ input:checked + .slider:before {
#toast-container > .toast-success {
background-image: url(../images/icon-success.svg) !important;
background-position: top 20px left 20px;
background-size: 40px 40px;
background-position: top 12px left 12px;
}
#toast-container > .toast-error {
background-image: url(../images/icon-error.svg) !important;
background-position: top 20px left 20px;
background-size: 40px 40px;
background-position: top 12px left 12px;
}
#toast-container > .toast-warning {
background-image: url(../images/icon-warning.svg) !important;
background-size: 40px 40px;
background-position: top 12px left 12px;
}
.toast-success .toast-progress {
@ -219,7 +223,7 @@ input:checked + .slider:before {
color: var(--ui-gray-7);
background-color: var(--white-color);
border-radius: 8px;
padding: 20px 20px 20px 80px;
padding: 18px 20px 18px 68px;
width: 300px;
opacity: 1;
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
@ -235,6 +239,7 @@ input:checked + .slider:before {
.toast-close-button {
color: var(--black-color);
text-decoration: none;
margin-top: 5px;
cursor: pointer;
opacity: 0.4;
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=40);
@ -252,8 +257,10 @@ input:checked + .slider:before {
}
.toast-title {
font-weight: 500;
color: var(--black-color);
padding: 10px 0px;
padding-right: 10px;
margin-bottom: 4px;
}
/* Modal */

View File

@ -139,7 +139,7 @@ class CreateConfigController {
const resourceControl = data.Portainer.ResourceControl;
const userId = userDetails.ID;
await this.ResourceControlService.applyResourceControl(userId, accessControlData, resourceControl);
this.Notifications.success('Config successfully created');
this.Notifications.success('Success', 'Configuration successfully created');
this.state.isEditorDirty = false;
this.$state.go('docker.configs', {}, { reload: true });
} catch (err) {

View File

@ -16,7 +16,7 @@ angular.module('portainer.docker').controller('ConfigController', [
$scope.removeConfig = function removeConfig(configId) {
ConfigService.remove(configId)
.then(function success() {
Notifications.success('Config successfully removed');
Notifications.success('Success', 'Configuration successfully removed');
$state.go('docker.configs', {});
})
.catch(function error(err) {

View File

@ -883,7 +883,7 @@ angular.module('portainer.docker').controller('CreateContainerController', [
} else {
await ContainerService.updateLimits($transition$.params().from, config);
$scope.config = config;
Notifications.success('Limits updated');
Notifications.success('Success', 'Limits updated');
}
} catch (err) {
Notifications.error('Failure', err, 'Update Limits fail');
@ -1090,7 +1090,7 @@ angular.module('portainer.docker').controller('CreateContainerController', [
}
function onSuccess() {
Notifications.success('Container successfully created');
Notifications.success('Success', 'Container successfully created');
$state.go('docker.containers', {}, { reload: true });
}
}

View File

@ -290,7 +290,7 @@ angular.module('portainer.docker').controller('ContainerController', [
function removeContainer(cleanAssociatedVolumes) {
ContainerService.remove($scope.container, cleanAssociatedVolumes)
.then(function success() {
Notifications.success('Container successfully removed');
Notifications.success('Success', 'Container successfully removed');
$state.go('docker.containers', {}, { reload: true });
})
.catch(function error(err) {
@ -380,7 +380,7 @@ angular.module('portainer.docker').controller('ContainerController', [
}
function notifyAndChangeView() {
Notifications.success('Container successfully re-created');
Notifications.success('Success', 'Container successfully re-created');
$state.go('docker.containers', {}, { reload: true });
}
@ -414,7 +414,7 @@ angular.module('portainer.docker').controller('ContainerController', [
Name: restartPolicy,
MaximumRetryCount: maximumRetryCount,
};
Notifications.success('Restart policy updated');
Notifications.success('Success', 'Restart policy updated');
}
function notifyOnError(err) {

View File

@ -106,7 +106,7 @@ export default class DockerFeaturesConfigurationController {
await this.EndpointService.updateSecuritySettings(this.endpoint.Id, securitySettings);
this.endpoint.SecuritySettings = securitySettings;
this.Notifications.success('Saved settings successfully');
this.Notifications.success('Success', 'Saved settings successfully');
} catch (e) {
this.Notifications.error('Failure', e, 'Failed saving settings');
}

View File

@ -76,7 +76,7 @@ angular.module('portainer.docker').controller('ImageController', [
ImageService.tagImage($transition$.params().id, image.fromImage)
.then(function success() {
Notifications.success('Image successfully tagged');
Notifications.success('Success', 'Image successfully tagged');
$state.go('docker.images.image', { id: $transition$.params().id }, { reload: true });
})
.catch(function error(err) {
@ -155,7 +155,7 @@ angular.module('portainer.docker').controller('ImageController', [
.then(function success(data) {
var downloadData = new Blob([data.file], { type: 'application/x-tar' });
FileSaver.saveAs(downloadData, 'images.tar');
Notifications.success('Image successfully downloaded');
Notifications.success('Success', 'Image successfully downloaded');
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to download image');

View File

@ -90,7 +90,7 @@ angular.module('portainer.docker').controller('ImagesController', [
.then(function success(data) {
var downloadData = new Blob([data.file], { type: 'application/x-tar' });
FileSaver.saveAs(downloadData, 'images.tar');
Notifications.success('Image(s) successfully downloaded');
Notifications.success('Success', 'Image(s) successfully downloaded');
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to download image(s)');

View File

@ -58,9 +58,9 @@ angular.module('portainer.docker').controller('ImportImageController', [
await tagImage(imageIds[1]);
$state.go('docker.images.image', { id: imageIds[1] }, { reload: true });
}
Notifications.success('Images successfully uploaded');
Notifications.success('Success', 'Images successfully uploaded');
} else {
Notifications.success('The uploaded tar file contained multiple images. The provided tag therefore has been ignored.');
Notifications.success('Success', 'The uploaded tar file contained multiple images. The provided tag therefore has been ignored.');
}
} catch (err) {
Notifications.error('Failure', err, 'Unable to upload image');

View File

@ -239,7 +239,7 @@ angular.module('portainer.docker').controller('CreateNetworkController', [
return ResourceControlService.applyResourceControl(userId, accessControlData, resourceControl);
})
.then(function success() {
Notifications.success('Network successfully created');
Notifications.success('Success', 'Network successfully created');
if (context.reload) {
$state.go(
'docker.networks',

View File

@ -19,7 +19,7 @@ class DockerRegistryAccessController {
this.state.actionInProgress = true;
try {
await this.EndpointService.updateRegistryAccess(this.state.endpointId, this.state.registryId, this.registryEndpointAccesses);
this.Notifications.success('Access successfully updated');
this.Notifications.success('Success', 'Access successfully updated');
this.$state.reload();
} catch (err) {
this.state.actionInProgress = false;

View File

@ -89,7 +89,7 @@ angular.module('portainer.docker').controller('CreateSecretController', [
return ResourceControlService.applyResourceControl(userId, accessControlData, resourceControl);
})
.then(function success() {
Notifications.success('Secret successfully created');
Notifications.success('Success', 'Secret successfully created');
$state.go('docker.secrets', {}, { reload: true });
})
.catch(function error(err) {

View File

@ -16,7 +16,7 @@ angular.module('portainer.docker').controller('SecretController', [
$scope.removeSecret = function removeSecret(secretId) {
SecretService.remove(secretId)
.then(function success() {
Notifications.success('Secret successfully removed');
Notifications.success('Success', 'Secret successfully removed');
$state.go('docker.secrets', {});
})
.catch(function error(err) {

View File

@ -537,7 +537,7 @@ angular.module('portainer.docker').controller('CreateServiceController', [
return $q.all([rcPromise, webhookPromise]);
})
.then(function success() {
Notifications.success('Service successfully created');
Notifications.success('Success', 'Service successfully created');
$state.go('docker.services', {}, { reload: true });
})
.catch(function error(err) {

View File

@ -609,7 +609,7 @@ angular.module('portainer.docker').controller('ServiceController', [
return $q.when($scope.webhookID && WebhookService.deleteWebhook($scope.webhookID));
})
.then(function success() {
Notifications.success('Service successfully deleted');
Notifications.success('Success', 'Service successfully deleted');
$state.go('docker.services', {});
})
.catch(function error(err) {

View File

@ -133,7 +133,7 @@ angular.module('portainer.docker').controller('CreateVolumeController', [
return ResourceControlService.applyResourceControl(userId, accessControlData, resourceControl);
})
.then(function success() {
Notifications.success('Volume successfully created');
Notifications.success('Success', 'Volume successfully created');
$state.go('docker.volumes', {}, { reload: true });
})
.catch(function error(err) {

View File

@ -204,7 +204,7 @@ export function DataTable({
devices.map((d) => d.Id),
{
onSuccess() {
notifySuccess('Edge devices associated successfully');
notifySuccess('Success', 'Edge devices associated successfully');
},
}
);

View File

@ -39,7 +39,7 @@ export class CreateEdgeGroupController {
this.state.actionInProgress = true;
try {
await this.EdgeGroupService.create(this.model);
this.Notifications.success('Edge group successfully created');
this.Notifications.success('Success', 'Edge group successfully created');
this.$state.go('edge.groups');
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to create edge group');

View File

@ -36,7 +36,7 @@ export class EditEdgeGroupController {
this.state.actionInProgress = true;
try {
await this.EdgeGroupService.update(this.model);
this.Notifications.success('Edge group successfully updated');
this.Notifications.success('Success', 'Edge group successfully updated');
this.$state.go('edge.groups');
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to update edge group');

View File

@ -39,7 +39,7 @@ export class CreateEdgeJobViewController {
try {
await this.createEdgeJob(method, this.model);
this.Notifications.success('Edge job successfully created');
this.Notifications.success('Success', 'Edge job successfully created');
this.state.isEditorDirty = false;
this.$state.go('edge.jobs', {}, { reload: true });
} catch (err) {

View File

@ -45,7 +45,7 @@ export class EdgeJobController {
try {
await this.EdgeJobService.updateEdgeJob(model);
this.Notifications.success('Edge job successfully updated');
this.Notifications.success('Success', 'Edge job successfully updated');
this.state.isEditorDirty = false;
this.$state.go('edge.jobs', {}, { reload: true });
} catch (err) {

View File

@ -107,7 +107,7 @@ export default class CreateEdgeStackViewController {
try {
await this.createStackByMethod(name, method);
this.Notifications.success('Stack successfully deployed');
this.Notifications.success('Success', 'Stack successfully deployed');
this.state.isEditorDirty = false;
this.$state.go('edge.stacks');
} catch (err) {

View File

@ -83,7 +83,7 @@ export class EditEdgeStackViewController {
this.formValues.Version = this.stack.Version + 1;
}
await this.EdgeStackService.updateStack(this.stack.Id, this.formValues);
this.Notifications.success('Stack successfully deployed');
this.Notifications.success('Success', 'Stack successfully deployed');
this.state.isEditorDirty = false;
this.$state.go('edge.stacks');
} catch (err) {

View File

@ -19,7 +19,7 @@ export default class HelmAddRepositoryController {
this.state.isAddingRepo = true;
try {
await this.HelmService.addHelmRepository(this.endpoint.Id, { url: this.state.repository });
this.Notifications.success('Helm repository added successfully');
this.Notifications.success('Success', 'Helm repository added successfully');
this.$state.reload(this.$state.current);
} catch (err) {
this.Notifications.error('Installation error', err);

View File

@ -58,7 +58,7 @@ export default class HelmTemplatesController {
Namespace: this.state.resourcePool.Namespace.Name,
};
await this.HelmService.install(this.endpoint.Id, payload);
this.Notifications.success('Helm Chart successfully installed');
this.Notifications.success('Success', 'Helm Chart successfully installed');
this.$analytics.eventTrack('kubernetes-helm-install', { category: 'kubernetes', metadata: { 'chart-name': this.state.chart.name } });
this.state.isEditorDirty = false;
this.$state.go('kubernetes.applications');

View File

@ -109,7 +109,7 @@ class KubeCreateCustomTemplateViewController {
const userId = userDetails.ID;
await this.ResourceControlService.applyResourceControl(userId, accessControlData, customTemplate.ResourceControl);
this.Notifications.success('Custom template successfully created');
this.Notifications.success('Success', 'Custom template successfully created');
this.state.isEditorDirty = false;
this.$state.go('kubernetes.templates.custom');
} catch (err) {

View File

@ -121,7 +121,7 @@ class KubeEditCustomTemplateViewController {
const userId = userDetails.ID;
await this.ResourceControlService.applyResourceControl(userId, this.formValues.AccessControlData, this.formValues.ResourceControl);
this.Notifications.success('Custom template successfully updated');
this.Notifications.success('Success', 'Custom template successfully updated');
this.state.isEditorDirty = false;
this.$state.go('kubernetes.templates.custom');
} catch (err) {

View File

@ -1019,7 +1019,7 @@ class KubernetesCreateApplicationController {
try {
this.state.actionInProgress = true;
await this.KubernetesApplicationService.patch(this.savedFormValues, this.formValues);
this.Notifications.success('Application successfully updated');
this.Notifications.success('Success', 'Application successfully updated');
this.$state.go('kubernetes.applications.application', { name: this.application.Name, namespace: this.application.ResourcePool });
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to update application');

View File

@ -213,7 +213,7 @@ class KubernetesApplicationController {
// await this.KubernetesApplicationService.rollback(this.application, this.formValues.SelectedRevision);
const revision = _.nth(this.application.Revisions, -2);
await this.KubernetesApplicationService.rollback(this.application, revision);
this.Notifications.success('Application successfully rolled back');
this.Notifications.success('Success', 'Application successfully rolled back');
this.$state.reload(this.$state.current);
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to rollback the application');
@ -234,7 +234,7 @@ class KubernetesApplicationController {
try {
const promises = _.map(this.application.Pods, (item) => this.KubernetesPodService.delete(item));
await Promise.all(promises);
this.Notifications.success('Application successfully redeployed');
this.Notifications.success('Success', 'Application successfully redeployed');
this.$state.reload(this.$state.current);
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to redeploy the application');
@ -257,7 +257,7 @@ class KubernetesApplicationController {
const application = angular.copy(this.application);
application.Note = this.formValues.Note;
await this.KubernetesApplicationService.patch(this.application, application, true);
this.Notifications.success('Application successfully updated');
this.Notifications.success('Success', 'Application successfully updated');
this.$state.reload(this.$state.current);
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to update application');

View File

@ -252,7 +252,7 @@ class KubernetesNodeController {
if (this.formValues.Availability === 'Drain') {
await this.drainNode();
}
this.Notifications.success('Node updated successfully');
this.Notifications.success('Success', 'Node updated successfully');
this.$state.reload(this.$state.current);
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to update node');

View File

@ -48,7 +48,7 @@ class KubernetesCreateConfigurationController {
this.formValues.Data = KubernetesConfigurationHelper.parseYaml(this.formValues);
}
await this.KubernetesConfigurationService.create(this.formValues);
this.Notifications.success('Configuration succesfully created');
this.Notifications.success('Success', 'Configuration succesfully created');
this.state.isEditorDirty = false;
this.$state.go('kubernetes.configurations');
} catch (err) {

View File

@ -95,7 +95,7 @@ class KubernetesConfigurationController {
) {
await this.KubernetesConfigurationService.create(this.formValues);
await this.KubernetesConfigurationService.delete(this.configuration);
this.Notifications.success('Configuration succesfully updated');
this.Notifications.success('Success', 'Configuration succesfully updated');
this.$state.go(
'kubernetes.configurations.configuration',
{
@ -106,7 +106,7 @@ class KubernetesConfigurationController {
);
} else {
await this.KubernetesConfigurationService.update(this.formValues, this.configuration);
this.Notifications.success('Configuration succesfully updated');
this.Notifications.success('Success', 'Configuration succesfully updated');
this.$state.reload(this.$state.current);
}
} catch (err) {

View File

@ -227,7 +227,7 @@ class KubernetesConfigureController {
this.assignFormValuesToEndpoint(modifiedEndpoint, storageClasses, ingressClasses);
this.EndpointProvider.setEndpoints(endpoints);
}
this.Notifications.success('Configuration successfully applied');
this.Notifications.success('Success', 'Configuration successfully applied');
this.$state.go('portainer.home');
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to apply configuration');

View File

@ -280,7 +280,7 @@ class KubernetesDeployController {
await this.StackService.kubernetesDeploy(this.endpoint.Id, method, payload);
this.Notifications.success('Manifest successfully deployed');
this.Notifications.success('Success', 'Manifest successfully deployed');
this.state.isEditorDirty = false;
this.$state.go('kubernetes.applications');
} catch (err) {

View File

@ -93,7 +93,7 @@ class KubernetesResourcePoolAccessController {
const newAccesses = _.concat(this.authorizedUsersAndTeams, this.formValues.multiselectOutput);
const accessConfigMap = KubernetesConfigMapHelper.modifiyNamespaceAccesses(angular.copy(this.accessConfigMap), this.pool.Namespace.Name, newAccesses);
await this.KubernetesConfigMapService.updateAccess(accessConfigMap);
this.Notifications.success('Access successfully created');
this.Notifications.success('Success', 'Access successfully created');
this.$state.reload(this.$state.current);
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to create accesses');
@ -113,7 +113,7 @@ class KubernetesResourcePoolAccessController {
const newAccesses = _.without(this.authorizedUsersAndTeams, ...selectedItems);
const accessConfigMap = KubernetesConfigMapHelper.modifiyNamespaceAccesses(angular.copy(this.accessConfigMap), this.pool.Namespace.Name, newAccesses);
await this.KubernetesConfigMapService.updateAccess(accessConfigMap);
this.Notifications.success('Access successfully removed');
this.Notifications.success('Success', 'Access successfully removed');
this.$state.reload(this.$state.current);
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to remove accesses');

View File

@ -84,7 +84,7 @@ class KubernetesVolumeController {
try {
this.volume.PersistentVolumeClaim.Storage = this.state.volumeSize + this.state.volumeSizeUnit.charAt(0);
await this.KubernetesPersistentVolumeClaimService.patch(this.oldVolume.PersistentVolumeClaim, this.volume.PersistentVolumeClaim);
this.Notifications.success('Volume successfully updated');
this.Notifications.success('Success', 'Volume successfully updated');
if (redeploy) {
const promises = _.flatten(
@ -93,7 +93,7 @@ class KubernetesVolumeController {
})
);
await Promise.all(promises);
this.Notifications.success('Applications successfully redeployed');
this.Notifications.success('Success', 'Applications successfully redeployed');
}
this.$state.reload(this.$state.current);

View File

@ -117,7 +117,7 @@ export function AccessControlPanelForm({
updateAccess.mutate(accessControl, {
onSuccess() {
notifySuccess('Access control successfully updated');
notifySuccess('Success', 'Access control successfully updated');
},
});
}

View File

@ -54,7 +54,7 @@ class KubernetesAppGitFormController {
}
this.state.redeployInProgress = true;
await this.StackService.updateKubeGit(this.stack.Id, this.stack.EndpointId, this.namespace, this.formValues);
this.Notifications.success('Pulled and redeployed stack successfully');
this.Notifications.success('Success', 'Pulled and redeployed stack successfully');
await this.$state.reload(this.$state.current);
} catch (err) {
this.Notifications.error('Failure', err, 'Failed redeploying application');
@ -69,7 +69,7 @@ class KubernetesAppGitFormController {
try {
this.state.saveGitSettingsInProgress = true;
await this.StackService.updateKubeStack({ EndpointId: this.stack.EndpointId, Id: this.stack.Id }, null, this.formValues);
this.Notifications.success('Save stack settings successfully');
this.Notifications.success('Success', 'Save stack settings successfully');
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to save application settings');
} finally {

View File

@ -95,7 +95,7 @@ class KubernetesRedeployAppGitFormController {
}
this.state.redeployInProgress = true;
await this.StackService.updateKubeGit(this.stack.Id, this.stack.EndpointId, this.namespace, this.formValues);
this.Notifications.success('Pulled and redeployed stack successfully');
this.Notifications.success('Success', 'Pulled and redeployed stack successfully');
await this.$state.reload();
} catch (err) {
this.Notifications.error('Failure', err, 'Failed redeploying application');
@ -112,7 +112,7 @@ class KubernetesRedeployAppGitFormController {
await this.StackService.updateKubeStack({ EndpointId: this.stack.EndpointId, Id: this.stack.Id }, null, this.formValues);
this.savedFormValues = angular.copy(this.formValues);
this.state.hasUnsavedChanges = false;
this.Notifications.success('Save stack settings successfully');
this.Notifications.success('Success', 'Save stack settings successfully');
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to save application settings');
} finally {

View File

@ -121,7 +121,7 @@ class StackRedeployGitFormController {
this.formValues.Option.Prune,
this.formValues
);
this.Notifications.success('Pulled and redeployed stack successfully');
this.Notifications.success('Success', 'Pulled and redeployed stack successfully');
this.$state.reload();
} catch (err) {
this.Notifications.error('Failure', err, 'Failed redeploying stack');
@ -143,7 +143,7 @@ class StackRedeployGitFormController {
);
this.savedFormValues = angular.copy(this.formValues);
this.state.hasUnsavedChanges = false;
this.Notifications.success('Save stack settings successfully');
this.Notifications.success('Success', 'Save stack settings successfully');
this.stack = stack;
} catch (err) {

View File

@ -7,10 +7,25 @@ toastr.options = {
closeButton: true,
progressBar: true,
tapToDismiss: false,
// custom button, using the feather icon x.svg inside
closeHtml: `<button type="button"><svg
xmlns="http://www.w3.org/2000/svg"
width="18"
height="18"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<line x1="18" y1="6" x2="6" y2="18" />
<line x1="6" y1="6" x2="18" y2="18" />
</svg></button>`,
};
export function notifySuccess(title: string, text?: string) {
toastr.success(sanitize(_.escape(text)), sanitize(title));
export function notifySuccess(title: string, text: string) {
toastr.success(sanitize(_.escape(text)), sanitize(_.escape(title)));
}
export function notifyWarning(title: string, text: string) {

View File

@ -64,6 +64,7 @@ export function AutoEnvCreationSettingsForm({ settings }: Props) {
updateSettings(variables, {
onSuccess() {
notifySuccess(
'Success',
'Successfully updated Automatic Environment Creation settings'
);
},

View File

@ -77,7 +77,7 @@ angular.module('portainer.app').controller('AccountController', [
selectedTokens.forEach((token) => {
UserService.deleteAccessToken($scope.userID, token.id)
.then(() => {
Notifications.success('Token successfully removed');
Notifications.success('Success', 'Token successfully removed');
var index = $scope.tokens.indexOf(token);
$scope.tokens.splice(index, 1);
})

View File

@ -111,7 +111,7 @@ class CreateCustomTemplateViewController {
const userId = userDetails.ID;
await this.ResourceControlService.applyResourceControl(userId, accessControlData, customTemplate.ResourceControl);
this.Notifications.success('Custom template successfully created');
this.Notifications.success('Success', 'Custom template successfully created');
this.state.isEditorDirty = false;
this.$state.go('docker.templates.custom');
} catch (err) {

View File

@ -107,7 +107,7 @@ class CustomTemplatesViewController {
for (let template of templates) {
try {
await this.CustomTemplateService.remove(template.id);
this.Notifications.success('Removed template successfully');
this.Notifications.success('Success', 'Removed template successfully');
_.remove(this.templates, template);
} catch (err) {
this.Notifications.error('Failed removing template', err, 'Unable to remove custom template');
@ -169,7 +169,7 @@ class CustomTemplatesViewController {
const createAction = this.state.selectedTemplate.Type === 1 ? this.StackService.createSwarmStackFromFileContent : this.StackService.createComposeStackFromFileContent;
const { ResourceControl: resourceControl } = await createAction(stackName, file, [], endpointId);
await this.ResourceControlService.applyResourceControl(userId, accessControlData, resourceControl);
this.Notifications.success('Stack successfully deployed');
this.Notifications.success('Success', 'Stack successfully deployed');
this.$state.go('docker.stacks');
} catch (err) {
this.Notifications.error('Deployment error', err, 'Failed to deploy stack');

View File

@ -110,7 +110,7 @@ class EditCustomTemplateViewController {
const userId = userDetails.ID;
await this.ResourceControlService.applyResourceControl(userId, this.formValues.AccessControlData, this.formValues.ResourceControl);
this.Notifications.success('Custom template successfully updated');
this.Notifications.success('Success', 'Custom template successfully updated');
this.state.isEditorDirty = false;
this.$state.go('docker.templates.custom');
} catch (err) {

View File

@ -110,7 +110,7 @@ angular
}
}
Notifications.success('Device(s) successfully imported');
Notifications.success('Success', 'Device(s) successfully imported');
$state.go('edge.devices');
});
};

View File

@ -44,7 +44,7 @@ export default function AddProfileController($scope, $async, $state, $window, Mo
try {
await createProfile(name, method, fileContent);
Notifications.success('Profile successfully created');
Notifications.success('Success', 'Profile successfully created');
$scope.state.isEditorDirty = false;
$state.go('portainer.settings.edgeCompute');
} catch (err) {

View File

@ -44,7 +44,7 @@ export default function EditProfileController($scope, $async, $state, $window, M
try {
await updateProfile($scope.state.profileID, name, fileContent);
Notifications.success('Profile successfully updated');
Notifications.success('Success', 'Profile successfully updated');
$scope.state.isEditorDirty = false;
$state.go('portainer.settings.edgeCompute');
} catch (err) {

View File

@ -36,7 +36,7 @@ class EndpointAccessController {
try {
this.state.actionInProgress = true;
await this.EndpointService.updateEndpoint(this.$transition$.params().id, this.endpoint);
this.Notifications.success('Access successfully updated');
this.Notifications.success('Success', 'Access successfully updated');
this.$state.reload(this.$state.current);
} catch (err) {
this.state.actionInProgress = false;

View File

@ -13,7 +13,7 @@ angular.module('portainer.app').controller('GroupAccessController', [
$scope.state.actionInProgress = true;
GroupService.updateGroup($scope.group, $scope.group.AssociatedEndpoints)
.then(() => {
Notifications.success('Access successfully updated');
Notifications.success('Success', 'Access successfully updated');
$state.reload();
})
.catch((err) => {

View File

@ -17,7 +17,7 @@ angular.module('portainer.app').controller('CreateGroupController', function Cre
$scope.state.actionInProgress = true;
GroupService.createGroup(model, associatedEndpoints)
.then(function success() {
Notifications.success('Group successfully created');
Notifications.success('Success', 'Group successfully created');
$state.go('portainer.groups', {}, { reload: true });
})
.catch(function error(err) {

View File

@ -9,7 +9,7 @@ angular.module('portainer.app').controller('GroupController', function GroupCont
$scope.state.actionInProgress = true;
GroupService.updateGroup(model)
.then(function success() {
Notifications.success('Group successfully updated');
Notifications.success('Success', 'Group successfully updated');
$state.go('portainer.groups', {}, { reload: true });
})
.catch(function error(err) {

View File

@ -123,7 +123,7 @@ angular.module('portainer.app').controller('InitAdminController', [
try {
await waitPortainerRestart();
Notifications.success('The backup has successfully been restored');
Notifications.success('Success', 'The backup has successfully been restored');
$state.go('portainer.auth');
} catch (err) {
handleError(err);

View File

@ -126,7 +126,7 @@ class CreateRegistryController {
try {
this.state.actionInProgress = true;
await this.RegistryService.createGitlabRegistries(this.model, this.state.gitlab.selectedItems);
this.Notifications.success('Registries successfully created');
this.Notifications.success('Success', 'Registries successfully created');
this.$state.go(this.state.originViewReference, { endpointId: this.state.originalEndpointId });
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to create registries');
@ -140,7 +140,7 @@ class CreateRegistryController {
try {
this.state.actionInProgress = true;
await this.RegistryService.createRegistry(this.model);
this.Notifications.success('Registry successfully created');
this.Notifications.success('Success', 'Registry successfully created');
this.$state.go(this.state.originViewReference, { endpointId: this.state.originalEndpointId });
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to create registry');

View File

@ -54,7 +54,7 @@ export default class RegistryController {
registry.Password = this.Password;
await this.RegistryService.updateRegistry(registry);
this.Notifications.success('Registry successfully updated');
this.Notifications.success('Success', 'Registry successfully updated');
this.$state.go('portainer.registries');
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to update registry');

View File

@ -109,7 +109,7 @@ function SettingsAuthenticationController($q, $scope, $state, Notifications, Set
.then(function success() {
$scope.state.failedConnectivityCheck = false;
$scope.state.successfulConnectivityCheck = true;
Notifications.success('Connection to LDAP successful');
Notifications.success('Success', 'Connection to LDAP successful');
})
.catch(function error(err) {
$scope.state.failedConnectivityCheck = true;
@ -136,7 +136,7 @@ function SettingsAuthenticationController($q, $scope, $state, Notifications, Set
return SettingsService.update(settings);
})
.then(function success() {
Notifications.success('Authentication settings updated');
Notifications.success('Success', 'Authentication settings updated');
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to update authentication settings');

View File

@ -12,7 +12,7 @@ export default function SettingsEdgeComputeController($q, $async, $state, Notifi
this.onSubmitEdgeCompute = async function (settings) {
try {
await SettingsService.update(settings);
Notifications.success('Settings updated');
Notifications.success('Success', 'Settings updated');
StateManager.updateEnableEdgeComputeFeatures(settings.EnableEdgeComputeFeatures);
$state.reload();
} catch (err) {
@ -23,7 +23,7 @@ export default function SettingsEdgeComputeController($q, $async, $state, Notifi
this.onSubmitOpenAMT = async function (formValues) {
try {
await configureAMT(formValues);
Notifications.success(`OpenAMT successfully ${formValues.enabled ? 'enabled' : 'disabled'}`);
Notifications.success('Success', `OpenAMT successfully ${formValues.enabled ? 'enabled' : 'disabled'}`);
$state.reload();
} catch (err) {
Notifications.error('Failure', err, 'Failed applying changes');
@ -33,7 +33,7 @@ export default function SettingsEdgeComputeController($q, $async, $state, Notifi
this.onSubmitFDO = async function (formValues) {
try {
await configureFDO(formValues);
Notifications.success(`FDO successfully ${formValues.enabled ? 'enabled' : 'disabled'}`);
Notifications.success('Success', `FDO successfully ${formValues.enabled ? 'enabled' : 'disabled'}`);
$state.reload();
} catch (err) {
Notifications.error('Failure', err, 'Failed applying changes');

View File

@ -112,7 +112,7 @@ angular.module('portainer.app').controller('SettingsController', [
.then(function success(data) {
const downloadData = new Blob([data.file], { type: 'application/gzip' });
FileSaver.saveAs(downloadData, data.name);
Notifications.success('Backup successfully downloaded');
Notifications.success('Success', 'Backup successfully downloaded');
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to download backup');
@ -138,7 +138,7 @@ angular.module('portainer.app').controller('SettingsController', [
function updateSettings(settings) {
SettingsService.update(settings)
.then(function success() {
Notifications.success('Settings updated');
Notifications.success('Success', 'Settings updated');
StateManager.updateLogo(settings.LogoURL);
StateManager.updateSnapshotInterval(settings.SnapshotInterval);
StateManager.updateEnableTelemetry(settings.EnableTelemetry);

View File

@ -264,7 +264,7 @@ angular
return ResourceControlService.applyResourceControl(userId, accessControlData, resourceControl);
})
.then(function success() {
Notifications.success('Stack successfully deployed');
Notifications.success('Success', 'Stack successfully deployed');
$scope.state.isEditorDirty = false;
$state.go('docker.stacks');
})

View File

@ -115,7 +115,7 @@ angular.module('portainer.app').controller('StackController', [
return StackService.duplicateStack(name, $scope.stackFileContent, env, targetEndpointId, stack.Type).then(onDuplicationSuccess).catch(notifyOnError);
function onDuplicationSuccess() {
Notifications.success('Stack successfully duplicated');
Notifications.success('Success', 'Stack successfully duplicated');
$state.go('docker.stacks', {}, { reload: true });
// sets back the original endpointID as global for interceptors
EndpointProvider.setEndpointID(stack.EndpointId);
@ -266,7 +266,7 @@ angular.module('portainer.app').controller('StackController', [
$scope.state.actionInProgress = true;
StackService.updateStack(stack, stackFile, env, prune)
.then(function success() {
Notifications.success('Stack successfully deployed');
Notifications.success('Success', 'Stack successfully deployed');
$scope.state.isEditorDirty = false;
$state.reload();
})

View File

@ -92,7 +92,7 @@ angular.module('portainer.app').controller('TeamController', [
}
$scope.teamMembers = $scope.teamMembers.concat(users);
$scope.users = [];
Notifications.success('All users successfully added');
Notifications.success('Success', 'All users successfully added');
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to update team members');
@ -123,7 +123,7 @@ angular.module('portainer.app').controller('TeamController', [
$scope.users = $scope.users.concat($scope.teamMembers);
$scope.teamMembers = [];
$scope.leaderCount = 0;
Notifications.success('All users successfully removed');
Notifications.success('Success', 'All users successfully removed');
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to update team members');

View File

@ -117,7 +117,7 @@ angular.module('portainer.app').controller('TemplatesController', [
return ResourceControlService.applyResourceControl(userId, accessControlData, resourceControl, generatedVolumeIds);
})
.then(function success() {
Notifications.success('Container successfully created');
Notifications.success('Success', 'Container successfully created');
$state.go('docker.containers', {}, { reload: true });
})
.catch(function error(err) {
@ -151,7 +151,7 @@ angular.module('portainer.app').controller('TemplatesController', [
return ResourceControlService.applyResourceControl(userId, accessControlData, resourceControl);
})
.then(function success() {
Notifications.success('Stack successfully deployed');
Notifications.success('Success', 'Stack successfully deployed');
$state.go('docker.stacks');
})
.catch(function error(err) {
@ -190,7 +190,7 @@ angular.module('portainer.app').controller('TemplatesController', [
return ResourceControlService.applyResourceControl(userId, accessControlData, resourceControl);
})
.then(function success() {
Notifications.success('Stack successfully deployed');
Notifications.success('Success', 'Stack successfully deployed');
$state.go('docker.stacks');
})
.catch(function error(err) {

View File

@ -61,7 +61,7 @@ angular.module('portainer.app').controller('UserController', [
}
UserService.updateUser($scope.user.Id, { role, username })
.then(function success() {
Notifications.success('User successfully updated');
Notifications.success('Success', 'User successfully updated');
$state.reload();
})
.catch(function error(err) {
@ -77,7 +77,7 @@ angular.module('portainer.app').controller('UserController', [
}
UserService.updateUser($scope.user.Id, { password: $scope.formValues.newPassword })
.then(function success() {
Notifications.success('Password successfully updated');
Notifications.success('Success', 'Password successfully updated');
if (isCurrentUser) {
$state.go('portainer.logout');

View File

@ -90,7 +90,7 @@ function useRemoveMutation(environmentId: EnvironmentId) {
async function handleRemove(groupIds: string[]) {
deleteMutation.mutate(groupIds, {
onSuccess: () => {
notifySuccess('Container groups successfully removed');
notifySuccess('Success', 'Container groups successfully removed');
},
});
}