This commit is contained in:
pbao9
2026-01-31 10:40:35 +07:00
parent 4b5e22c9d2
commit 27f365d8cf
7 changed files with 152 additions and 108 deletions
@@ -57,7 +57,7 @@ class ModuleController extends Controller
], ],
[], [],
[], [],
['id', 'name'] ['id', 'name', 'datacenter_id']
); );
if (count($datacenter) > 0) { if (count($datacenter) > 0) {
@@ -1,7 +1,20 @@
@extends('administrator.layout.master')
@push('plugin-styles')
<link href="{{ asset('build/plugins/select2/select2.min.css') }}" rel="stylesheet" />
@endpush
@extends("admin.main") @section('breadcrumb')
@php
$breadcrumbItems = [
['label' => 'Modules'],
['label' => 'Package vCenter'],
['label' => 'Datacenter', 'active' => true],
];
@endphp
<x-breabcrumb :items="$breadcrumbItems" />
@endsection
@section("content") @section("content")
@if(auth()->guard('admins')->user()->can("add module vcenter")) @if(auth()->guard('admins')->user()->can("add module vcenter"))
<div class="card card-outline card-primary"> <div class="card card-outline card-primary">
<form action="{{ route('package.network.store') }}" method="post"> <form action="{{ route('package.network.store') }}" method="post">
@csrf @csrf
@@ -27,7 +40,8 @@
<div class="row form-group align-items-center mb-0"> <div class="row form-group align-items-center mb-0">
<label for="type" class="col-md-3 text-right">Network Type</label> <label for="type" class="col-md-3 text-right">Network Type</label>
<div class="col-md-9 p-1 bg-customer"> <div class="col-md-9 p-1 bg-customer">
<input type="text" id="type" name="type" placeholder="" value="STANDARD_PORTGROUP" class="form-control"> <input type="text" id="type" name="type" placeholder="" value="STANDARD_PORTGROUP"
class="form-control">
</div> </div>
</div> </div>
@@ -38,10 +52,17 @@
</div> </div>
</form> </form>
</div> </div>
@else @else
<div class="alert alert-danger alert-dismissible"> <div class="alert alert-danger alert-dismissible">
<h5 class="mb-0"><i class="icon fas fa-ban"></i> Access Denied - You are not assigned to any Module vCenter <h5 class="mb-0"><i class="icon fas fa-ban"></i> Access Denied - You are not assigned to any Module vCenter
management department</h5> management department</h5>
</div> </div>
@endif @endif
@endsection @endsection
@push('plugin-scripts')
<script src="{{ asset('build/plugins/jquery/jquery.min.js') }}"></script>
<script src="{{ asset('build/plugins/select2/select2.min.js') }}"></script>
<script src="{{ asset('build/plugins/datatables.net/dataTables.min.js') }}"></script>
<script src="{{ asset('build/plugins/datatables.net-bs5/dataTables.bootstrap5.min.js') }}"></script>
@endpush
@@ -1,34 +1,51 @@
@extends('administrator.layout.master')
@push('plugin-styles')
<link href="{{ asset('build/plugins/select2/select2.min.css') }}" rel="stylesheet" />
@endpush
@extends("admin.main") @section('breadcrumb')
@php
$breadcrumbItems = [
['label' => 'Modules'],
['label' => 'Package vCenter'],
['label' => 'Datacenter', 'active' => true],
];
@endphp
<x-breabcrumb :items="$breadcrumbItems" />
@endsection
@section("content") @section("content")
@if(auth()->guard('admins')->user()->can("add module vcenter")) @if(auth()->guard('admins')->user()->can("add module vcenter"))
<div class="card card-outline card-primary"> <div class="card card-outline card-primary">
<form action="{{ route('package.network.update',['id' => $network->id]) }}" method="post"> <form action="{{ route('package.network.update', ['id' => $network->id]) }}" method="post">
@csrf @csrf
@method('put') @method('put')
<div class="card-body"> <div class="card-body">
<x-module.v-center :model="$network->host->datacenter" /> <x-module.v-center :model="$network->host->datacenter" />
<x-module.datacenter :model="$network->host" /> <x-module.datacenter :model="$network->host->datacenter" />
<x-module.host :model="$network" /> <x-module.host :model="$network->host" />
{{--Name--}} {{--Name--}}
<div class="row form-group align-items-center mb-0"> <div class="row form-group align-items-center mb-0">
<label for="name" class="col-md-3 text-right">Name</label> <label for="name" class="col-md-3 text-right">Name</label>
<div class="col-md-9 p-1 bg-customer"> <div class="col-md-9 p-1 bg-customer">
<input type="text" id="name" name="name" placeholder="" value="{{$network->name}}" class="form-control"> <input type="text" id="name" name="name" placeholder="" value="{{$network->name}}"
class="form-control">
</div> </div>
</div> </div>
{{--Network--}} {{--Network--}}
<div class="row form-group align-items-center mb-0"> <div class="row form-group align-items-center mb-0">
<label for="network" class="col-md-3 text-right">Network ID</label> <label for="network" class="col-md-3 text-right">Network ID</label>
<div class="col-md-9 p-1 bg-customer"> <div class="col-md-9 p-1 bg-customer">
<input type="text" id="network" name="network" placeholder="" value="{{$network->network}}" class="form-control"> <input type="text" id="network" name="network" placeholder="" value="{{$network->network}}"
class="form-control">
</div> </div>
</div> </div>
{{--Type--}} {{--Type--}}
<div class="row form-group align-items-center mb-0"> <div class="row form-group align-items-center mb-0">
<label for="type" class="col-md-3 text-right">Network Type</label> <label for="type" class="col-md-3 text-right">Network Type</label>
<div class="col-md-9 p-1 bg-customer"> <div class="col-md-9 p-1 bg-customer">
<input type="text" id="type" name="type" placeholder="" value="{{$network->type ?? 'STANDARD_PORTGROUP'}}" class="form-control"> <input type="text" id="type" name="type" placeholder=""
value="{{$network->type ?? 'STANDARD_PORTGROUP'}}" class="form-control">
</div> </div>
</div> </div>
@@ -39,10 +56,16 @@
</div> </div>
</form> </form>
</div> </div>
@else @else
<div class="alert alert-danger alert-dismissible"> <div class="alert alert-danger alert-dismissible">
<h5 class="mb-0"><i class="icon fas fa-ban"></i> Access Denied - You are not assigned to any Module vCenter <h5 class="mb-0"><i class="icon fas fa-ban"></i> Access Denied - You are not assigned to any Module vCenter
management department</h5> management department</h5>
</div> </div>
@endif @endif
@endsection @endsection
@push('plugin-scripts')
<script src="{{ asset('build/plugins/jquery/jquery.min.js') }}"></script>
<script src="{{ asset('build/plugins/select2/select2.min.js') }}"></script>
<script src="{{ asset('build/plugins/datatables.net/dataTables.min.js') }}"></script>
<script src="{{ asset('build/plugins/datatables.net-bs5/dataTables.bootstrap5.min.js') }}"></script>
@endpush
@@ -26,7 +26,7 @@
</div> </div>
</div> </div>
@push('scripts') @push('custom-scripts')
<script> <script>
$(document).ready(function () { $(document).ready(function () {
// Prevent multiple initializations using namespace // Prevent multiple initializations using namespace
@@ -75,7 +75,7 @@
response.data.forEach(dc => { response.data.forEach(dc => {
const selected = preselect == dc.id ? 'selected' : ''; const selected = preselect == dc.id ? 'selected' : '';
options += options +=
`<option value="${dc.id}" ${selected}>${dc.name}</option>`; `<option value="${dc.id}" ${selected}>${dc.name} - ${dc.datacenter_id}</option>`;
}); });
$datacenter.html(options).prop('disabled', false); $datacenter.html(options).prop('disabled', false);
@@ -1,5 +1,5 @@
@php @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?->ipaddress?->module_host_id ?? null));
@endphp @endphp
@@ -13,7 +13,7 @@
</select> </select>
</div> </div>
</div> </div>
@push('scripts') @push('custom-scripts')
<script> <script>
$(document).ready(function () { $(document).ready(function () {
// Prevent multiple initializations using namespace // Prevent multiple initializations using namespace
@@ -35,7 +35,7 @@
</div> </div>
</div> </div>
@push('scripts') @push('custom-scripts')
<script> <script>
// Initialize Select2 for Operating Systems in OS Version Component // Initialize Select2 for Operating Systems in OS Version Component
function initializeOSVersionSelect() { function initializeOSVersionSelect() {
@@ -1,6 +1,6 @@
@php @php
// Fix: Get os_group_id from the relationship correctly // Fix: Get os_group_id from the relationship correctly
$selectedOsGroupId = old('os_group_id') ?? ($model?->os?->os_group_id ?? null); $selectedOsGroupId = old('os_group_id') ?? ($model?->os?->os_group_id ?? null);
@endphp @endphp
@@ -21,7 +21,7 @@
</div> </div>
@push('scripts') @push('custom-scripts')
<script> <script>
$(document).ready(function() { $(document).ready(function() {
// Prevent multiple initializations using namespace // Prevent multiple initializations using namespace