108 lines
4.7 KiB
PHP
108 lines
4.7 KiB
PHP
@extends('administrator.layout.master')
|
|
@push('plugin-styles')
|
|
@foreach (config('assets.datatable.css') as $datatable)
|
|
<link href="{{ asset($datatable) }}" rel="stylesheet" />
|
|
@endforeach
|
|
@endpush
|
|
|
|
@php
|
|
use App\Enums\Status;
|
|
@endphp
|
|
|
|
@section('breadcrumb')
|
|
@php
|
|
$breadcrumbItems = [
|
|
['label' => 'Modules'],
|
|
['label' => 'Package vCenter'],
|
|
['label' => 'Version', 'url' => route('package.version.index')],
|
|
['label' => 'Edit Version', 'active' => true],
|
|
];
|
|
@endphp
|
|
<x-admin-breadcrumb :items="$breadcrumbItems" />
|
|
@endsection
|
|
@section('content')
|
|
@if (auth()->guard('admins')->user()->can('add package module'))
|
|
<div class="card card-outline card-primary">
|
|
<div class="card-header">
|
|
<h3 class="card-title mb-0">Edit Version</h3>
|
|
</div>
|
|
<form action="{{ route('package.version.update', ['id' => $version->id]) }}" method="post">
|
|
@csrf
|
|
@method('put')
|
|
<div class="card-body">
|
|
<div class="row">
|
|
<div class="col">
|
|
{{-- Group Name --}}
|
|
<div class="row form-group align-items-center mb-0">
|
|
<label for="version" class="col-md-3 text-right">Version</label>
|
|
<div class="col-md-9 bg-customer p-1">
|
|
<input type="text" id="version" name="version" placeholder="6.x,7.x, ..."
|
|
value="{{ $version->version ?? old('version') }}" class="form-control">
|
|
</div>
|
|
</div>
|
|
|
|
<x-module.v-center :model="$version->osGroup->host->datacenter ?? null" />
|
|
<x-module.datacenter :model="$version->osGroup->host" />
|
|
<x-module.host :model="$version->osGroup" />
|
|
<x-module.os :model="$version" />
|
|
|
|
<div class="row form-group align-items-center mb-0">
|
|
<label for="version" class="col-md-3 text-right">Template</label>
|
|
<div class="col-md-9 bg-customer p-1">
|
|
<input type="text" id="template_id" name="template_id" placeholder="vm-2005"
|
|
value="{{ $version->template_id ?? old('template_id') }}" class="form-control">
|
|
</div>
|
|
</div>
|
|
<div class="row form-group align-items-center mb-0">
|
|
<label for="status" class="col-md-3 text-right">Status</label>
|
|
<div class="col-md-9 bg-customer p-1">
|
|
<select class="custom-select select2" id="status" name="status">
|
|
@foreach (Status::getOptions() as $value => $label)
|
|
<option value="{{ $value }}" @selected($version->status == $value)>
|
|
{{ $label }}
|
|
</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<x-fixed-action-bar>
|
|
<x-button-crm type="button" variant="secondary" size="sm" icon="arrow-left"
|
|
route="package.version.index">Trở lại</x-button-crm>
|
|
<x-button-crm type="submit" variant="primary" size="sm" icon="plus-circle">Cập nhật</x-button-crm>
|
|
</x-fixed-action-bar>
|
|
</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 Package
|
|
management department</h5>
|
|
</div>
|
|
@endif
|
|
@endsection
|
|
|
|
@push('scripts')
|
|
<script type="text/javascript">
|
|
$(document).ready(function() {
|
|
// Initialize Select2 using global function
|
|
if (typeof window.initSelect2 === 'function') {
|
|
window.initSelect2();
|
|
}
|
|
|
|
// Initialize other Select2 elements
|
|
$('.select2').select2({
|
|
theme: 'bootstrap4',
|
|
width: '100%'
|
|
});
|
|
});
|
|
</script>
|
|
@endpush
|
|
|
|
@push('plugin-scripts')
|
|
@foreach (config('assets.datatable.js') as $datatable)
|
|
<script src="{{ asset($datatable) }}"></script>
|
|
@endforeach
|
|
@endpush
|