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
@@ -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