mirror of
https://github.com/unraid/webgui.git
synced 2026-01-15 14:09:54 -06:00
295 lines
15 KiB
Plaintext
295 lines
15 KiB
Plaintext
Menu="UserPreferences"
|
|
Type="xmenu"
|
|
Title="Notification Settings"
|
|
Icon="icon-notifications"
|
|
Tag="phone-square"
|
|
---
|
|
<?PHP
|
|
/* Copyright 2005-2020, Lime Technology
|
|
* Copyright 2012-2020, Bergware International.
|
|
* Copyright 2012, Andrew Hamer-Adams, http://www.pixeleyes.co.nz.
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License version 2,
|
|
* as published by the Free Software Foundation.
|
|
*
|
|
* The above copyright notice and this permission notice shall be included in
|
|
* all copies or substantial portions of the Software.
|
|
*/
|
|
?>
|
|
<?
|
|
$events = explode('|', $notify['events']);
|
|
$disabled = $notify['system'] ? '' : 'disabled';
|
|
?>
|
|
<script>
|
|
function prepareNotify(form) {
|
|
form.entity.value = form.normal1.checked | form.warning1.checked | form.alert1.checked;
|
|
form.normal.value = form.normal1.checked*1 + form.normal2.checked*2 + form.normal3.checked*4;
|
|
form.warning.value = form.warning1.checked*1 + form.warning2.checked*2 + form.warning3.checked*4;
|
|
form.alert.value = form.alert1.checked*1 + form.alert2.checked*2 + form.alert3.checked*4;
|
|
form.unraid.value = form.unraid1.checked*1 + form.unraid2.checked*2 + form.unraid3.checked*4;
|
|
form.plugin.value = form.plugin1.checked*1 + form.plugin2.checked*2 + form.plugin3.checked*4;
|
|
form.docker_notify.value = form.docker_notify1.checked*1 + form.docker_notify2.checked*2 + form.docker_notify3.checked*4;
|
|
form.report.value = form.report1.checked*1 + form.report2.checked*2 + form.report3.checked*4;
|
|
form.normal1.disabled = true;
|
|
form.normal2.disabled = true;
|
|
form.normal3.disabled = true;
|
|
form.warning1.disabled = true;
|
|
form.warning2.disabled = true;
|
|
form.warning3.disabled = true;
|
|
form.alert1.disabled = true;
|
|
form.alert2.disabled = true;
|
|
form.alert3.disabled = true;
|
|
form.unraid1.disabled = true;
|
|
form.unraid2.disabled = true;
|
|
form.unraid3.disabled = true;
|
|
form.plugin1.disabled = true;
|
|
form.plugin2.disabled = true;
|
|
form.plugin3.disabled = true;
|
|
form.docker_notify1.disabled = true;
|
|
form.docker_notify2.disabled = true;
|
|
form.docker_notify3.disabled = true;
|
|
form.report1.disabled = true;
|
|
form.report2.disabled = true;
|
|
form.report3.disabled = true;
|
|
}
|
|
function prepareSystem(index) {
|
|
if (index==0) $('.checkbox').attr('disabled','disabled'); else $('.checkbox').removeAttr('disabled');
|
|
}
|
|
function prepareTitle() {
|
|
var title = '_(Available notifications)_:';
|
|
$('#unraidTitle,#pluginTitle,#dockerTitle,#reportTitle').html(' ');
|
|
if ($('.unraid').is(':visible')) { $('#unraidTitle').html(title); return; }
|
|
if ($('.plugin').is(':visible')) { $('#pluginTitle').html(title); return; }
|
|
if ($('.docker').is(':visible')) { $('#dockerTitle').html(title); return; }
|
|
if ($('.report').is(':visible')) { $('#reportTitle').html(title); return; }
|
|
}
|
|
function prepareUnraid(value) {
|
|
if (value=='') $('.unraid').hide(); else $('.unraid').show();
|
|
prepareTitle();
|
|
}
|
|
function preparePlugin(value) {
|
|
if (value=='') $('.plugin').hide(); else $('.plugin').show();
|
|
prepareTitle();
|
|
}
|
|
function prepareDocker(value) {
|
|
if (value=='') $('.docker').hide(); else $('.docker').show();
|
|
prepareTitle();
|
|
}
|
|
function prepareReport(value) {
|
|
if (value=='') $('.report').hide(); else $('.report').show();
|
|
prepareTitle();
|
|
}
|
|
$(function(){
|
|
prepareUnraid(document.notify_settings.unraidos.value);
|
|
preparePlugin(document.notify_settings.version.value);
|
|
prepareDocker(document.notify_settings.docker_update.value);
|
|
prepareReport(document.notify_settings.status.value);
|
|
});
|
|
</script>
|
|
<form markdown="1" name="notify_settings" method="POST" action="/update.php" target="progressFrame" onsubmit="prepareNotify(this)">
|
|
<input type="hidden" name="#file" value="dynamix/dynamix.cfg">
|
|
<input type="hidden" name="#section" value="notify">
|
|
<input type="hidden" name="#command" value="/webGui/scripts/notify">
|
|
<input type="hidden" name="#arg[1]" value="cron-init">
|
|
<input type="hidden" name="entity">
|
|
<input type="hidden" name="normal">
|
|
<input type="hidden" name="warning">
|
|
<input type="hidden" name="alert">
|
|
<input type="hidden" name="unraid">
|
|
<input type="hidden" name="plugin">
|
|
<input type="hidden" name="docker_notify">
|
|
<input type="hidden" name="report">
|
|
_(Notifications display)_:
|
|
: <select name="display">
|
|
<?=mk_option($notify['display'], "0", _("Detailed"))?>
|
|
<?=mk_option($notify['display'], "1", _("Summarized"))?>
|
|
</select>
|
|
|
|
:help176
|
|
> In *Detailed* view all notifications will be displayed on screen as soon as they arrive.<br>
|
|
> Notifications can be acknowledged individually or all in once.
|
|
>
|
|
> In *Summarized* view notifications will be counted only and the number of unread notifications is shown in the menu header per category.<br>
|
|
> Click on the counters to either acknowledge or view the unread notifications.
|
|
:end
|
|
|
|
_(Date format)_:
|
|
: <select name="date">
|
|
<?=mk_option($notify['date'], "d-m-Y", _("DD-MM-YYYY"))?>
|
|
<?=mk_option($notify['date'], "m-d-Y", _("MM-DD-YYYY"))?>
|
|
<?=mk_option($notify['date'], "Y-m-d", _("YYYY-MM-DD"))?>
|
|
</select>
|
|
|
|
:help177
|
|
> Select the desired date format which is used in the notifications archive. Recommended is YYYY-MM-DD, which makes the date/time column sortable in a sensible way.
|
|
:end
|
|
|
|
_(Time format)_:
|
|
: <select name="time">
|
|
<?=mk_option($notify['time'], "h:i A", _("12 hours"))?>
|
|
<?=mk_option($notify['time'], "H:i", _("24 hours"))?>
|
|
</select>
|
|
|
|
:help178
|
|
> Select the desired time format which is used in the notifications archive. Recommended is 24 hours, which makes the date/time column sortable in a sensible way.
|
|
:end
|
|
|
|
_(Display position)_:
|
|
: <select name="position">
|
|
<?=mk_option($notify['position'], "top-left", _("top-left"))?>
|
|
<?=mk_option($notify['position'], "top-right", _("top-right"))?>
|
|
<?=mk_option($notify['position'], "bottom-left", _("bottom-left"))?>
|
|
<?=mk_option($notify['position'], "bottom-right", _("bottom-right"))?>
|
|
<?=mk_option($notify['position'], "center", _("center"))?>
|
|
</select>
|
|
|
|
:help179
|
|
> Choose the position of where notifications appear on screen. Multiple notifications are stacked, bottom-to-top or top-to-bottom depending on the selected placement.
|
|
:end
|
|
|
|
_(Store notifications to flash)_:
|
|
: <select name="path">
|
|
<?=mk_option($notify['path'], "/tmp/notifications", _("No"))?>
|
|
<?=mk_option($notify['path'], "/boot/config/plugins/dynamix/notifications", _("Yes"))?>
|
|
</select>
|
|
|
|
:help180
|
|
> By default notifications are stored on RAM disk, which will get lost upon system reboot.
|
|
> Notifications may be stored permanently on the flash drive under folder '/boot/config/plugins/dynamix' instead.
|
|
:end
|
|
|
|
_(System notifications)_:
|
|
: <select name="system" onchange="prepareSystem(this.selectedIndex)">
|
|
<?=mk_option($notify['system'], "", _("Disabled"))?>
|
|
<?=mk_option($notify['system'], "*/1 * * * *", _("Enabled"))?>
|
|
</select>
|
|
|
|
:help181
|
|
> By default the notifications system is disabled. Enable it here to start receiving notifications.
|
|
> The following sections give more options about which and what type of notifications will be sent.
|
|
:end
|
|
|
|
_(Unraid OS update notification)_:
|
|
: <select name="unraidos" onchange="prepareUnraid(this.value)">
|
|
<?=mk_option($notify['unraidos'], "", _("Never check"))?>
|
|
<?=mk_option($notify['unraidos'], "11 */6 * * *", _("Check four times a day"))?>
|
|
<?=mk_option($notify['unraidos'], "11 0,12 * * *", _("Check twice a day"))?>
|
|
<?=mk_option($notify['unraidos'], "11 0 * * *", _("Check once a day"))?>
|
|
<?=mk_option($notify['unraidos'], "11 0 * * 1", _("Check once a week"))?>
|
|
<?=mk_option($notify['unraidos'], "11 0 1 * *", _("Check once a month"))?>
|
|
</select>
|
|
|
|
:help182
|
|
> Start a periodic verification and notify the user when a new version of the Unraid OS system is detected.
|
|
> Use the checkboxes below to select how notifications need to be given; by browser, by email and/or by custom agent.
|
|
:end
|
|
|
|
_(Plugins update notification)_:
|
|
: <select name="version" onchange="preparePlugin(this.value)">
|
|
<?=mk_option($notify['version'], "", _("Never check"))?>
|
|
<?=mk_option($notify['version'], "10 */6 * * *", _("Check four times a day"))?>
|
|
<?=mk_option($notify['version'], "10 0,12 * * *", _("Check twice a day"))?>
|
|
<?=mk_option($notify['version'], "10 0 * * *", _("Check once a day"))?>
|
|
<?=mk_option($notify['version'], "10 0 * * 1", _("Check once a week"))?>
|
|
<?=mk_option($notify['version'], "10 0 1 * *", _("Check once a month"))?>
|
|
</select>
|
|
|
|
:help183
|
|
> Start a periodic verification and notify the user when a new version of one or more of the installed plugins is detected.
|
|
> Use the checkboxes below to select how notifications need to be given; by browser, by email and/or by custom agent.
|
|
:end
|
|
|
|
_(Docker update notification)_:
|
|
: <select name="docker_update" onchange="prepareDocker(this.value)">
|
|
<?=mk_option($notify['docker_update'], "", _("Never check"))?>
|
|
<?=mk_option($notify['docker_update'], "10 */6 * * *", _("Check four times a day"))?>
|
|
<?=mk_option($notify['docker_update'], "10 0,12 * * *", _("Check twice a day"))?>
|
|
<?=mk_option($notify['docker_update'], "10 0 * * *", _("Check once a day"))?>
|
|
<?=mk_option($notify['docker_update'], "10 0 * * 1", _("Check once a week"))?>
|
|
<?=mk_option($notify['docker_update'], "10 0 1 * *", _("Check once a month"))?>
|
|
</select>
|
|
|
|
:help184
|
|
> Start a periodic verification and notify the user when a new version of one or more of the installed dockers is detected.
|
|
> Use the checkboxes below to select how notifications need to be given; by browser, by email and/or by custom agent.
|
|
:end
|
|
|
|
_(Array status notification)_:
|
|
: <select name="status" onchange="prepareReport(this.value)">
|
|
<?=mk_option($notify['status'], "", _("Never send"))?>
|
|
<?=mk_option($notify['status'], "20 * * * *", _("Send every hour"))?>
|
|
<?=mk_option($notify['status'], "20 */2 * * *", _("Send every two hours"))?>
|
|
<?=mk_option($notify['status'], "20 */6 * * *", _("Send four times a day"))?>
|
|
<?=mk_option($notify['status'], "20 */8 * * *", _("Send three times a day"))?>
|
|
<?=mk_option($notify['status'], "20 0,12 * * *", _("Send twice a day"))?>
|
|
<?=mk_option($notify['status'], "20 0 * * *", _("Send once a day"))?>
|
|
<?=mk_option($notify['status'], "20 0 * * 1", _("Send once a week"))?>
|
|
<?=mk_option($notify['status'], "20 0 1 * *", _("Send once a month"))?>
|
|
</select>
|
|
|
|
:help185
|
|
> Start a periodic array health check (preventive maintenance) and notify the user the result of this check.
|
|
:end
|
|
|
|
<span id="unraidTitle" class="unraid" style="display:none"> </span>
|
|
: <span class="unraid" style="display:none"><span style="display:inline-block;width:130px;font-style:italic">_(Unraid OS update)_</span>
|
|
<input type="checkbox" name="unraid1"<?=($notify['unraid'] & 1)==1 ? ' checked' : ''?>>_(Browser)_
|
|
<input type="checkbox" name="unraid2"<?=($notify['unraid'] & 2)==2 ? ' checked' : ''?>>_(Email)_
|
|
<input type="checkbox" name="unraid3"<?=($notify['unraid'] & 4)==4 ? ' checked' : ''?>>_(Agents)_ </span>
|
|
|
|
<span id="pluginTitle" class="plugin" style="display:none"> </span>
|
|
: <span class="plugin" style="display:none"><span style="display:inline-block;width:130px;font-style:italic">_(Plugins update)_</span>
|
|
<input type="checkbox" name="plugin1"<?=($notify['plugin'] & 1)==1 ? ' checked' : ''?>>_(Browser)_
|
|
<input type="checkbox" name="plugin2"<?=($notify['plugin'] & 2)==2 ? ' checked' : ''?>>_(Email)_
|
|
<input type="checkbox" name="plugin3"<?=($notify['plugin'] & 4)==4 ? ' checked' : ''?>>_(Agents)_ </span>
|
|
|
|
<span id="dockerTitle" class="docker" style="display:none"> </span>
|
|
: <span class="docker" style="display:none"><span style="display:inline-block;width:130px;font-style:italic">_(Docker update)_</span>
|
|
<input type="checkbox" name="docker_notify1"<?=($notify['docker_notify'] & 1)==1 ? ' checked' : ''?>>_(Browser)_
|
|
<input type="checkbox" name="docker_notify2"<?=($notify['docker_notify'] & 2)==2 ? ' checked' : ''?>>_(Email)_
|
|
<input type="checkbox" name="docker_notify3"<?=($notify['docker_notify'] & 4)==4 ? ' checked' : ''?>>_(Agents)_ </span>
|
|
|
|
<span id="reportTitle" class="report" style="display:none"> </span>
|
|
: <span class="report" style="display:none"><span style="display:inline-block;width:130px;font-style:italic">_(Array status)_</span>
|
|
<input type="checkbox" name="report1"<?=($notify['report'] & 1)==1 ? ' checked' : ''?>>_(Browser)_
|
|
<input type="checkbox" name="report2"<?=($notify['report'] & 2)==2 ? ' checked' : ''?>>_(Email)_
|
|
<input type="checkbox" name="report3"<?=($notify['report'] & 4)==4 ? ' checked' : ''?>>_(Agents)_ </span>
|
|
|
|
:help186
|
|
> Use the checkboxes above to select what and how notifications need to be given; by browser, by email and/or by a service.<br>
|
|
> <b>Tip:</b> you can use custom notification agents; just add them to "/boot/config/plugins/dynamix/notification/agents" directory and check 'Agents'.
|
|
:end
|
|
|
|
_(Notification entity)_:
|
|
: <span style="display:inline-block;width:130px;font-style:italic">_(Notices)_</span>
|
|
<input type="checkbox" class="checkbox" name="normal1"<?=($notify['normal'] & 1)==1 ? " checked $disabled" : $disabled?>>_(Browser)_
|
|
<input type="checkbox" class="checkbox" name="normal2"<?=($notify['normal'] & 2)==2 ? " checked $disabled" : $disabled?>>_(Email)_
|
|
<input type="checkbox" class="checkbox" name="normal3"<?=($notify['normal'] & 4)==4 ? " checked $disabled" : $disabled?>>_(Agents)_
|
|
|
|
|
|
: <span style="display:inline-block;width:130px;font-style:italic">_(Warnings)_</span>
|
|
<input type="checkbox" class="checkbox" name="warning1"<?=($notify['warning'] & 1)==1 ? " checked $disabled" : $disabled?>>_(Browser)_
|
|
<input type="checkbox" class="checkbox" name="warning2"<?=($notify['warning'] & 2)==2 ? " checked $disabled" : $disabled?>>_(Email)_
|
|
<input type="checkbox" class="checkbox" name="warning3"<?=($notify['warning'] & 4)==4 ? " checked $disabled" : $disabled?>>_(Agents)_
|
|
|
|
|
|
: <span style="display:inline-block;width:130px;font-style:italic">_(Alerts)_</span>
|
|
<input type="checkbox" class="checkbox" name="alert1"<?=($notify['alert'] & 1)==1 ? " checked $disabled" : $disabled?>>_(Browser)_
|
|
<input type="checkbox" class="checkbox" name="alert2"<?=($notify['alert'] & 2)==2 ? " checked $disabled" : $disabled?>>_(Email)_
|
|
<input type="checkbox" class="checkbox" name="alert3"<?=($notify['alert'] & 4)==4 ? " checked $disabled" : $disabled?>>_(Agents)_
|
|
|
|
:help187
|
|
> Notifications are classified as:
|
|
>
|
|
> *notice* - these are informative notifications and do not indicate a problem situation, e.g. a new version is available<br>
|
|
> *warning* - these are attentive notifications and may indicate future problems, e.g. a hard disk is hotter than usual<br>
|
|
> *alert* - these are serious notifications and require immediate attention, e.g. a failing hard disk<br>
|
|
>
|
|
> Choose for each classification how you want to be notified.
|
|
:end
|
|
|
|
<input type="submit" name="#default" value="_(Default)_">
|
|
: <input type="submit" name="#apply" value="_(Apply)_" disabled><input type="button" value="_(Done)_" onclick="done()"></td>
|
|
</form>
|