diff --git a/web/index.php b/web/index.php index f12902b..b5fa60b 100644 --- a/web/index.php +++ b/web/index.php @@ -44,6 +44,7 @@ if ($config['DATABASETYPE']=="sqlite"){ exit; } } + if ((isset($_POST['deletevm']))&&(isset($_POST['deletename']))){ $vmname = clean($_POST['deletename']); $vmid = clean($_POST['deletevm']); @@ -99,73 +100,75 @@ if (isset($_REQUEST['edit'])){ } if (isset($formname)){ -echo "

$formname


"; -echo "
"; -$res = $db_handle->query('PRAGMA table_info(vms)'); -while ($col = $res->fetchArray(SQLITE3_ASSOC)) { - $arrColnames[]=$col['name']; -} -for ($col=0; $col $formname
"; + echo ""; + $res = $db_handle->query('PRAGMA table_info(vms)'); + while ($col = $res->fetchArray(SQLITE3_ASSOC)) { + $arrColnames[]=$col['name']; + } + for ($col=0; $col
bootoption
"; + if ($arrColnames[$col] == "bootoption"){ + if($val=="") { + $val="c"; + } + echo "
bootoption
"; // echo "$arrColnames[$col]
"; - } elseif ($arrColnames[$col] == "arch"){ - echo "
arch
"; + } elseif ($arrColnames[$col] == "arch"){ + echo "
arch
"; // echo "$arrColnames[$col]
"; - } elseif ($arrColnames[$col] == "cdrom"){ - echo "
cdrom
"; + } 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]
"; + } else { + echo "
$arrColnames[$col]
"; } - echo "
"; - } else { - echo "
$arrColnames[$col]
"; } } -} - -echo "$editid"; + echo "$editid"; } @@ -231,7 +234,7 @@ while ($row = $res->fetchArray(SQLITE3_ASSOC)){ $button = "stop"; $buttonc = "btn-warning"; } - echo "
$row[vmname]
edit "; + echo "
$row[vmname]
edit "; echo "$button "; echo " "; $server = gethostname();