Dashboard: public routes link to their public URL; drop editable behavior field

- Gateway route table: a public route's address now links to its public URL
  (green, with the tunnel icon) instead of the internal one.
- Program detail: remove the editable `behavior` selector — behavior is a derived
  label now and drives no logic, so editing it was meaningless (the stored value
  is preserved on save via the manifest spread).
This commit is contained in:
2026-07-01 08:35:37 -07:00
parent e9b197756b
commit fa65ae3d1c
2 changed files with 23 additions and 37 deletions

View File

@@ -89,30 +89,29 @@ export function GatewayPanel({ gateway, statuses }: GatewayPanelProps) {
className="border-b border-[var(--border)] last:border-b-0 hover:bg-black/20 transition-colors"
>
<td className="px-4 py-2 font-mono text-[var(--primary)]">
{url ? (
<a
href={url}
target="_blank"
rel="noopener noreferrer"
className="inline-flex items-center gap-1 hover:underline"
>
{route.address}
<ExternalLink size={11} className="opacity-60 shrink-0" />
</a>
) : (
route.address
)}
{route.public_url && (
<a
href={route.public_url}
target="_blank"
rel="noopener noreferrer"
title={route.public_url}
className="ml-2 inline-flex items-center gap-1 text-[0.65rem] px-1.5 py-0.5 rounded bg-green-500/15 text-green-500 hover:bg-green-500/25"
>
<Cable size={10} /> public
</a>
)}
{(() => {
// A public route links to its public URL; otherwise the
// internal subdomain URL.
const primaryUrl = route.public_url || url
const isPublic = !!route.public_url
return primaryUrl ? (
<a
href={primaryUrl}
target="_blank"
rel="noopener noreferrer"
title={primaryUrl}
className={`inline-flex items-center gap-1 hover:underline ${
isPublic ? "text-green-500" : ""
}`}
>
{isPublic && <Cable size={11} className="shrink-0" />}
{route.address}
<ExternalLink size={11} className="opacity-60 shrink-0" />
</a>
) : (
route.address
)
})()}
</td>
<td className="px-4 py-2">
<KindBadge kind={route.kind} />