mirror of
https://github.com/unraid/webgui.git
synced 2026-01-14 13:39:58 -06:00
Merge remote-tracking branch 'limetech/master'
This commit is contained in:
@@ -119,10 +119,11 @@ foreach ($vms as $vm) {
|
||||
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><td><i class='fa fa-lock fa-fw grey-text'></i> locked</td>";
|
||||
} else {
|
||||
echo "<td>$capacity</td>";
|
||||
echo "<td>$capacity</td><td>$allocation</td>";
|
||||
echo "<td><i class='fa fa-eject fa-fw blue-text' style='cursor:pointer' onclick=\"swal({title:'Are you sure?',text:'Detach: ".basename($disk)."<br><i>from VM: $vm</i>',type:'warning',html:true,showCancelButton:true},function(){\$('div.spinner').show('slow');setTimeout(function(){ajaxVMDispatch({action:'disk-remove',uuid:'$uuid',dev:'$dev'},'loadlist');},100);})\" title='detach disk from VM'></i> detach</td>";
|
||||
}
|
||||
echo "<td>$allocation</td><td><i class='fa fa-lock fa-fw grey-text'></i> locked</td></tr>";
|
||||
}
|
||||
/* end Display VM disks */
|
||||
|
||||
@@ -134,10 +135,7 @@ foreach ($vms as $vm) {
|
||||
$dev = $arrCD['device'];
|
||||
$bus = $arrValidDiskBuses[$arrCD['bus']] ?? 'VirtIO';
|
||||
echo "<tr><td>$disk</td><td>$bus</td><td>$capacity</td><td>$allocation</td>";
|
||||
if ($state == 'shutoff')
|
||||
echo "<td><i class='fa fa-lock fa-fw grey-text'></i> locked </td>";
|
||||
else
|
||||
echo "<td><i class='fa fa-eject fa-fw blue-text' style='cursor:pointer' onclick=\"swal({title:'Are you sure?',text:'Detach: ".basename($disk)."<br><i>from VM: $vm</i>',type:'warning',html:true,showCancelButton:true},function(){\$('div.spinner').show('slow');setTimeout(function(){ajaxVMDispatch({action:'disk-remove',uuid:'$uuid',dev:'$dev'},'loadlist');},100);})\" title='detach disk from VM'></i> detach</td>";
|
||||
echo "<td><i class='fa fa-lock fa-fw grey-text'></i> locked </td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
|
||||
|
||||
@@ -191,9 +191,11 @@ switch ($action) {
|
||||
|
||||
case 'disk-remove':
|
||||
requireLibvirt();
|
||||
$arrResponse = ($lv->domain_disk_remove($domName, $_REQUEST['dev'])) ?
|
||||
// libvirt-php has an issue with detaching a disk, use virsh tool instead
|
||||
exec("virsh detach-disk " . escapeshellarg($uuid) . " " . escapeshellarg($_REQUEST['dev']) . " 2>&1", $arrOutput, $intReturnCode);
|
||||
$arrResponse = ($intReturnCode == 0) ?
|
||||
['success' => true] :
|
||||
['error' => $lv->get_last_error()];
|
||||
['error' => str_replace('error: ', '', implode('. ', $arrOutput))];
|
||||
break;
|
||||
|
||||
case 'snap-create':
|
||||
|
||||
Reference in New Issue
Block a user