From b7ac4932a45e864f24a050e19d3fc66c74573968 Mon Sep 17 00:00:00 2001 From: Rosiak Date: Sat, 2 Jan 2016 01:32:43 +0100 Subject: [PATCH 1/4] 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 e697300019..f068daf029 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 5dee674a55..63b05b9143 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 From e3663fff3496fdb9fe5f8a548b33208a6d55a8d3 Mon Sep 17 00:00:00 2001 From: Rosiak Date: Sat, 2 Jan 2016 02:06:19 +0100 Subject: [PATCH 2/4] Set min-width --- html/includes/print-vm.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/html/includes/print-vm.inc.php b/html/includes/print-vm.inc.php index f068daf029..91b04b4953 100644 --- a/html/includes/print-vm.inc.php +++ b/html/includes/print-vm.inc.php @@ -12,10 +12,10 @@ else { echo ''; if ($vm['vmwVmState'] == 'powered off') { - echo 'OFF'; + echo 'OFF'; } else { - echo 'ON'; + echo 'ON'; } if ($vm['vmwVmGuestOS'] == 'E: tools not installed') { @@ -38,4 +38,4 @@ else { echo ''.sprintf('%.2f', $vm['vmwVmMemSize']).' MB'; } -echo ''.$vm['vmwVmCpus'].' CPU'; \ No newline at end of file +echo ''.$vm['vmwVmCpus'].' CPU'; From e61f6cd2a81bc7be3b21ee906b4bbc45930b7719 Mon Sep 17 00:00:00 2001 From: Rosiak Date: Sat, 2 Jan 2016 23:34:55 +0100 Subject: [PATCH 3/4] re-add newline --- html/pages/device/vm.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/pages/device/vm.inc.php b/html/pages/device/vm.inc.php index 63b05b9143..cfc03f165b 100644 --- a/html/pages/device/vm.inc.php +++ b/html/pages/device/vm.inc.php @@ -8,4 +8,4 @@ foreach (dbFetchRows('SELECT `vmwVmDisplayName`,`vmwVmState`,`vmwVmGuestOS`,`vmw } echo ''; -$pagetitle[] = 'Virtual Machines'; \ No newline at end of file +$pagetitle[] = 'Virtual Machines'; From 1ee694fcdb515dd14da42fd1d934c2be0f22c746 Mon Sep 17 00:00:00 2001 From: Rosiak Date: Sat, 2 Jan 2016 23:46:45 +0100 Subject: [PATCH 4/4] add missing backtick --- html/pages/device/vm.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/pages/device/vm.inc.php b/html/pages/device/vm.inc.php index cfc03f165b..699fb92f36 100644 --- a/html/pages/device/vm.inc.php +++ b/html/pages/device/vm.inc.php @@ -2,7 +2,7 @@ echo ''; $i = '1'; -foreach (dbFetchRows('SELECT `vmwVmDisplayName`,`vmwVmState`,`vmwVmGuestOS`,`vmwVmMemSize`,`vmwVmCpus` 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++; }
Server NamePower StatusOperating SystemMemoryCPU