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:
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user