mirror of
https://github.com/unraid/webgui.git
synced 2026-01-06 01:29:54 -06:00
switch to _var function for setting batteryLevel & batteryRuntime
This commit is contained in:
@@ -14,11 +14,13 @@ Tag="battery-3"
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*/
|
||||
$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
require_once "$docroot/webGui/include/Wrappers.php";
|
||||
?>
|
||||
<script>
|
||||
function getUPSstatus() {
|
||||
var batteryLevel = "<?= !empty($cfg['BATTERYLEVEL']) ? $cfg['BATTERYLEVEL'] : 0 ?>";
|
||||
var batteryRuntime = "<?= !empty($cfg['MINUTES']) ? $cfg['MINUTES'] : 0 ?>";
|
||||
var batteryLevel = "<?= _var($cfg,'BATTERYLEVEL',0) ?>";
|
||||
var batteryRuntime = "<?= _var($cfg,'MINUTES',0) ?>";
|
||||
|
||||
$.post('/plugins/dynamix.apcupsd/include/UPSstatus.php',{level:batteryLevel,runtime:batteryRuntime},function(data) {
|
||||
data = data.split('\n');
|
||||
|
||||
Reference in New Issue
Block a user