A NOC screen in its own window, for a second display

A button next to the speed controls opens this page at ?noc=<slot> in a
noopener pop-up, so it runs on its own thread. The window never claims the
slot, saves or runs a day. The game sends it a copy of S and R over a
BroadcastChannel, at most once a second and only while a window is connected,
and runs its clicks through an allowlist of the same ACT.* a click uses.

The window opens on a dark wallboard: a live world map of links and POPs,
traffic and money graphs, alarms, and the hottest ports with the dashboard's
own upgrade buttons (connUp). Clicking a POP filters the ports. Details shows
the full dashboard. Phones do not show the button.
This commit is contained in:
Christopher Hawker 2026-11-04 20:01:37 +11:00
parent c04fbe88b8
commit 80f671953a
18 changed files with 752 additions and 6 deletions

View file

@ -126,6 +126,7 @@
<button data-act="speed" data-args='{"v":4}' id="sp4">4×</button>
<button data-act="speed" data-args='{"v":8}' id="sp8">8×</button>
<button data-act="dash" aria-label="NOC dashboard" data-i18n-aria-label="common.noc_dashboard" title="NOC dashboard" data-i18n-title="common.noc_dashboard"><svg width="16" height="14" viewBox="0 0 16 14" aria-hidden="true"><path d="M1 13h14M2 10l4-5 3 3 5-6" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/></svg></button>
<button class="hide-sm" data-act="nocWindow" aria-label="Open the NOC dashboard in its own window" data-i18n-aria-label="noc.open_in_its_own_window" title="Open the NOC dashboard in its own window" data-i18n-title="noc.open_in_its_own_window"><svg width="17" height="14" viewBox="0 0 17 14" aria-hidden="true"><rect x="1" y="1" width="9" height="7" rx="1.5" fill="none" stroke="currentColor" stroke-width="2"/><rect x="7" y="6" width="9" height="7" rx="1.5" fill="currentColor"/></svg></button>
<button data-act="help" aria-label="How to play" data-i18n-aria-label="common.how_to_play">?</button>
<button data-act="mute" id="muteBtn" aria-label="Toggle sound" data-i18n-aria-label="common.toggle_sound">♪</button>
</div>