UI_REDESIGN chunk 4 was never finished: 39 app/component files still used raw Tailwind greys, kept readable in light mode only by the !important override sheet. In dark mode text-gray-600 is ~2.3:1 on surface, and the light override maps it to #94a3b8 (~2.6:1 on white) — unreadable in both. Mechanical mapping (886 classes): gray-100/200 -> ink, 300/400 -> ink-2, 500/600/700 -> ink-muted, bg 950/900/800 -> page/surface/raised, border 800 -> line, 700/600 -> line-strong, plus hover/divide/placeholder. Alpha suffixes kept (tokens are color-mix, so /60 works). bg-gray-700, text-white and marketing pages left alone. text-[9px] -> text-[10px]. Frontend unverified: no Node on the authoring box (#207). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
60 lines
2.8 KiB
TypeScript
60 lines
2.8 KiB
TypeScript
import type { RadioChannel } from "@/lib/types";
|
|
|
|
// node-26#24. A node on a conventional system reports each channel it
|
|
// decodes and whether the agency encrypts it — the one decode failure nothing
|
|
// on the node can fix, so it has to be said plainly here.
|
|
const ALGIDS: Record<number, string> = {
|
|
0x81: "DES-OFB", 0x83: "Triple DES", 0x84: "AES-256", 0x85: "AES-128",
|
|
0x9f: "DES-XL", 0xa0: "DVI-XL", 0xa1: "DVP-XL", 0xaa: "ADP (RC4)",
|
|
};
|
|
|
|
function mhz(hz: number | null): string {
|
|
return hz ? `${(hz / 1e6).toFixed(4)} MHz` : "";
|
|
}
|
|
|
|
function hex(n: number, width: number): string {
|
|
return n.toString(16).toUpperCase().padStart(width, "0");
|
|
}
|
|
|
|
export function RadioChannels({ channels }: { channels?: RadioChannel[] | null }) {
|
|
if (!channels || channels.length === 0) return null;
|
|
const encrypted = channels.filter((c) => c.encrypted);
|
|
// "Reassign the node" only when nothing in the clear has ever been heard on
|
|
// any channel — `encrypted` alone means the most recent call was.
|
|
const all = encrypted.length === channels.length && channels.every((c) => c.clear_calls === 0);
|
|
const subject = all
|
|
? channels.length === 1 ? "This channel is" : "Every channel is"
|
|
: `${encrypted.length} of ${channels.length} channels ${encrypted.length === 1 ? "is" : "are"} now`;
|
|
return (
|
|
<section>
|
|
<h2 className="text-sm font-semibold text-ink-2 uppercase tracking-wider mb-3">Conventional Channels</h2>
|
|
{encrypted.length > 0 && (
|
|
<p role="status" className="text-xs text-red-300 bg-red-950 border border-red-900 rounded-lg px-3 py-2 mb-3 font-mono">
|
|
{subject} encrypted — those calls can't be decoded, so nothing from{" "}
|
|
{encrypted.length === 1 ? "it" : "them"} is recorded. Nothing to fix on the node
|
|
{all ? "; assign this node a different system." : "; clear calls are still recorded."}
|
|
</p>
|
|
)}
|
|
<ul className="space-y-1 font-mono text-xs">
|
|
{channels.map((c, i) => (
|
|
<li key={i} className="flex flex-wrap gap-x-3 text-ink-2">
|
|
<span className="text-white">{c.name || mhz(c.freq)}</span>
|
|
{c.name && <span className="text-ink-muted">{mhz(c.freq)}</span>}
|
|
{c.nac != null && <span className="text-ink-muted">NAC {hex(c.nac, 3)}</span>}
|
|
{c.encrypted ? (
|
|
<span className="text-red-400">
|
|
✕ Encrypted{c.algid != null ? ` · ${ALGIDS[c.algid] ?? `ALGID ${hex(c.algid, 2)}`}` : ""}
|
|
{c.keyid != null ? ` · key ${hex(c.keyid, 4)}` : ""}
|
|
</span>
|
|
) : (
|
|
<span className="text-ink-2">
|
|
{c.clear_calls > 0 ? `Clear · ${c.clear_calls} calls heard` : "No traffic heard yet"}
|
|
</span>
|
|
)}
|
|
</li>
|
|
))}
|
|
</ul>
|
|
</section>
|
|
);
|
|
}
|