mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
add new notification options
This commit is contained in:
parent
39eb56793a
commit
7751d4f2a0
6 changed files with 117 additions and 1 deletions
50
dashboard-ui/scripts/notificationsettings.js
Normal file
50
dashboard-ui/scripts/notificationsettings.js
Normal file
|
@ -0,0 +1,50 @@
|
|||
(function () {
|
||||
|
||||
function reload(page) {
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
|
||||
var notificationOptions = config.NotificationOptions;
|
||||
|
||||
$('#chkNewLibraryContent', page).checked(notificationOptions.SendOnNewLibraryContent).checkboxradio('refresh');
|
||||
$('#chkFailedTasks', page).checked(notificationOptions.SendOnFailedTasks).checkboxradio('refresh');
|
||||
$('#chkUpdates', page).checked(notificationOptions.SendOnUpdates).checkboxradio('refresh');
|
||||
$('#chkPlayback', page).checked(notificationOptions.SendOnPlayback).checkboxradio('refresh');
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function save(page) {
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
|
||||
var notificationOptions = config.NotificationOptions;
|
||||
|
||||
notificationOptions.SendOnNewLibraryContent = $('#chkNewLibraryContent', page).checked();
|
||||
notificationOptions.SendOnFailedTasks = $('#chkFailedTasks', page).checked();
|
||||
notificationOptions.SendOnUpdates = $('#chkUpdates', page).checked();
|
||||
notificationOptions.SendOnPlayback = $('#chkPlayback', page).checked();
|
||||
|
||||
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$(document).on('pageshow', "#notificationSettingsPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
reload(page);
|
||||
});
|
||||
|
||||
window.NotificationSettingsPage = {
|
||||
|
||||
onSubmit: function () {
|
||||
|
||||
var page = $(this).parents('.page');
|
||||
save(page);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery, window);
|
Loading…
Add table
Add a link
Reference in a new issue