overseer panel tweaking

This commit is contained in:
legop3
2026-05-19 21:12:57 -04:00
parent 8c2162d918
commit daa8942a29
6 changed files with 28 additions and 15 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -11,8 +11,8 @@
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" /> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="apple-mobile-web-app-title" content="Roomba Rover" /> <meta name="apple-mobile-web-app-title" content="Roomba Rover" />
<title>Roomba Rover</title> <title>Roomba Rover</title>
<script type="module" crossorigin src="/assets/index-BD2vTGND.js"></script> <script type="module" crossorigin src="/assets/index-DqLb03wK.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-DTyQMQGe.css"> <link rel="stylesheet" crossorigin href="/assets/index-CE66iX-R.css">
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>
@@ -104,7 +104,10 @@ function buildVoteStatus() {
const sockets = Array.from(io.sockets.sockets.values()); const sockets = Array.from(io.sockets.sockets.values());
let yesCount = 0; let yesCount = 0;
let noCount = 0; let noCount = 0;
let eligibleCount = 0;
sockets.forEach((socket) => { sockets.forEach((socket) => {
if (getRole(socket) === 'spectator') return;
eligibleCount += 1;
const pref = socket?.data?.overseerEnabled; const pref = socket?.data?.overseerEnabled;
if (typeof pref === 'boolean' ? pref : true) yesCount += 1; if (typeof pref === 'boolean' ? pref : true) yesCount += 1;
else noCount += 1; else noCount += 1;
@@ -115,6 +118,7 @@ function buildVoteStatus() {
yesCount, yesCount,
noCount, noCount,
onlineCount, onlineCount,
eligibleCount,
gatePassed, gatePassed,
running: Boolean(enabled && gatePassed && getMode() !== MODES.LOCKDOWN), running: Boolean(enabled && gatePassed && getMode() !== MODES.LOCKDOWN),
}; };
@@ -22,21 +22,30 @@ export default function OverseerPreferencePanel() {
}; };
return ( return (
<section className="surface p-1 text-xs text-slate-200"> <section className="surface p-1.5 text-xs text-slate-200">
<div className="flex items-center justify-between gap-2"> <div className="space-y-1">
<label className="inline-flex items-center gap-1.5"> <div className="text-[0.65rem] font-semibold uppercase tracking-wide text-slate-400">Overseer Vote</div>
<label className="flex items-center gap-2 rounded border border-slate-700/70 bg-slate-900/60 px-2 py-1.5">
<input type="checkbox" checked={enabled} onChange={onToggle} /> <input type="checkbox" checked={enabled} onChange={onToggle} />
<span>Overseer vote</span> <span className="text-slate-100">Enable Overseer for me</span>
</label> </label>
<span className={running ? 'text-emerald-300' : 'text-slate-400'}>
running: {running ? 'yes' : 'no'}
</span>
</div> </div>
<div className="mt-1 text-[0.65rem] text-slate-400">
yes {Number(vote?.yesCount || 0)} / no {Number(vote?.noCount || 0)} / online {Number(vote?.onlineCount || 0)} <div className="mt-1.5 grid grid-cols-2 gap-1">
<div className="rounded border border-slate-700/70 bg-slate-900/50 px-2 py-1">
<div className="text-[0.6rem] uppercase tracking-wide text-slate-500">Running</div>
<div className={running ? 'font-semibold text-emerald-300' : 'font-semibold text-slate-300'}>
{running ? 'YES' : 'NO'}
</div>
</div>
<div className="rounded border border-slate-700/70 bg-slate-900/50 px-2 py-1">
<div className="text-[0.6rem] uppercase tracking-wide text-slate-500">Your vote</div>
<div className="font-semibold text-slate-200">{(sessionIdentity?.overseerEnabled ?? enabled) ? 'YES' : 'NO'}</div>
</div>
</div> </div>
<div className="mt-0.5 text-[0.65rem] text-slate-500">
your vote: {(sessionIdentity?.overseerEnabled ?? enabled) ? 'yes' : 'no'} <div className="mt-1.5 rounded border border-slate-700/70 bg-slate-900/50 px-2 py-1 text-[0.65rem] text-slate-400">
yes {Number(vote?.yesCount || 0)} / no {Number(vote?.noCount || 0)} / online {Number(vote?.eligibleCount || vote?.onlineCount || 0)}
</div> </div>
</section> </section>
); );