Fix: restaurer topbar-logo.js original (supprimer fetch config)
Le fetch get_config_sqlite dans topbar-logo.js au DOMContentLoaded saturait les 6 connexions par domaine du navigateur. Retour au topbar-logo.js v1.4.4 d'origine. Le badge hotspot est maintenant gere dans le window.onload de wifi.html. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,8 +3,6 @@
|
||||
* Global configuration handler for UI elements
|
||||
* - Updates Topbar Logo based on device type
|
||||
* - Shows/Hides "Screen" sidebar tab based on device type
|
||||
* - Updates sidebar device name
|
||||
* - Shows hotspot badge in sidebar when in hotspot mode
|
||||
*/
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
let config = null;
|
||||
@@ -44,28 +42,17 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
if (navScreenElements.length > 0) {
|
||||
navScreenElements.forEach(navScreen => {
|
||||
if (isModuleAirPro) {
|
||||
// Ensure it's visible (bootstrap nav-link usually block or flex)
|
||||
if (navScreen.style.display === 'none') {
|
||||
navScreen.style.display = 'flex';
|
||||
}
|
||||
} else {
|
||||
// Hide if not pro
|
||||
if (navScreen.style.display !== 'none') {
|
||||
navScreen.style.display = 'none';
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 3. Sidebar device name
|
||||
if (config.deviceName) {
|
||||
document.querySelectorAll('.sideBar_sensorName').forEach(el => {
|
||||
el.textContent = config.deviceName;
|
||||
});
|
||||
document.title = config.deviceName;
|
||||
}
|
||||
|
||||
// 4. Hotspot badge in sidebar
|
||||
document.querySelectorAll('.sidebar-hotspot-badge').forEach(badge => {
|
||||
badge.style.display = (config.WIFI_status === 'hotspot') ? '' : 'none';
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user