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
|
* Global configuration handler for UI elements
|
||||||
* - Updates Topbar Logo based on device type
|
* - Updates Topbar Logo based on device type
|
||||||
* - Shows/Hides "Screen" sidebar tab 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', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
let config = null;
|
let config = null;
|
||||||
@@ -44,28 +42,17 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
if (navScreenElements.length > 0) {
|
if (navScreenElements.length > 0) {
|
||||||
navScreenElements.forEach(navScreen => {
|
navScreenElements.forEach(navScreen => {
|
||||||
if (isModuleAirPro) {
|
if (isModuleAirPro) {
|
||||||
|
// Ensure it's visible (bootstrap nav-link usually block or flex)
|
||||||
if (navScreen.style.display === 'none') {
|
if (navScreen.style.display === 'none') {
|
||||||
navScreen.style.display = 'flex';
|
navScreen.style.display = 'flex';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// Hide if not pro
|
||||||
if (navScreen.style.display !== 'none') {
|
if (navScreen.style.display !== 'none') {
|
||||||
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';
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -464,6 +464,11 @@ function wifi_scan(){
|
|||||||
document.getElementById('card-wifi-scan').style.display = '';
|
document.getElementById('card-wifi-scan').style.display = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update hotspot badge in sidebar
|
||||||
|
document.querySelectorAll('.sidebar-hotspot-badge').forEach(function(badge) {
|
||||||
|
badge.style.display = (data.WIFI_status === 'hotspot') ? '' : 'none';
|
||||||
|
});
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: 'launcher.php?type=RTC_time',
|
url: 'launcher.php?type=RTC_time',
|
||||||
dataType: 'text',
|
dataType: 'text',
|
||||||
|
|||||||
Reference in New Issue
Block a user