update
This commit is contained in:
@@ -57,7 +57,7 @@ class ModuleController extends Controller
|
|||||||
],
|
],
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
['id', 'name']
|
['id', 'name', 'datacenter_id']
|
||||||
);
|
);
|
||||||
|
|
||||||
if (count($datacenter) > 0) {
|
if (count($datacenter) > 0) {
|
||||||
|
|||||||
@@ -1,47 +1,68 @@
|
|||||||
|
@extends('administrator.layout.master')
|
||||||
|
@push('plugin-styles')
|
||||||
|
<link href="{{ asset('build/plugins/select2/select2.min.css') }}" rel="stylesheet" />
|
||||||
|
@endpush
|
||||||
|
|
||||||
@extends("admin.main")
|
@section('breadcrumb')
|
||||||
@section("content")
|
@php
|
||||||
@if(auth()->guard('admins')->user()->can("add module vcenter"))
|
$breadcrumbItems = [
|
||||||
<div class="card card-outline card-primary">
|
['label' => 'Modules'],
|
||||||
<form action="{{ route('package.network.store') }}" method="post">
|
['label' => 'Package vCenter'],
|
||||||
@csrf
|
['label' => 'Datacenter', 'active' => true],
|
||||||
<div class="card-body">
|
];
|
||||||
<x-module.v-center :model="null" />
|
@endphp
|
||||||
<x-module.datacenter :model="null" />
|
<x-breabcrumb :items="$breadcrumbItems" />
|
||||||
<x-module.host :model="null" />
|
|
||||||
{{--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="" 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="" 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="STANDARD_PORTGROUP" class="form-control">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="card-footer">
|
|
||||||
<a href="{{ route('package.network.index') }}" class="btn btn-outline-secondary">Trở về</a>
|
|
||||||
<button type="submit" class="btn btn-outline-primary">Lưu dữ liệu</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
@else
|
|
||||||
<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
|
|
||||||
management department</h5>
|
|
||||||
</div>
|
|
||||||
@endif
|
|
||||||
@endsection
|
@endsection
|
||||||
|
@section("content")
|
||||||
|
@if(auth()->guard('admins')->user()->can("add module vcenter"))
|
||||||
|
<div class="card card-outline card-primary">
|
||||||
|
<form action="{{ route('package.network.store') }}" method="post">
|
||||||
|
@csrf
|
||||||
|
<div class="card-body">
|
||||||
|
<x-module.v-center :model="null" />
|
||||||
|
<x-module.datacenter :model="null" />
|
||||||
|
<x-module.host :model="null" />
|
||||||
|
{{--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="" 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="" 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="STANDARD_PORTGROUP"
|
||||||
|
class="form-control">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="card-footer">
|
||||||
|
<a href="{{ route('package.network.index') }}" class="btn btn-outline-secondary">Trở về</a>
|
||||||
|
<button type="submit" class="btn btn-outline-primary">Lưu dữ liệu</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@else
|
||||||
|
<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
|
||||||
|
management department</h5>
|
||||||
|
</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,48 +1,71 @@
|
|||||||
|
@extends('administrator.layout.master')
|
||||||
|
@push('plugin-styles')
|
||||||
|
<link href="{{ asset('build/plugins/select2/select2.min.css') }}" rel="stylesheet" />
|
||||||
|
@endpush
|
||||||
|
|
||||||
@extends("admin.main")
|
@section('breadcrumb')
|
||||||
@section("content")
|
@php
|
||||||
@if(auth()->guard('admins')->user()->can("add module vcenter"))
|
$breadcrumbItems = [
|
||||||
<div class="card card-outline card-primary">
|
['label' => 'Modules'],
|
||||||
<form action="{{ route('package.network.update',['id' => $network->id]) }}" method="post">
|
['label' => 'Package vCenter'],
|
||||||
@csrf
|
['label' => 'Datacenter', 'active' => true],
|
||||||
@method('put')
|
];
|
||||||
<div class="card-body">
|
@endphp
|
||||||
<x-module.v-center :model="$network->host->datacenter" />
|
<x-breabcrumb :items="$breadcrumbItems" />
|
||||||
<x-module.datacenter :model="$network->host" />
|
|
||||||
<x-module.host :model="$network" />
|
|
||||||
{{--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">
|
|
||||||
</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">
|
|
||||||
</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">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="card-footer">
|
|
||||||
<a href="{{ route('package.network.index') }}" class="btn btn-outline-secondary">Trở về</a>
|
|
||||||
<button type="submit" class="btn btn-outline-primary">Lưu dữ liệu</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
@else
|
|
||||||
<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
|
|
||||||
management department</h5>
|
|
||||||
</div>
|
|
||||||
@endif
|
|
||||||
@endsection
|
@endsection
|
||||||
|
@section("content")
|
||||||
|
@if(auth()->guard('admins')->user()->can("add module vcenter"))
|
||||||
|
<div class="card card-outline card-primary">
|
||||||
|
<form action="{{ route('package.network.update', ['id' => $network->id]) }}" method="post">
|
||||||
|
@csrf
|
||||||
|
@method('put')
|
||||||
|
<div class="card-body">
|
||||||
|
|
||||||
|
<x-module.v-center :model="$network->host->datacenter" />
|
||||||
|
<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">
|
||||||
|
</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">
|
||||||
|
</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">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="card-footer">
|
||||||
|
<a href="{{ route('package.network.index') }}" class="btn btn-outline-secondary">Trở về</a>
|
||||||
|
<button type="submit" class="btn btn-outline-primary">Lưu dữ liệu</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@else
|
||||||
|
<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
|
||||||
|
management department</h5>
|
||||||
|
</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>
|
||||||
</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);
|
||||||
|
|
||||||
@@ -108,14 +108,14 @@
|
|||||||
$datacenter.off('change.datacenterComponent').on('change.datacenterComponent', function () {
|
$datacenter.off('change.datacenterComponent').on('change.datacenterComponent', function () {
|
||||||
const datacenterId = $(this).val();
|
const datacenterId = $(this).val();
|
||||||
|
|
||||||
// Reset and disable host
|
// Reset and disable host
|
||||||
$host.html('<option value="">--- Chọn Host ---</option>').prop('disabled', true);
|
$host.html('<option value="">--- Chọn Host ---</option>').prop('disabled', true);
|
||||||
|
|
||||||
// Enable host if datacenter is selected
|
// Enable host if datacenter is selected
|
||||||
if (datacenterId) {
|
if (datacenterId) {
|
||||||
$host.prop('disabled', false);
|
$host.prop('disabled', false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Initial load logic
|
// Initial load logic
|
||||||
const selectedDatacenterId = $datacenter.data('selected');
|
const selectedDatacenterId = $datacenter.data('selected');
|
||||||
@@ -126,5 +126,5 @@
|
|||||||
debounceLoadDatacenters($vcenter.val());
|
debounceLoadDatacenters($vcenter.val());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user