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) {
@@ -1,5 +1,18 @@
@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")
@if(auth()->guard('admins')->user()->can("add module vcenter"))
<div class="card card-outline card-primary">
@@ -27,7 +40,8 @@
<div class="row form-group align-items-center mb-0">
<label for="type" class="col-md-3 text-right">Network Type</label>
<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>
@@ -45,3 +59,10 @@
</div>
@endif
@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,5 +1,18 @@
@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")
@if(auth()->guard('admins')->user()->can("add module vcenter"))
<div class="card card-outline card-primary">
@@ -7,28 +20,32 @@
@csrf
@method('put')
<div class="card-body">
<x-module.v-center :model="$network->host->datacenter" />
<x-module.datacenter :model="$network->host" />
<x-module.host :model="$network" />
<x-module.datacenter :model="$network->host->datacenter" />
<x-module.host :model="$network->host" />
{{--Name--}}
<div class="row form-group align-items-center mb-0">
<label for="name" class="col-md-3 text-right">Name</label>
<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>
{{--Network--}}
<div class="row form-group align-items-center mb-0">
<label for="network" class="col-md-3 text-right">Network ID</label>
<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>
{{--Type--}}
<div class="row form-group align-items-center mb-0">
<label for="type" class="col-md-3 text-right">Network Type</label>
<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>
@@ -46,3 +63,9 @@
</div>
@endif
@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>
@push('scripts')
@push('custom-scripts')
<script>
$(document).ready(function () {
// Prevent multiple initializations using namespace
@@ -75,7 +75,7 @@
response.data.forEach(dc => {
const selected = preselect == dc.id ? 'selected' : '';
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);
@@ -13,7 +13,7 @@
</select>
</div>
</div>
@push('scripts')
@push('custom-scripts')
<script>
$(document).ready(function () {
// Prevent multiple initializations using namespace
@@ -35,7 +35,7 @@
</div>
</div>
@push('scripts')
@push('custom-scripts')
<script>
// Initialize Select2 for Operating Systems in OS Version Component
function initializeOSVersionSelect() {
@@ -21,7 +21,7 @@
</div>
@push('scripts')
@push('custom-scripts')
<script>
$(document).ready(function() {
// Prevent multiple initializations using namespace