mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
JS: Add icon to js notifications
This commit is contained in:
parent
63464f03be
commit
8b7a3f05af
@ -1104,12 +1104,31 @@
|
|||||||
* Create a notification. Can be improved.
|
* Create a notification. Can be improved.
|
||||||
*/
|
*/
|
||||||
createNotice: function (severity, message, persist) {
|
createNotice: function (severity, message, persist) {
|
||||||
var c = severity;
|
var c = severity,
|
||||||
|
icon;
|
||||||
if (persist) {
|
if (persist) {
|
||||||
c += ' persist';
|
c += ' persist';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch (severity) {
|
||||||
|
case 'success':
|
||||||
|
icon = 'check-circle';
|
||||||
|
break;
|
||||||
|
case 'error':
|
||||||
|
icon = 'times';
|
||||||
|
break;
|
||||||
|
case 'warning':
|
||||||
|
icon = 'exclamation-triangle';
|
||||||
|
break;
|
||||||
|
case 'info':
|
||||||
|
icon = 'info-circle';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
var $notice = $(
|
var $notice = $(
|
||||||
'<li class="' + c + '">' + this.icinga.utils.escape(message) + '</li>'
|
'<li class="' + c + '">' +
|
||||||
|
'<i class="icon fa fa-' + icon + '"></i>' +
|
||||||
|
this.icinga.utils.escape(message) + '</li>'
|
||||||
).appendTo($('#notifications'));
|
).appendTo($('#notifications'));
|
||||||
|
|
||||||
if (!persist) {
|
if (!persist) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user