Add support for server notices

This commit is contained in:
kaso17
2017-02-27 12:19:36 +01:00
parent 799d435f2a
commit 1f97d543df
3 changed files with 41 additions and 6 deletions

View File

@@ -63,6 +63,11 @@ function loadJackettSettings() {
$("#logoutBtn").show();
}
$.each(data.config.notices, function (index, value) {
console.log(value);
doNotify(value, "danger", "glyphicon glyphicon-alert", false);
})
reloadIndexers();
});
}
@@ -570,12 +575,21 @@ function resolveUrl(url) {
return url;
}
function doNotify(message, type, icon) {
function doNotify(message, type, icon, autoHide) {
if (typeof autoHide === "undefined" || autoHide === null)
autoHide = true;
var delay = 5000;
if (!autoHide)
delay = -1;
$.notify({
message: message,
icon: icon
}, {
element: 'body',
autoHide: autoHide,
delay: delay,
type: type,
allow_dismiss: true,
z_index: 9000,