mirror of
https://github.com/unraid/webgui.git
synced 2026-04-30 06:49:24 -05:00
fix UPS settings page when config contains empty values
This commit is contained in:
@@ -17,7 +17,10 @@ Tag="battery-3"
|
||||
?>
|
||||
<script>
|
||||
function getUPSstatus() {
|
||||
$.post('/plugins/dynamix.apcupsd/include/UPSstatus.php',{level:<?=$cfg['BATTERYLEVEL']?>,runtime:<?=$cfg['MINUTES']?>},function(data) {
|
||||
var batteryLevel = "<?= !empty($cfg['BATTERYLEVEL']) ? $cfg['BATTERYLEVEL'] : 0 ?>";
|
||||
var batteryRuntime = "<?= !empty($cfg['MINUTES']) ? $cfg['MINUTES'] : 0 ?>";
|
||||
|
||||
$.post('/plugins/dynamix.apcupsd/include/UPSstatus.php',{level:batteryLevel,runtime:batteryRuntime},function(data) {
|
||||
data = data.split('\n');
|
||||
$('#ups_summary').html(data[0]);
|
||||
$('#ups_status').html(data[1]);
|
||||
|
||||
Reference in New Issue
Block a user