diff --git a/webadmin/src/js/client.js b/webadmin/src/js/client.js index 01c1f1b76..7b43ba5f1 100644 --- a/webadmin/src/js/client.js +++ b/webadmin/src/js/client.js @@ -112,15 +112,20 @@ angular.module('Application').service('Client', ['$http', 'md5', 'Notification', Client.notify('title', 'message', true, actionScope); */ - Client.prototype.notify = function (title, message, delay, actionScope) { - var options = { title: title, message: message, delay: delay}; + Client.prototype.notify = function (title, message, persitent, type, actionScope) { + var options = { title: title, message: message}; + + if (persitent) options.delay = 'never'; // any non Number means never timeout if (actionScope) { if (typeof actionScope.action !== 'string') throw('an actionScope has to have an action url'); options.scope = actionScope; } - Notification.error(options); + if (type === 'error') Notification.error(options); + else if (type === 'success') Notification.success(options); + else if (type === 'info') Notification.info(options); + else throw('Invalid notification type "' + type + '"'); }; Client.prototype.setReady = function () { diff --git a/webadmin/src/js/main.js b/webadmin/src/js/main.js index 01831b554..5da2313e1 100644 --- a/webadmin/src/js/main.js +++ b/webadmin/src/js/main.js @@ -114,7 +114,7 @@ angular.module('Application').controller('MainController', ['$scope', '$route', if (result.provider === 'route53' && (!result.accessKeyId || !result.secretAccessKey)) { var actionScope = $scope.$new(true); actionScope.action = '/#/certs'; - Client.notify('Missing AWS credentials', 'Please provide AWS credentials, click here to add them.', true, actionScope); + Client.notify('Missing AWS credentials', 'Please provide AWS credentials, click here to add them.', true, 'error', actionScope); } }); }