Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 1 | /** |
| status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas | 2 | * g1t's status lives at status.g1t.sh (apps/status), a Worker of its own |
| 3 | * that stays up when the site does not. The site only links to it, and | |
| 4 | * reads its JSON for the dot in the account menu and the footer. | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 5 | */ |
| status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas | 6 | import type { StatusOverallState, StatusReport } from "@g1t/contracts"; |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 7 | |
| status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas | 8 | export type { StatusOverallState as OverallState, StatusReport }; |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 9 | |
| status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas | 10 | /** The status page. */ |
| 11 | export const STATUS_URL = "https://status.g1t.sh"; | |
| 12 | /** Its report, as JSON, readable from any origin. */ | |
| 13 | export const STATUS_JSON_URL = `${STATUS_URL}/status.json`; | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 14 | |
| status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas | 15 | /** Two or three words for the whole, when the report has none. */ |
| 16 | export const STATUS_WORDS: Record<StatusOverallState, string> = { | |
| 17 | up: "All systems normal", | |
| 18 | degraded: "Partial outage", | |
| 19 | down: "Major outage", | |
| 20 | maintenance: "Under maintenance", | |
| 21 | unknown: "Status unknown", | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 22 | }; |
| 23 | ||
| status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas | 24 | /** The short line for the whole: the report's own title, else words for its state. */ |
| 25 | export function statusTitle(report: Pick<StatusReport, "overall"> | null | undefined): string | null { | |
| 26 | if (!report?.overall) return null; | |
| 27 | return report.overall.title || STATUS_WORDS[report.overall.state] || null; | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 28 | } |
| 29 | ||
| 30 | /** The dot's colour for a state, as a Tailwind background class. */ | |
| status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas | 31 | export function dotClass(state: string | null | undefined): string { |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 32 | switch (state) { |
| 33 | case "up": | |
| 34 | return "bg-accent"; | |
| 35 | case "degraded": | |
| 36 | return "bg-warn"; | |
| 37 | case "down": | |
| 38 | return "bg-danger"; | |
| status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas | 39 | case "maintenance": |
| 40 | return "bg-info"; | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 41 | default: |
| 42 | return "bg-faint"; | |
| 43 | } | |
| 44 | } |