Add named wall displays: pages, order and speed per screen
An administrator can make named displays (Hall TV, Office monitor) under Settings -> Share links, each with an address of its own (/wall/hall-tv), the pages it rotates through in the board's order, and a rotation speed. The signed-in wall opens one from its address and can switch between them, and a wall share link can open one too. The address still wins over the display's speed, then the browser's choice. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
639408c0d0
commit
333146e8e3
24 files changed
+10411
-22
No files matched your search
@@ -4,6 +4,7 @@ import { api, type PublicWall } from "../api/client";
|
||||
import WallView, { REFRESH_MS, wallHeadline, type WallData } from "../components/WallView";
|
||||
import { setDateTimeSettings } from "../utils/date";
|
||||
import { useWallRotation } from "../hooks/useWallRotation";
|
||||
import { t } from "../i18n";
|
||||
|
||||
/**
|
||||
* The wall display behind a share link: the same board, read-only and without signing in. The address carries the secret, and the
|
||||
@@ -16,7 +17,9 @@ export default function SharedWall() {
|
||||
const [state, setState] = useState<"loading" | "ok" | "dead" | "unreachable">("loading");
|
||||
const [updatedAt, setUpdatedAt] = useState<Date | null>(null);
|
||||
const [idle, setIdle] = useState(false);
|
||||
const rotation = useWallRotation();
|
||||
// The named display this link opens, once the board has been read: its pages and its speed.
|
||||
const [displayConfig, setDisplayConfig] = useState<PublicWall["displayConfig"]>(null);
|
||||
const rotation = useWallRotation(displayConfig?.rotateSeconds ?? null);
|
||||
|
||||
useEffect(() => {
|
||||
let alive = true;
|
||||
@@ -28,6 +31,7 @@ export default function SharedWall() {
|
||||
if (!alive) return;
|
||||
setDateTimeSettings({ dateFormat: w.display.dateFormat as "ymd" | "dmy" | "mdy", timeFormat: w.display.timeFormat as "24h" | "12h" });
|
||||
setWall(w);
|
||||
setDisplayConfig(w.displayConfig ?? null);
|
||||
setUpdatedAt(new Date());
|
||||
setState("ok");
|
||||
})
|
||||
@@ -103,6 +107,7 @@ export default function SharedWall() {
|
||||
<WallView
|
||||
data={data}
|
||||
idle={idle}
|
||||
display={displayConfig ? { name: displayConfig.name, pages: displayConfig.pages } : null}
|
||||
rotation={{ seconds: rotation.seconds, onChange: rotation.setSeconds }}
|
||||
footerActions={
|
||||
<button type="button" className="wall-link" onClick={() => void document.documentElement.requestFullscreen?.().catch(() => {})}>
|
||||
|
||||
Reference in new issue
Block a user