feat: refactor VM add/edit forms to include vCenter selection, host component, and new VM information fields.
This commit is contained in:
@@ -10,6 +10,8 @@ if (!$selectedDatacenterId && $model) {
|
||||
$selectedDatacenterId = $model->host?->module_datacenter_id;
|
||||
} elseif ($model instanceof \App\Models\ModuleIpAddress) {
|
||||
$selectedDatacenterId = $model->host?->module_datacenter_id;
|
||||
} elseif ($model instanceof \App\Models\VirtualMachines) {
|
||||
$selectedDatacenterId = $model->datacenter_id;
|
||||
} elseif (isset($model->module_datacenter_id)) {
|
||||
$selectedDatacenterId = $model->module_datacenter_id;
|
||||
} elseif (method_exists($model, 'host') && $model->host) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@php
|
||||
$selectedHostId = old('module_host_id') ?? ($model?->module_host_id ?? ($model?->ipaddress?->module_host_id ?? null));
|
||||
$selectedHostId = old('module_host_id') ?? ($model?->module_host_id ?? ($model?->host_id ?? ($model?->ipaddress?->module_host_id ?? null)));
|
||||
@endphp
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
@php
|
||||
$selectedVcenterId = old('vcenter_id') ??
|
||||
($model?->host?->datacenter?->vcenter_id ?? (
|
||||
$model?->ipaddress?->host?->datacenter?->vcenter?->id ??
|
||||
$model?->vcenter_id ?? null
|
||||
$model?->datacenter?->vcenter_id ??
|
||||
($model?->ipaddress?->host?->datacenter?->vcenter?->id ??
|
||||
$model?->vcenter_id ?? null)
|
||||
));
|
||||
@endphp
|
||||
|
||||
|
||||
Reference in New Issue
Block a user