Fix: Update VM page to show memory in GB if > 1024MB

This commit is contained in:
SimonFair
2025-10-16 10:23:18 +01:00
parent 0420111f92
commit 5e4d04deae

View File

@@ -64,7 +64,7 @@ foreach ($vms as $vm) {
} else {
$mem = $lv->domain_get_memory($res)/1024;
}
$mem = round($mem).'M';
$mem = (round($mem) >= 1024) ? (round($mem) /1024) .'G': round($mem) .'M';
$vcpu = $dom['nrVirtCpu'];
$template = $lv->_get_single_xpath_result($res, '//domain/metadata/*[local-name()=\'vmtemplate\']/@name');
if (empty($template)) $template = 'Custom';