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
|
@ -11,6 +11,7 @@
|
|||
|
||||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||
<a href="#" data-role="button" class="ui-btn-active">${TabGeneral}</a>
|
||||
<a href="notificationsettings.html" data-role="button">${TabNotifications}</a>
|
||||
<a href="advancedpaths.html" data-role="button">${TabPaths}</a>
|
||||
<a href="advancedserversettings.html" data-role="button">${TabServer}</a>
|
||||
<a href="encodingsettings.html" data-role="button">${TabTranscoding}</a>
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||
<a href="advanced.html" data-role="button">${TabGeneral}</a>
|
||||
<a href="notificationsettings.html" data-role="button">${TabNotifications}</a>
|
||||
<a href="#" data-role="button" class="ui-btn-active">${TabPaths}</a>
|
||||
<a href="advancedserversettings.html" data-role="button">${TabServer}</a>
|
||||
<a href="encodingsettings.html" data-role="button">${TabTranscoding}</a>
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||
<a href="advanced.html" data-role="button">${TabGeneral}</a>
|
||||
<a href="notificationsettings.html" data-role="button">${TabNotifications}</a>
|
||||
<a href="advancedpaths.html" data-role="button">${TabPaths}</a>
|
||||
<a href="#" data-role="button" class="ui-btn-active">${TabServer}</a>
|
||||
<a href="encodingsettings.html" data-role="button">${TabTranscoding}</a>
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||
<a href="advanced.html" data-role="button">${TabGeneral}</a>
|
||||
<a href="notificationsettings.html" data-role="button">${TabNotifications}</a>
|
||||
<a href="advancedpaths.html" data-role="button">${TabPaths}</a>
|
||||
<a href="advancedserversettings.html" data-role="button">${TabServer}</a>
|
||||
<a href="#" data-role="button" class="ui-btn-active">${TabTranscoding}</a>
|
||||
|
|
62
dashboard-ui/notificationsettings.html
Normal file
62
dashboard-ui/notificationsettings.html
Normal file
|
@ -0,0 +1,62 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>${TitleAdvanced}</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="notificationSettingsPage" data-role="page" class="page type-interior advancedConfigurationPage">
|
||||
|
||||
<div data-role="content">
|
||||
<div class="content-primary">
|
||||
|
||||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||
<a href="advanced.html" data-role="button">${TabGeneral}</a>
|
||||
<a href="#" data-role="button" class="ui-btn-active">${TabNotifications}</a>
|
||||
<a href="advancedpaths.html" data-role="button">${TabPaths}</a>
|
||||
<a href="advancedserversettings.html" data-role="button">${TabServer}</a>
|
||||
<a href="encodingsettings.html" data-role="button">${TabTranscoding}</a>
|
||||
</div>
|
||||
<form class="notificationSettingsForm">
|
||||
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<label>${HeaderEnableNotificationForEvents}</label>
|
||||
<div data-role="controlgroup">
|
||||
<input type="checkbox" data-mini="true" id="chkNewLibraryContent" />
|
||||
<label for="chkNewLibraryContent">${OptionNotifyOnNewLibraryContent}</label>
|
||||
|
||||
<input type="checkbox" data-mini="true" id="chkFailedTasks" />
|
||||
<label for="chkFailedTasks">${OptionNotifyOnFailedTasks}</label>
|
||||
|
||||
<input type="checkbox" data-mini="true" id="chkUpdates" />
|
||||
<label for="chkUpdates">${OptionNotifyOnUpdates}</label>
|
||||
|
||||
<input type="checkbox" data-mini="true" id="chkPlayback" />
|
||||
<label for="chkPlayback">${OptionNotifyOnPlayback}</label>
|
||||
|
||||
<div class="fieldDescription">${SendNotificationHelp}</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<br />
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<button type="submit" data-theme="b" data-icon="check" data-mini="true">
|
||||
${ButtonSave}
|
||||
</button>
|
||||
<button type="button" onclick="Dashboard.navigate('dashboard.html');" data-icon="delete" data-mini="true">
|
||||
${ButtonCancel}
|
||||
</button>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('.notificationSettingsForm').off('submit', NotificationSettingsPage.onSubmit).on('submit', NotificationSettingsPage.onSubmit);
|
||||
</script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
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