feat: refactor VM add/edit forms to include vCenter selection, host component, and new VM information fields.

This commit is contained in:
pbao9
2026-02-14 16:57:13 +07:00
parent 498a57b499
commit d683afc901
6 changed files with 204 additions and 120 deletions
@@ -35,7 +35,8 @@ class VirtualMachineController extends Controller
public function create()
{
$title = 'Add Virtual Machine';
return view('administrator.pages.package.vm.add', compact('title'));
$vcenters = \App\Models\Vcenter::where('status', 1)->get();
return view('administrator.pages.package.vm.add', compact('title', 'vcenters'));
}
public function store(Request $request)
@@ -67,8 +68,9 @@ class VirtualMachineController extends Controller
return back()->withErrors('Invalid request.');
}
$vm->load('datacenter', 'host');
$vcenters = \App\Models\Vcenter::where('status', 1)->get();
$title = 'Edit Virtual Machine';
return view('administrator.pages.package.vm.edit', compact('title', 'vm'));
return view('administrator.pages.package.vm.edit', compact('title', 'vm', 'vcenters'));
}
public function update(Request $request, $id)