feat: show meter fill percentage in dashboard status
Made-with: Cursor
This commit is contained in:
6
js/controls.js
vendored
6
js/controls.js
vendored
@@ -68,8 +68,10 @@ export function initControls(manager, wsClient, components) {
|
|||||||
const s = info?.status;
|
const s = info?.status;
|
||||||
if (!s || typeof s !== 'object') return '—';
|
if (!s || typeof s !== 'object') return '—';
|
||||||
if (name === 'roomCode') {
|
if (name === 'roomCode') {
|
||||||
const rc = /** @type {{ active?: boolean, roomCode?: string }} */ (s);
|
const rc = /** @type {{ active?: boolean, roomCode?: string, meterFill?: number }} */ (s);
|
||||||
return rc.active ? `Active (${rc.roomCode ?? ''})` : 'Inactive';
|
if (!rc.active) return 'Inactive';
|
||||||
|
const meter = rc.meterFill != null ? ` | Meter: ${rc.meterFill}%` : '';
|
||||||
|
return `Active (${rc.roomCode ?? ''})${meter}`;
|
||||||
}
|
}
|
||||||
if (name === 'audio') {
|
if (name === 'audio') {
|
||||||
const a = /** @type {{ active?: boolean, playing?: boolean }} */ (s);
|
const a = /** @type {{ active?: boolean, playing?: boolean }} */ (s);
|
||||||
|
|||||||
Reference in New Issue
Block a user