mirror of
https://github.com/unraid/webgui.git
synced 2026-02-13 20:48:47 -06:00
Add options to settings to disable/enable + refresh rate
This commit is contained in:
@@ -183,6 +183,19 @@ _(Console Options)_:
|
||||
|
||||
:vms_console_help:
|
||||
|
||||
_(Show VM Usage)_:
|
||||
: <select id="vmusage" name="USAGE">
|
||||
<?=mk_option($domain_cfg['USAGE'], 'N', _('Disabled'))?>
|
||||
<?=mk_option($domain_cfg['USAGE'], 'Y', _('Enabled'))?>
|
||||
</select>
|
||||
|
||||
:vms_usage_help:
|
||||
|
||||
_(VM Usage refresh timer(seconds))_:
|
||||
: <input type="number" id="vm_usage_timer" name="USAGETIMER" value="<?=htmlspecialchars($domain_cfg['USAGETIMER'] ?? 3) ?>" class="narrow">
|
||||
|
||||
:vms_usage_timer_help:
|
||||
|
||||
_(PCIe ACS override)_:
|
||||
: <select id="pcie_acs_override"<?=$safemode?' disabled':''?>>
|
||||
<?= mk_option($pcie_acs_override, '', _('Disabled'))?>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Menu="VMs:0"
|
||||
Title="VM Usage Statisics"
|
||||
Cond="exec(\"grep -o '^SERVICE=.enable' /boot/config/domain.cfg 2>/dev/null\")"
|
||||
Nchan="vm_usage:stop"
|
||||
Cond="exec(\"grep -o '^USAGE=.Y' /boot/config/domain.cfg 2>/dev/null\") && is_file('/var/run/libvirt/libvirtd.pid')"
|
||||
---
|
||||
<?PHP
|
||||
/* Copyright 2005-2024, Lime Technology
|
||||
|
||||
@@ -52,6 +52,10 @@ function update_translation($locale) {
|
||||
}
|
||||
}
|
||||
|
||||
$domain_cfgfile = "/boot/config/domain.cfg";
|
||||
$domain_cfg = parse_ini_file($domain_cfgfile);
|
||||
if (!isset($domain_cfg['USAGETIMER'])) $timer = 3 ; else $timer = $domain_cfg['USAGETIMER'];
|
||||
|
||||
while (true) {
|
||||
|
||||
extract(parse_plugin_cfg('dynamix',true));
|
||||
@@ -88,6 +92,6 @@ while (true) {
|
||||
$time0 = $time1;
|
||||
}
|
||||
|
||||
sleep(3);
|
||||
sleep($timer);
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user