feat: show meter fill percentage in dashboard status

Made-with: Cursor
This commit is contained in:
cottongin
2026-03-20 15:03:16 -04:00
parent 7a2f8419d5
commit 4c56b7f8f9

6
js/controls.js vendored
View File

@@ -68,8 +68,10 @@ export function initControls(manager, wsClient, components) {
const s = info?.status;
if (!s || typeof s !== 'object') return '—';
if (name === 'roomCode') {
const rc = /** @type {{ active?: boolean, roomCode?: string }} */ (s);
return rc.active ? `Active (${rc.roomCode ?? ''})` : 'Inactive';
const rc = /** @type {{ active?: boolean, roomCode?: string, meterFill?: number }} */ (s);
if (!rc.active) return 'Inactive';
const meter = rc.meterFill != null ? ` | Meter: ${rc.meterFill}%` : '';
return `Active (${rc.roomCode ?? ''})${meter}`;
}
if (name === 'audio') {
const a = /** @type {{ active?: boolean, playing?: boolean }} */ (s);