Files
cobble/src/utils/computer-view-url.ts
T
tbenandClaude Opus 5.5 c44048dbab Add bot schedules (routines), open Activity, add Help and a Desktop computer view
Bots create, list, update and delete schedules (cron_jobs, Bun.cron in UTC);
a per-minute cron queues due runs as tasks. Routines, Activity (super admins)
and Help get their own rail aside. Help covers familiar problems, starting
with signing in to Google through Cookie-Editor over the new Desktop (noVNC)
view.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 10:52:32 +01:00

22 lines
617 B
TypeScript

import {
ComputerProxyPrefix,
ComputerViewModes,
type ComputerViewMode,
} from "@/src/dict/computer-dict";
type Params = {
computer_id: number | string;
mode: ComputerViewMode;
};
/**
* The app address of one of a computer's modes, e.g.
* `/computers/3/terminal`, with `{prefix}` in its path filled in.
*/
export default function computerViewUrl({ computer_id, mode }: Params) {
const base = `${ComputerProxyPrefix}/${computer_id}/`;
const path = ComputerViewModes.find((m) => m.value == mode)?.path || "";
return `${base}${path.replace("{prefix}", base.replace(/^\//, ""))}`;
}