mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-06 21:21:15 -07:00
Improve test browser notifications
This commit is contained in:
parent
42b17ca495
commit
48203e64a9
4 changed files with 14 additions and 14 deletions
|
@ -296,9 +296,7 @@ ${next.modalIncludes()}
|
||||||
<script src="${http_root}js/ipaddr.min.js"></script>
|
<script src="${http_root}js/ipaddr.min.js"></script>
|
||||||
<script src="${http_root}js/script.js${cache_param}"></script>
|
<script src="${http_root}js/script.js${cache_param}"></script>
|
||||||
<script src="${http_root}js/jquery.tripleclick.min.js"></script>
|
<script src="${http_root}js/jquery.tripleclick.min.js"></script>
|
||||||
% if _session['user_group'] == 'admin' and BROWSER_NOTIFIERS:
|
|
||||||
<script src="${http_root}js/ajaxNotifications.js"></script>
|
<script src="${http_root}js/ajaxNotifications.js"></script>
|
||||||
% endif
|
|
||||||
<script>
|
<script>
|
||||||
% if _session['user_group'] == 'admin':
|
% if _session['user_group'] == 'admin':
|
||||||
$('body').on('click', '#updateDismiss', function() {
|
$('body').on('click', '#updateDismiss', function() {
|
||||||
|
@ -423,6 +421,10 @@ ${next.modalIncludes()}
|
||||||
$(document).on('hidden.bs.modal', '.modal', function () {
|
$(document).on('hidden.bs.modal', '.modal', function () {
|
||||||
$('.modal:visible').length && $(document.body).addClass('modal-open');
|
$('.modal:visible').length && $(document.body).addClass('modal-open');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
% if _session['user_group'] == 'admin' and BROWSER_NOTIFIERS:
|
||||||
|
check_notifications();
|
||||||
|
% endif
|
||||||
});
|
});
|
||||||
|
|
||||||
% if _session['user_group'] != 'admin':
|
% if _session['user_group'] != 'admin':
|
||||||
|
|
|
@ -36,7 +36,3 @@ function check_notifications() {
|
||||||
check_notifications();
|
check_notifications();
|
||||||
}, 5000);
|
}, 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function () {
|
|
||||||
check_notifications();
|
|
||||||
});
|
|
|
@ -853,10 +853,7 @@
|
||||||
PNotify.prototype.options.hide = true;
|
PNotify.prototype.options.hide = true;
|
||||||
PNotify.prototype.options.delay = $('#browser_auto_hide_delay').val() * 1000;
|
PNotify.prototype.options.delay = $('#browser_auto_hide_delay').val() * 1000;
|
||||||
}
|
}
|
||||||
var notification = new PNotify({
|
displayPNotify($('#test_subject').val(), $('#test_body').val());
|
||||||
title: $('#test_subject').val(),
|
|
||||||
text: $('#test_body').val()
|
|
||||||
});
|
|
||||||
showMsg('<i class="fa fa-check"></i> Notification sent.', false, true, 5000);
|
showMsg('<i class="fa fa-check"></i> Notification sent.', false, true, 5000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1123,17 +1123,22 @@ class BROWSER(Notifier):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def _return_config_options(self):
|
def _return_config_options(self):
|
||||||
config_option = [{'label': 'Allow Notifications',
|
config_option = [{'label': 'Note',
|
||||||
|
'description': 'You may need to refresh the page after saving for changes to take effect.',
|
||||||
|
'input_type': 'help'
|
||||||
|
},
|
||||||
|
{'label': 'Allow Notifications',
|
||||||
'value': 'Allow Notifications',
|
'value': 'Allow Notifications',
|
||||||
'name': 'browser_allow_browser',
|
'name': 'browser_allow_browser',
|
||||||
'description': 'Click to allow browser notifications. You must click this button for each browser.',
|
'description': 'Click to allow browser notifications. '
|
||||||
|
'You must click this button for each browser.',
|
||||||
'input_type': 'button'
|
'input_type': 'button'
|
||||||
},
|
},
|
||||||
{'label': 'Auto Hide Delay',
|
{'label': 'Auto Hide Delay',
|
||||||
'value': self.config['auto_hide_delay'],
|
'value': self.config['auto_hide_delay'],
|
||||||
'name': 'browser_auto_hide_delay',
|
'name': 'browser_auto_hide_delay',
|
||||||
'description': 'Set the number of seconds for the notification to remain visible. \
|
'description': 'Set the number of seconds for the notification to remain visible. '
|
||||||
Set 0 to disable auto hiding. (Note: Some browsers have a maximum time limit.)',
|
'Set 0 to disable auto hiding. (Note: Some browsers have a maximum time limit.)',
|
||||||
'input_type': 'number'
|
'input_type': 'number'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue