From a5e02be3d99a2f3ca4cd50d0943bad6f8bfdaef5 Mon Sep 17 00:00:00 2001 From: mad Date: Mon, 13 Aug 2018 19:21:12 +0200 Subject: [PATCH] in farbe und bunt --- web/index.php | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/web/index.php b/web/index.php index f34d1e1..f12902b 100644 --- a/web/index.php +++ b/web/index.php @@ -139,6 +139,14 @@ for ($col=0; $col "; + } elseif (preg_match('/format/', $arrColnames[$col])) { + echo "
$arrColnames[$col]
"; + } elseif (preg_match('/tapdev/', $arrColnames[$col])) { + echo "
$arrColnames[$col]
"; + } elseif (preg_match('/macaddr/', $arrColnames[$col])) { + echo "
$arrColnames[$col]
"; + } elseif (preg_match('/brdev/', $arrColnames[$col])) { + echo "
$arrColnames[$col]
"; } elseif (preg_match('/drive/', $arrColnames[$col])){ echo "
$arrColnames[$col]
"; + echo ""; } else { echo "
$arrColnames[$col]
"; } @@ -208,9 +216,9 @@ if(isset($_REQUEST['mode'])){ } } -if($mode!="newvm"){ - echo "Create a new VM
"; -} +if(($mode!="newvm")&&($mode!="editvm")){ + echo "
Create a new VM

"; + //getting vms from DB $sql="SELECT * FROM vms"; $res = $db_handle->query($sql); @@ -218,16 +226,19 @@ echo "
"; while ($row = $res->fetchArray(SQLITE3_ASSOC)){ if (checkvm($row['vmname'])){ $button = "start"; + $buttonc = "btn-success"; } else { - $button = "stop"; + $button = "stop"; + $buttonc = "btn-warning"; } - echo "
$row[vmname]
edit "; - echo "$button "; - echo " "; + echo "
$row[vmname]
edit "; + echo "$button "; + echo " "; $server = gethostname(); - if ($button == "stop") { - echo "VNC
"; + if (preg_match('/stop/', $button)) { + echo "VNC
"; } } +} echo "
"; ?>