Fix php error due to typo and if libvirt is not started.

This commit is contained in:
SimonFair
2024-04-06 11:09:42 +01:00
parent 38a9b575f7
commit e0ea112af7
2 changed files with 5 additions and 1 deletions

View File

@@ -165,7 +165,7 @@ if ($_POST['vms']) {
echo $vmhtml;
}
if (!count($vmusagehtml)) echo "<span id='no_usagevms'><br> "._('No running virtual machines')."<br></span>";
if ($running < 1 && count($vmsusagehtml)) echo "<span id='no_usagevms'><br>". _('No running virtual machines')."<br></span>";
if ($running < 1 && count($vmusagehtml)) echo "<span id='no_usagevms'><br>". _('No running virtual machines')."<br></span>";
echo "</td></tr>";
}
}

View File

@@ -20,6 +20,10 @@ require_once "$docroot/webGui/include/Helpers.php";
require_once "$docroot/webGui/include/publish.php";
require_once "$docroot/plugins/dynamix.vm.manager/include/libvirt_helpers.php";
global $vmusagestats;
exec("/etc/rc.d/rc.libvirt status >/dev/null",$dummy,$libvirtd);
$libvirtd = $libvirtd==0;
if (!$libvirtd) return;
extract(parse_plugin_cfg('dynamix',true));
get_vm_usage_stats();
sleep(1);