diff --git a/dashboard-ui/advanced.html b/dashboard-ui/advanced.html index e2a14873fb..944cd40f0f 100644 --- a/dashboard-ui/advanced.html +++ b/dashboard-ui/advanced.html @@ -11,6 +11,7 @@
${TabGeneral} + ${TabNotifications} ${TabPaths} ${TabServer} ${TabTranscoding} @@ -22,7 +23,7 @@
  • diff --git a/dashboard-ui/advancedpaths.html b/dashboard-ui/advancedpaths.html index 387d4e361a..8a2cada310 100644 --- a/dashboard-ui/advancedpaths.html +++ b/dashboard-ui/advancedpaths.html @@ -11,6 +11,7 @@
    ${TabGeneral} + ${TabNotifications} ${TabPaths} ${TabServer} ${TabTranscoding} diff --git a/dashboard-ui/advancedserversettings.html b/dashboard-ui/advancedserversettings.html index 2791240a81..58f825ab5f 100644 --- a/dashboard-ui/advancedserversettings.html +++ b/dashboard-ui/advancedserversettings.html @@ -11,6 +11,7 @@
    ${TabGeneral} + ${TabNotifications} ${TabPaths} ${TabServer} ${TabTranscoding} diff --git a/dashboard-ui/encodingsettings.html b/dashboard-ui/encodingsettings.html index 6527f4f0f7..4f412d7d7b 100644 --- a/dashboard-ui/encodingsettings.html +++ b/dashboard-ui/encodingsettings.html @@ -11,6 +11,7 @@
    ${TabGeneral} + ${TabNotifications} ${TabPaths} ${TabServer} ${TabTranscoding} diff --git a/dashboard-ui/notificationsettings.html b/dashboard-ui/notificationsettings.html new file mode 100644 index 0000000000..d382775e92 --- /dev/null +++ b/dashboard-ui/notificationsettings.html @@ -0,0 +1,62 @@ + + + + ${TitleAdvanced} + + +
    + +
    +
    + + +
    + +
      +
    • + +
      + + + + + + + + + + + + +
      ${SendNotificationHelp}
      +
      +
    • +
    +
    +
      +
    • + + +
    • + +
    +
    +
    +
    + + +
    + + diff --git a/dashboard-ui/scripts/notificationsettings.js b/dashboard-ui/scripts/notificationsettings.js new file mode 100644 index 0000000000..559620c27f --- /dev/null +++ b/dashboard-ui/scripts/notificationsettings.js @@ -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); \ No newline at end of file