refactor: remove unused Type components and relocate module-related API routes to admin routes.

This commit is contained in:
pbao9
2026-02-13 12:03:11 +07:00
parent 245f5ade37
commit 3a10c3e2d7
12 changed files with 27 additions and 1552 deletions
@@ -43,7 +43,7 @@
{{-- Thumbnail using component --}}
<x-image-picker name="thumbnail" label="Thumbnail" :value="$group->thumbnail" />
<x-module.v-center :model="$group->host->datacenter" />
<x-module.v-center :model="$group->host?->datacenter" />
<x-module.datacenter :model="$group->host" />
<x-module.host :model="$group" />
{{-- Status --}}
@@ -77,7 +77,6 @@
value="{{ old('slug') }}" class="form-control">
</div>
</div>
<x-type :model="null"/>
{{--Status--}}
<div class="form-group row">
<label class="col-md-4" for="company">Status</label>
@@ -64,7 +64,7 @@ if (!$selectedDatacenterId && $model) {
$datacenter.html('<option value="">Đang tải Datacenter...</option>').prop('disabled', true);
$.ajax({
url: '{{ route('api.getDatacenter') }}',
url: '{{ route('module-vcenter.getDatacenter') }}',
type: 'GET',
data: {
vcenter: vcenterId
@@ -29,10 +29,10 @@ $selectedHostId = old('module_host_id') ?? ($model?->module_host_id ?? ($model?-
const $datacenter = $('.datacenter_id');
const $host = $('.host_id');
// Debounce function to prevent spam API calls
let loadHostsTimeout;
function debounceLoadHosts(datacenterId, preselect = null) {
clearTimeout(loadHostsTimeout);
loadHostsTimeout = setTimeout(() => {
@@ -45,7 +45,7 @@ $selectedHostId = old('module_host_id') ?? ($model?->module_host_id ?? ($model?-
if ($host.prop('disabled') && $host.find('option:first').text().includes('Đang tải')) {
return;
}
if (!datacenterId) {
$host.html('<option value="">--- Chọn Host ---</option>').prop('disabled', true);
return;
@@ -54,7 +54,7 @@ $selectedHostId = old('module_host_id') ?? ($model?->module_host_id ?? ($model?-
$host.html('<option value="">Đang tải Host...</option>').prop('disabled', true);
$.ajax({
url: '{{ route('api.getHost') }}',
url: '{{ route('module-vcenter.getHost') }}',
type: 'GET',
data: {
datacenter: datacenterId
@@ -1,16 +0,0 @@
<div class="row form-group">
<label for="order_product_type" class="col-md-4">Product Type
(*)</label>
<div class="col-md-8">
<select class="form-control order_product_type"
data-append="product[0][product_id]"
name="product[0][type]">
<option value="0">-----------</option>
@if(count($types) > 0)
@foreach($types as $item)
<option value="{{ $item->id }}">{{ $item->name }}</option>
@endforeach
@endif
</select>
</div>
</div>
-13
View File
@@ -1,13 +0,0 @@
{{--Last name--}}
<div class="form-group row">
<label class="col-md-4" for="lastname">Product Type</label>
<div class="col-md-8">
<select class="custom-select" name="type_id">
@if(count($types) > 0)
@foreach($types->all() as $item)
<option value="{{ $item->id }}" @selected(old('type_id') === $item->id) >{{ $item->name }}</option>
@endforeach
@endif
</select>
</div>
</div>