update
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@push('scripts')
|
||||
@push('custom-scripts')
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
// Prevent multiple initializations using namespace
|
||||
@@ -75,7 +75,7 @@
|
||||
response.data.forEach(dc => {
|
||||
const selected = preselect == dc.id ? 'selected' : '';
|
||||
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);
|
||||
|
||||
@@ -108,14 +108,14 @@
|
||||
$datacenter.off('change.datacenterComponent').on('change.datacenterComponent', function () {
|
||||
const datacenterId = $(this).val();
|
||||
|
||||
// Reset and disable host
|
||||
$host.html('<option value="">--- Chọn Host ---</option>').prop('disabled', true);
|
||||
// Reset and disable host
|
||||
$host.html('<option value="">--- Chọn Host ---</option>').prop('disabled', true);
|
||||
|
||||
// Enable host if datacenter is selected
|
||||
if (datacenterId) {
|
||||
$host.prop('disabled', false);
|
||||
}
|
||||
});
|
||||
// Enable host if datacenter is selected
|
||||
if (datacenterId) {
|
||||
$host.prop('disabled', false);
|
||||
}
|
||||
});
|
||||
|
||||
// Initial load logic
|
||||
const selectedDatacenterId = $datacenter.data('selected');
|
||||
@@ -126,5 +126,5 @@
|
||||
debounceLoadDatacenters($vcenter.val());
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
@endpush
|
||||
Reference in New Issue
Block a user