mirror of
https://github.com/unraid/webgui.git
synced 2026-04-25 20:01:38 -05:00
VM manager: fix increasing vdisk size
This commit is contained in:
@@ -56,7 +56,7 @@ if ($_GET['refresh']) {
|
||||
if ($subaction) {
|
||||
$vm = $lv->domain_get_name_by_uuid($uuid);
|
||||
if ($subaction == 'disk-resize') {
|
||||
$capacity = str_replace(["KB","MB","GB","TB","PB"," ",","], ["K","M","G","T","P","",""], strtoupper($_POST['cap']));
|
||||
$capacity = str_replace(["KB","MB","GB","TB","PB"," ",","], ["K","M","G","T","P","",""], strtoupper($_GET['cap']));
|
||||
$oldcap = str_replace(["KB","MB","GB","TB","PB"," ",","], ["K","M","G","T","P","",""], strtoupper($_GET['oldcap']));
|
||||
if (substr($oldcap,0,-1) < substr($capacity,0,-1)){
|
||||
shell_exec("qemu-img resize -q ".escapeshellarg($_GET['disk'])." ".escapeshellarg($capacity));
|
||||
|
||||
@@ -108,9 +108,13 @@ foreach ($vms as $vm) {
|
||||
echo "<tr><td>$disk</td><td>{$arrValidDiskBuses[$bus]}</td>";
|
||||
if ($state == 'shutoff') {
|
||||
echo "<td title='Click to increase Disk Size'>";
|
||||
echo "<form method='post' action='?subaction=disk-resize&uuid={$uuid}&disk={$disk}&oldcap={$capacity}'>";
|
||||
echo "<form method='get' action=''>";
|
||||
echo "<input type='hidden' name='subaction' value='disk-resize'>";
|
||||
echo "<input type='hidden' name='uuid' value='".$uuid."'>";
|
||||
echo "<input type='hidden' name='disk' value='".htmlspecialchars($disk)."'>";
|
||||
echo "<input type='hidden' name='oldcap' value='".$capacity."'>";
|
||||
echo "<span class='diskresize' style='width:30px'>";
|
||||
echo "<span class='text'><a href='#'>$capacity</a></span>";
|
||||
echo "<span class='text'><a href='#' onclick='return false'>$capacity</a></span>";
|
||||
echo "<input class='input' type='text' style='width:46px' name='cap' value='$capacity' val='diskresize' hidden>";
|
||||
echo "</span></form></td>";
|
||||
echo "<td>$allocation</td>";
|
||||
|
||||
Reference in New Issue
Block a user