refactor: remove unused Type components and relocate module-related API routes to admin routes.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user