mirror of
https://github.com/unraid/webgui.git
synced 2026-04-24 02:58:57 -05:00
Undo the VM sorting for Start/Stop
This commit is contained in:
@@ -16,18 +16,8 @@ $docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
require_once "$docroot/plugins/dynamix.vm.manager/include/libvirt_helpers.php";
|
||||
|
||||
$act = $_POST['action'];
|
||||
$txt = '/boot/config/plugins/dynamix.vm.manager/userprefs.txt';
|
||||
$vms = $lv->get_domains();
|
||||
|
||||
if (file_exists($txt)) {
|
||||
$prefs = parse_ini_file($txt); $sort = [];
|
||||
foreach ($vms as $vm) $sort[] = $prefs[$vm] ?? 999;
|
||||
array_multisort($sort,SORT_NUMERIC,$vms);
|
||||
} else {
|
||||
natsort($vms);
|
||||
}
|
||||
if ($act=='stop') $vms = array_reverse($vms);
|
||||
|
||||
foreach ($vms as $vm) {
|
||||
$res = $lv->get_domain_by_name($vm);
|
||||
$uuid = $lv->domain_get_uuid($res);
|
||||
|
||||
Reference in New Issue
Block a user