update vm ticket
This commit is contained in:
@@ -93,6 +93,7 @@ class VCenterController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function storeNode(Request $request, string $type): JsonResponse
|
||||
{
|
||||
$rules = match ($type) {
|
||||
@@ -187,9 +188,9 @@ class VCenterController extends Controller
|
||||
$allHosts = ModuleHost::with(['datastore', 'network'])->get()->groupBy('module_datacenter_id');
|
||||
$allFolders = ModuleFolder::all()->groupBy('module_datacenter_id');
|
||||
// VMs with a host assignment — grouped by host DB id
|
||||
$allVMs = VirtualMachines::whereNotNull('host_id')->get()->groupBy('host_id');
|
||||
$allVMs = VirtualMachines::with('vmware')->whereNotNull('host_id')->get()->groupBy('host_id');
|
||||
// VMs without a host assignment (synced before host_id was tracked) — grouped by datacenter DB id
|
||||
$orphanVMs = VirtualMachines::whereNull('host_id')->get()->groupBy('datacenter_id');
|
||||
$orphanVMs = VirtualMachines::with('vmware')->whereNull('host_id')->get()->groupBy('datacenter_id');
|
||||
|
||||
$tree = $vcenters->map(function ($vc) use ($allHosts, $allFolders, $allVMs, $orphanVMs) {
|
||||
$dcGroups = ($vc->datacenters ?? collect())->groupBy('datacenter_id');
|
||||
@@ -227,8 +228,8 @@ class VCenterController extends Controller
|
||||
'uuid' => $vm->uuid,
|
||||
'vm_id' => $vm->vm_id,
|
||||
'ip' => $vm->ip,
|
||||
'username' => $vm->username,
|
||||
'password' => $vm->password,
|
||||
'username' => $vm->vmware?->user,
|
||||
'password' => $vm->vmware?->plain_password,
|
||||
'power_state' => $vm->power_state,
|
||||
'folder' => $vm->folder,
|
||||
'cpu' => $vm->cpu,
|
||||
@@ -304,6 +305,8 @@ class VCenterController extends Controller
|
||||
'uuid' => $vm->uuid,
|
||||
'vm_id' => $vm->vm_id,
|
||||
'ip' => $vm->ip,
|
||||
'username' => $vm->vmware?->user,
|
||||
'password' => $vm->vmware?->plain_password,
|
||||
'power_state' => $vm->power_state,
|
||||
'folder' => $vm->folder,
|
||||
'cpu' => $vm->cpu,
|
||||
|
||||
Reference in New Issue
Block a user