Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

showcaseEnvironmentRows.ts

70 lines2.2 KB

1import { EnvironmentId } from "@t3tools/contracts";
2​
3import type { RelayEnvironmentView } from "../connection/useConnectionController";
4import type { ConnectedEnvironmentSummary } from "../../state/remote-runtime-types";
5​
6const SHOWCASE_LOCAL_ENVIRONMENT_DISPLAY_URLS: Readonly<Record<string, string>> = {
7 "Moonbase Terminal": "https://moonbase.tail9f3a.ts.net/",
8 "Suspense Station": "https://suspense-vps.hel1.t3.sh/",
9 "Kernel Cabin": "http://100.82.16.5:3773/",
10};
11​
12export function applyShowcaseLocalEnvironmentDisplayUrls(
13 environments: ReadonlyArray<ConnectedEnvironmentSummary>,
14): ReadonlyArray<ConnectedEnvironmentSummary> {
15 return environments.map((environment) => ({
16 ...environment,
17 displayUrl:
18 SHOWCASE_LOCAL_ENVIRONMENT_DISPLAY_URLS[environment.environmentLabel] ??
19 environment.displayUrl,
20 }));
22​
23export function resolveShowcaseEnvironmentUpdateDisplayUrl(input: {
24 readonly actualDisplayUrl: string;
25 readonly presentedDisplayUrl: string;
26 readonly submittedDisplayUrl: string;
27}): string {
28 return input.submittedDisplayUrl === input.presentedDisplayUrl
29 ? input.actualDisplayUrl
30 : input.submittedDisplayUrl;
32​
33const pocketPiId = EnvironmentId.make("showcase-pocket-pi");
34const pocketPiEndpoint = {
35 httpBaseUrl: "https://pocket-pi.t3.sh",
36 wsBaseUrl: "wss://pocket-pi.t3.sh",
37 providerKind: "t3_relay" as const,
38};
39​
40export const SHOWCASE_CONNECTED_CLOUD_ENVIRONMENTS: ReadonlyArray<ConnectedEnvironmentSummary> = [
41 {
42 environmentId: EnvironmentId.make("showcase-aurora-gpu"),
43 environmentLabel: "Aurora GPU Pod",
44 displayUrl: "https://aurora-gpu.t3.sh",
45 isRelayManaged: true,
46 connectionState: "connected",
47 connectionError: null,
48 connectionErrorTraceId: null,
49 },
50];
51​
52export const SHOWCASE_AVAILABLE_CLOUD_ENVIRONMENTS: ReadonlyArray<RelayEnvironmentView> = [
53 {
54 environment: {
55 environmentId: pocketPiId,
56 label: "Pocket Pi",
57 endpoint: pocketPiEndpoint,
58 linkedAt: "2026-07-16T08:00:00.000Z",
59 },
60 availability: "online",
61 status: {
62 environmentId: pocketPiId,
63 endpoint: pocketPiEndpoint,
64 status: "online",
65 checkedAt: "2026-07-16T08:41:00.000Z",
66 },
67 error: null,
68 traceId: null,
69 },
70];