Fix connexion slots: topbar-logo fetch config a window.onload

Deplace le fetch get_config_sqlite de DOMContentLoaded vers
window.onload dans topbar-logo.js. Les requetes sont maintenant
sequencees: DOMContentLoaded (sidebar+topbar+i18n) -> onload
(config) -> event (internet/scan). Max 3-4 requetes simultanees.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
PaulVua
2026-03-17 18:46:16 +01:00
parent 196176667f
commit ffead8597a
2 changed files with 24 additions and 29 deletions

View File

@@ -564,15 +564,9 @@ function get_internet(){
// Use window.onload to wait for all initial resources to finish loading
// This frees up HTTP connection slots before making AJAX calls
window.onload = function() {
// Reuse config already fetched by topbar-logo.js, or fetch if not ready
const data = window._nebuleairConfig;
if (!data) {
console.warn("Config not ready yet, skipping wifi page init");
return;
}
// Wait for config loaded by topbar-logo.js (fires after window.onload)
document.addEventListener('nebuleair-config-ready', function(e) {
const data = e.detail;
console.log("Config loaded (wifi page):");
console.log(data);
@@ -603,7 +597,7 @@ function get_internet(){
document.getElementById('card-hotspot-info').style.display = 'none';
document.getElementById('card-wifi-scan').style.display = '';
}
}
});
</script>