diff --git a/web/src/app.css b/web/src/app.css index 312a964..4f32455 100644 --- a/web/src/app.css +++ b/web/src/app.css @@ -157,3 +157,12 @@ button:hover { .dim { color: #8b949e; } + +a { + color: #58a6ff; + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} diff --git a/web/src/lib/TunnelsTable.svelte b/web/src/lib/TunnelsTable.svelte index c630222..cc11899 100644 --- a/web/src/lib/TunnelsTable.svelte +++ b/web/src/lib/TunnelsTable.svelte @@ -1,6 +1,6 @@ @@ -8,16 +8,34 @@ - + {#if tunnels && tunnels.length > 0} {#each tunnels as tunnel (tunnel.id)} - + - + @@ -28,3 +46,14 @@ {/if}
HostnameStateRoutesVisitorsCert expiryCreatedHostnameStateURLsVisitorsCert expiryCreated
{tunnel.hostname} + + {tunnel.hostname} + + {tunnel.state}{fmtRoutes(tunnel.routes)} + {#if tunnel.routes && tunnel.routes.length > 0} + + {:else} + – + {/if} + {tunnel.visitors} {fmtDate(tunnel.certificate_expiry)} {fmtDate(tunnel.created_at)}
+ + diff --git a/web/src/lib/format.ts b/web/src/lib/format.ts index 50b6db8..2438253 100644 --- a/web/src/lib/format.ts +++ b/web/src/lib/format.ts @@ -15,3 +15,9 @@ export function fmtUptime(seconds: number): string { export function fmtRoutes(routes: string[] | null): string { return routes && routes.length > 0 ? routes.join(", ") : "–"; } + +// routeUrl is the public URL a route is served at: "@" is the tunnel +// hostname itself, any other route is a subdomain of it. +export function routeUrl(hostname: string, route: string): string { + return route === "@" ? `https://${hostname}` : `https://${route}.${hostname}`; +}