diff --git a/assets/css/style.css b/assets/css/style.css index 7cb544e..0ea46e2 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -308,8 +308,8 @@ body { transition: background 0.4s, box-shadow 0.4s, border-color 0.4s; pointer-events: none; } -/* Connected: bright green fill + white border โ€” visible on both dark and light backgrounds */ -.scale-status-connected .scale-status-dot { background: #4ade80; border-color: rgba(255,255,255,0.9); box-shadow: 0 0 0 1px rgba(0,0,0,0.2), 0 0 6px #4ade80bb; } +/* Connected: white fill + bright-green border ring โ€” clearly visible on any dark/green bg */ +.scale-status-connected .scale-status-dot { background: #ffffff; border-color: #4ade80; box-shadow: 0 0 0 1px rgba(0,0,0,0.25), 0 0 8px #4ade80cc, 0 0 2px #fff; } .scale-status-connected .scale-icon-emoji { filter: none; opacity: 1; } .scale-status-searching .scale-status-dot { background: #f59e0b; border-color: rgba(0,0,0,0.35); animation: scaleStatusPulse 1.4s infinite; } .scale-status-searching .scale-icon-emoji { filter: none; opacity: 0.85; } diff --git a/assets/js/app.js b/assets/js/app.js index d38b660..cb6d96e 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -290,6 +290,11 @@ function _scaleOnMessage(msg) { _scaleDevice = msg.device || null; _scaleBattery = msg.battery ?? null; _scaleUpdateStatus(_scaleConnected ? 'connected' : 'searching'); + // Update protocol info in settings diagnostic + if (msg.protocol) { + const protoEl = document.getElementById('scale-diag-proto'); + if (protoEl) protoEl.textContent = `๐Ÿ“ก ${msg.protocol}`; + } // Refresh all scale UI elements immediately so buttons/live-box appear // without requiring a manual page refresh updateScaleReadButtons(); @@ -322,6 +327,9 @@ function _scaleOnMessage(msg) { // Also update edit-form inline scale reading if visible const editLive = document.getElementById('edit-scale-reading'); if (editLive) editLive.textContent = `${msg.value} ${msg.unit || 'kg'}${liveMsg.stable ? ' โœ“' : ' โ€ฆ'}`; + // Update settings diagnostic live weight + const diagW = document.getElementById('scale-diag-weight'); + if (diagW) diagW.textContent = `${parseFloat(msg.value).toFixed(1)} ${msg.unit || 'g'}`; // Always update the persistent live box on the use page (every message, stable or not) _scaleUpdateLiveBox(liveMsg); // If weight is NOT stable: stop any running timer/bar but keep the sentinel value. @@ -803,6 +811,20 @@ function _scaleUpdateStatus(state) { error: `โš–๏ธ ${t('scale.status_error')}`, }; el.title = labels[state] || ''; + // Update settings live-diagnostic panel + const diag = document.getElementById('scale-live-diag'); + if (!diag) return; + diag.style.display = state === 'connected' ? '' : 'none'; + if (state === 'connected') { + const devEl = document.getElementById('scale-diag-device'); + const batEl = document.getElementById('scale-diag-battery'); + if (devEl) devEl.textContent = _scaleDevice || 'Dispositivo sconosciuto'; + if (batEl) batEl.textContent = _scaleBattery != null ? `๐Ÿ”‹ ${_scaleBattery}%` : ''; + const weightEl = document.getElementById('scale-diag-weight'); + if (weightEl && _scaleLatestWeight) { + weightEl.textContent = `${parseFloat(_scaleLatestWeight.value).toFixed(1)} ${_scaleLatestWeight.unit || 'g'}`; + } + } } /** @@ -2038,7 +2060,12 @@ async function loadSettingsUI() { function _kioskReconfigureScale() { if (typeof _kioskBridge === 'undefined') return; if (typeof _kioskBridge.reconfigureScale === 'function') { - _kioskBridge.reconfigureScale(); + try { _kioskBridge.reconfigureScale(); } catch(e) {} + } else { + // Kiosk APK is outdated โ€” show update notice + const notice = document.getElementById('kiosk-needs-update-notice'); + if (notice) notice.style.display = ''; + showToast('โš ๏ธ Aggiorna il kiosk per usare questa funzione', 'warning'); } } diff --git a/index.html b/index.html index a955387..27a3c05 100644 --- a/index.html +++ b/index.html @@ -11,7 +11,7 @@ EverShelf - + @@ -1042,6 +1042,12 @@

๐Ÿ“ก Bilancia BLE integrata nel Kiosk

La bilancia รจ gestita direttamente dal Gateway BLE interno al kiosk. Per abbinare un nuovo dispositivo usa il wizard di configurazione.

+ + @@ -1080,6 +1086,22 @@ + + +

๐Ÿ”Œ Protocolli BLE supportati: