mirror of
https://github.com/unraid/webgui.git
synced 2026-01-04 08:29:51 -06:00
133 lines
4.7 KiB
Plaintext
133 lines
4.7 KiB
Plaintext
Menu="OtherSettings"
|
|
Type="xmenu"
|
|
Title="UPS Settings"
|
|
Icon="icon-ups"
|
|
Tag="battery-3"
|
|
---
|
|
<?PHP
|
|
/* Copyright 2005-2023, Lime Technology
|
|
* Copyright 2012-2023, Bergware International.
|
|
* Copyright 2015, Dan Landon.
|
|
*
|
|
* 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.
|
|
*/
|
|
?>
|
|
|
|
<?
|
|
$sName = "dynamix.apcupsd";
|
|
$cfg = parse_plugin_cfg($sName);
|
|
?>
|
|
<script>
|
|
function toggleCustomCable(form) {
|
|
var readonly = form.UPSCABLE.value != 'custom';
|
|
form.CUSTOMUPSCABLE.readOnly = readonly;
|
|
if (readonly) form.CUSTOMUPSCABLE.value = '';
|
|
}
|
|
function toggleDevice(form) {
|
|
var readonly = form.UPSTYPE.value == 'usb';
|
|
form.DEVICE.readOnly = readonly;
|
|
if (readonly) form.DEVICE.value = '';
|
|
}
|
|
$(function() {
|
|
showStatus('pid','apcupsd');
|
|
toggleCustomCable(document.apcupsd_settings);
|
|
toggleDevice(document.apcupsd_settings);
|
|
});
|
|
</script>
|
|
<table class="tablesorter shift ups" <?if (!file_exists("/var/run/apcupsd.pid")):?>style="display:none"<?endif;?>>
|
|
<thead><tr><th><i class='ups fa fa-shield'></i>_(UPS Model)_</th><th><i class='ups fa fa-plug'></i>_(UPS Status)_</th><th><i class='ups fa fa-battery'></i>_(Battery Charge)_</th><th><i class='ups fa fa-clock-o'></i>_(Runtime Left)_</th><th><i class='ups fa fa-bolt'></i>_(Nominal Power)_</th><th><i class='ups fa fa-bars'></i>_(UPS Load)_</th><th><i class='ups fa fa-ellipsis-h'></i>_(Output Voltage)_</th></tr></thead>
|
|
<tbody id="ups_summary"><tr class="ups"><td colspan="7"> </td></tr></tbody>
|
|
</table>
|
|
|
|
|
|
|
|
: <span><a href="https://linux.die.net/man/8/apcupsd" target="_blank" title="_(APC UPS Daemon user manual)_"><i class="fa fa-file-text-o"></i> <u>_(Online Manual)_</u></a></span>
|
|
|
|
<form markdown="1" name="apcupsd_settings" method="POST" action="/update.php" target="progressFrame">
|
|
<input type="hidden" name="#file" value="<?=$sName?>/<?=$sName?>.cfg">
|
|
<input type="hidden" name="#include" value="/plugins/<?=$sName?>/include/update.apcupsd.php">
|
|
|
|
_(Start APC UPS daemon)_:
|
|
: <select name="SERVICE">
|
|
<?=mk_option($cfg['SERVICE'], "disable", _("No"))?>
|
|
<?=mk_option($cfg['SERVICE'], "enable", _("Yes"))?>
|
|
</select>
|
|
|
|
:apc_ups_daemon_help:
|
|
|
|
_(UPS cable)_:
|
|
: <select name="UPSCABLE" onChange="toggleCustomCable(this.form)">
|
|
<?=mk_option($cfg['UPSCABLE'], "usb", _("USB"))?>
|
|
<?=mk_option($cfg['UPSCABLE'], "simple", _("Simple"))?>
|
|
<?=mk_option($cfg['UPSCABLE'], "smart", _("Smart"))?>
|
|
<?=mk_option($cfg['UPSCABLE'], "ether", _("Ether"))?>
|
|
<?=mk_option($cfg['UPSCABLE'], "custom", _("Custom"))?>
|
|
</select>
|
|
|
|
:apc_ups_cable_help:
|
|
|
|
_(Custom UPS cable)_:
|
|
: <input type="text" name="CUSTOMUPSCABLE" class="narrow" maxlength="40" value="<?=htmlspecialchars($cfg['CUSTOMUPSCABLE']);?>">
|
|
|
|
:apc_ups_custom_cable_help:
|
|
|
|
_(UPS type)_:
|
|
: <select name="UPSTYPE" onChange="toggleDevice(this.form)">
|
|
<?=mk_option($cfg['UPSTYPE'], "usb", _("USB"))?>
|
|
<?=mk_option($cfg['UPSTYPE'], "apcsmart", _("APCsmart"))?>
|
|
<?=mk_option($cfg['UPSTYPE'], "net", _("Net"))?>
|
|
<?=mk_option($cfg['UPSTYPE'], "snmp", _("SNMP"))?>
|
|
<?=mk_option($cfg['UPSTYPE'], "dumb", _("Dumb"))?>
|
|
<?=mk_option($cfg['UPSTYPE'], "pcnet", _("PCnet"))?>
|
|
<?=mk_option($cfg['UPSTYPE'], "modbus", _("ModBus"))?>
|
|
</select>
|
|
|
|
:apc_ups_type_help:
|
|
|
|
_(Device)_:
|
|
: <input type="text" name="DEVICE" maxlength="200" class="narrow" value="<?=htmlspecialchars($cfg['DEVICE']);?>">
|
|
|
|
:apc_ups_device_help:
|
|
|
|
_(Override UPS Capacity (Watts))_:
|
|
: <input type="number" name="OVERRIDE_UPS_CAPACITY" maxlength="5" class="narrow" value="<?=htmlspecialchars($cfg['OVERRIDE_UPS_CAPACITY']);?>">
|
|
|
|
:apc_ups_override_ups_capacity_help:
|
|
|
|
_(Battery level to initiate shutdown)_ (%):
|
|
: <input type="text" name="BATTERYLEVEL" class="narrow" maxlength="3" value="<?=htmlspecialchars($cfg['BATTERYLEVEL']);?>">
|
|
|
|
:apc_battery_level_help:
|
|
|
|
_(Runtime left to initiate shutdown)_ (_(minutes)_):
|
|
: <input type="text" name="MINUTES" class="narrow" maxlength="3" value="<?=htmlspecialchars($cfg['MINUTES']);?>">
|
|
|
|
:apc_runtime_left_help:
|
|
|
|
_(Time on battery before shutdown)_ (_(seconds)_):
|
|
: <input type="text" name="TIMEOUT" class="narrow" maxlength="4" value="<?=htmlspecialchars($cfg['TIMEOUT']);?>">
|
|
|
|
:apc_battery_time_help:
|
|
<div></div>
|
|
:apc_note_help:
|
|
|
|
_(Turn off UPS after shutdown)_:
|
|
: <select name="KILLUPS">
|
|
<?=mk_option($cfg['KILLUPS'], "no", _("No"))?>
|
|
<?=mk_option($cfg['KILLUPS'], "yes", _("Yes"))?>
|
|
</select>
|
|
|
|
:apc_killups_help:
|
|
|
|
<input type="submit" name="#default" value="_(Default)_">
|
|
: <span class="inline-block">
|
|
<input type="submit" name="#apply" value="_(Apply)_" disabled>
|
|
<input type="button" value="_(Done)_" onclick="done()">
|
|
</span>
|
|
</form>
|