Dashboard UI: subdomain checkbox, drop proxy path/host

Follow the backend to the subdomain-only model:
- Service editor + create form: replace the Proxy path / Proxy host text fields
  with a single "Expose" checkbox (writes proxy: { caddy: {} } or removes proxy).
- ServiceSummary/DeploymentSummary type: proxy_path/proxy_host → subdomain.
- ServiceCard / ServiceDetail: show the subdomain, linking to
  <subdomain>.<domain> via a new subdomainUrl() helper (domain derived from the
  dashboard's own host; null on a bare host / off mode).
This commit is contained in:
2026-06-30 20:55:38 -07:00
parent 43ef1cc588
commit 15dc8ef6f7
6 changed files with 54 additions and 60 deletions

View File

@@ -1,7 +1,7 @@
import { useParams, Link } from "react-router-dom"
import { Server, ExternalLink, Terminal } from "lucide-react"
import { useService, useStatus, useEventStream, useCaddyfile } from "@/services/api/hooks"
import { runnerLabel } from "@/lib/labels"
import { runnerLabel, subdomainUrl } from "@/lib/labels"
import { HealthBadge } from "@/components/HealthBadge"
import { LogViewer } from "@/components/LogViewer"
import { DetailHeader } from "@/components/detail/DetailHeader"
@@ -68,23 +68,17 @@ export function ServiceDetailPage() {
<span className="font-mono break-all">{deployment.health_path}</span>
</>
)}
{deployment.proxy_path && (
{deployment.subdomain && (
<>
<span className="text-[var(--muted)]">Proxy</span>
<span className="text-[var(--muted)]">Subdomain</span>
<a
href={deployment.proxy_path + "/"}
href={subdomainUrl(deployment.subdomain) ?? undefined}
className="flex items-center gap-1 min-w-0 break-all text-[var(--primary)] hover:underline font-mono"
>
<ExternalLink size={12} className="shrink-0" />{deployment.proxy_path}
<ExternalLink size={12} className="shrink-0" />{deployment.subdomain}
</a>
</>
)}
{deployment.proxy_host && (
<>
<span className="text-[var(--muted)]">Host</span>
<span className="font-mono break-all">{deployment.proxy_host}</span>
</>
)}
{deployment.runner && (
<>
<span className="text-[var(--muted)]">Runs</span>