update dns
This commit is contained in:
@@ -27,7 +27,6 @@
|
||||
const networkAjaxUrl = $network.data('route');
|
||||
|
||||
function loadNetworks(hostId, preselect = null) {
|
||||
console.log('Loading networks for host:', hostId);
|
||||
|
||||
if (!hostId) {
|
||||
$network.html('<option value="0">---------</option>').prop('disabled', true);
|
||||
@@ -45,8 +44,6 @@
|
||||
host: hostId
|
||||
},
|
||||
success: function (response) {
|
||||
console.log('Network API Response Received:', response);
|
||||
|
||||
// Strict check
|
||||
if (response.error === false && Array.isArray(response.data) && response.data.length > 0) {
|
||||
let options = '<option value="0">---------</option>';
|
||||
@@ -65,7 +62,6 @@
|
||||
}, 100);
|
||||
}
|
||||
} else {
|
||||
console.warn('Handling empty/error response');
|
||||
$network.html('<option value="0">Not Found Network</option>').prop('disabled', true);
|
||||
$network.trigger('change');
|
||||
}
|
||||
@@ -84,12 +80,9 @@
|
||||
loadNetworks(hostId);
|
||||
});
|
||||
|
||||
// Initial state setup
|
||||
if (!$host.val()) {
|
||||
$network.prop('disabled', true);
|
||||
} else {
|
||||
// If host exists but network empty (client side nav or invalid state), load it
|
||||
// If network already populated by server (Edit mode), don't reload
|
||||
if ($network.find('option').length <= 1 || $network.val() == 0) {
|
||||
loadNetworks($host.val());
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user