Reduce fetch count: config partagee + suppression doublons internet

- topbar-logo.js expose la config via event 'nebuleair-config-ready'
- wifi.html ecoute l'event au lieu de re-fetcher get_config_sqlite
- Supprime le doublon load_ethernet_info (get_internet fait deja tout)
- Passe de ~9 requetes simultanees a ~5 au chargement

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
PaulVua
2026-03-17 18:34:58 +01:00
parent 5849190220
commit 8d74e3e678
2 changed files with 12 additions and 33 deletions

View File

@@ -9,12 +9,15 @@
document.addEventListener('DOMContentLoaded', () => {
let config = null;
// Fetch config once
// Fetch config once and share globally
fetch('launcher.php?type=get_config_sqlite')
.then(response => response.json())
.then(data => {
config = data;
applyConfig(); // Apply immediately if elements are ready
window._nebuleairConfig = data;
applyConfig();
// Notify other scripts that config is ready
document.dispatchEvent(new CustomEvent('nebuleair-config-ready', { detail: data }));
})
.catch(error => console.error('Error loading config:', error));