From b7ac4932a45e864f24a050e19d3fc66c74573968 Mon Sep 17 00:00:00 2001 From: Rosiak Date: Sat, 2 Jan 2016 01:32:43 +0100 Subject: [PATCH] Small changes to Virtual Machines page --- html/includes/print-vm.inc.php | 12 ++++++++---- html/pages/device/vm.inc.php | 10 +++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/html/includes/print-vm.inc.php b/html/includes/print-vm.inc.php index e69730001..f068daf02 100644 --- a/html/includes/print-vm.inc.php +++ b/html/includes/print-vm.inc.php @@ -1,7 +1,5 @@ '; - echo ''; if (getidbyname($vm['vmwVmDisplayName'])) { @@ -12,7 +10,13 @@ else { } echo ''; -echo ''.$vm['vmwVmState'].''; + +if ($vm['vmwVmState'] == 'powered off') { + echo 'OFF'; +} +else { + echo 'ON'; +} if ($vm['vmwVmGuestOS'] == 'E: tools not installed') { echo 'Unknown (VMware Tools not installed)'; @@ -34,4 +38,4 @@ else { echo ''.sprintf('%.2f', $vm['vmwVmMemSize']).' MB'; } -echo ''.$vm['vmwVmCpus'].' CPU'; +echo ''.$vm['vmwVmCpus'].' CPU'; \ No newline at end of file diff --git a/html/pages/device/vm.inc.php b/html/pages/device/vm.inc.php index 5dee674a5..63b05b914 100644 --- a/html/pages/device/vm.inc.php +++ b/html/pages/device/vm.inc.php @@ -1,15 +1,11 @@ Server NamePower StatusOperating SystemMemoryCPU'; - +echo ''; $i = '1'; -foreach (dbFetchRows('SELECT * FROM vminfo WHERE device_id = ? ORDER BY vmwVmDisplayName', array($device['device_id'])) as $vm) { +foreach (dbFetchRows('SELECT `vmwVmDisplayName`,`vmwVmState`,`vmwVmGuestOS`,`vmwVmMemSize`,`vmwVmCpus` FROM `vminfo` WHERE `device_id` = ? ORDER BY `vmwVmDisplayName', array($device['device_id'])) as $vm) { include 'includes/print-vm.inc.php'; - $i++; } echo '
Server NamePower StatusOperating SystemMemoryCPU
'; - -$pagetitle[] = 'Virtual Machines'; +$pagetitle[] = 'Virtual Machines'; \ No newline at end of file