| ... | @@ -2,7 +2,7 @@ import type { ServerConfig } from "@t3tools/contracts"; | ... | @@ -2,7 +2,7 @@ import type { ServerConfig } from "@t3tools/contracts"; |
| 2 | import * as Option from "effect/Option"; | 2 | import * as Option from "effect/Option"; |
| 3 | | 3 | |
| 4 | import type { ConnectionCatalogEntry } from "./catalog.ts"; | 4 | import type { ConnectionCatalogEntry } from "./catalog.ts"; |
| 5 | import type { NetworkStatus, SupervisorConnectionState } from "./model.ts"; | 5 | import type { SupervisorConnectionState } from "./model.ts"; |
| 6 | | 6 | |
| 7 | export type EnvironmentConnectionPhase = | 7 | export type EnvironmentConnectionPhase = |
| 8 | | "available" | 8 | | "available" |
| ... | @@ -105,25 +105,3 @@ export function connectionCatalogDisplayUrl(entry: ConnectionCatalogEntry): stri | ... | @@ -105,25 +105,3 @@ export function connectionCatalogDisplayUrl(entry: ConnectionCatalogEntry): stri |
| 105 | : null; | 105 | : null; |
| 106 | } | 106 | } |
| 107 | } | 107 | } |
| 108 | | | |
| 109 | export function connectionPhaseMessage( | | |
| 110 | phase: EnvironmentConnectionPhase, | | |
| 111 | label: string, | | |
| 112 | networkStatus: NetworkStatus, | | |
| 113 | ): string { | | |
| 114 | if (networkStatus === "offline" || phase === "offline") { | | |
| 115 | return "You are offline"; | | |
| 116 | } | | |
| 117 | switch (phase) { | | |
| 118 | case "available": | | |
| 119 | return "Available"; | | |
| 120 | case "connecting": | | |
| 121 | return `Connecting to ${label}...`; | | |
| 122 | case "reconnecting": | | |
| 123 | return `Reconnecting to ${label}...`; | | |
| 124 | case "connected": | | |
| 125 | return "Connected"; | | |
| 126 | case "error": | | |
| 127 | return "Connection failed"; | | |
| 128 | } | | |
| 129 | } | | |