- New l4_proxy_hosts table and Drizzle migration (0015) - Full CRUD model layer with validation, audit logging, and Caddy config generation (buildL4Servers integrating into buildCaddyDocument) - Server actions, paginated list page, create/edit/delete dialogs - L4 port manager sidecar (docker/l4-port-manager) that auto-recreates the caddy container when port mappings change via a trigger file - Auto-detects Docker Compose project name from caddy container labels - Supports both named-volume and bind-mount (COMPOSE_HOST_DIR) deployments - getL4PortsStatus simplified: status file is sole source of truth, trigger files deleted after processing to prevent stuck 'Waiting' banner - Navigation entry added (CableIcon) - Tests: unit (entrypoint.sh invariants + validation), integration (ports lifecycle + caddy config), E2E (CRUD + functional routing) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
31 lines
935 B
TypeScript
31 lines
935 B
TypeScript
import L4ProxyHostsClient from "./L4ProxyHostsClient";
|
|
import { listL4ProxyHostsPaginated, countL4ProxyHosts } from "@/src/lib/models/l4-proxy-hosts";
|
|
import { requireAdmin } from "@/src/lib/auth";
|
|
|
|
const PER_PAGE = 25;
|
|
|
|
interface PageProps {
|
|
searchParams: Promise<{ page?: string; search?: string }>;
|
|
}
|
|
|
|
export default async function L4ProxyHostsPage({ searchParams }: PageProps) {
|
|
await requireAdmin();
|
|
const { page: pageParam, search: searchParam } = await searchParams;
|
|
const page = Math.max(1, parseInt(pageParam ?? "1", 10) || 1);
|
|
const search = searchParam?.trim() || undefined;
|
|
const offset = (page - 1) * PER_PAGE;
|
|
|
|
const [hosts, total] = await Promise.all([
|
|
listL4ProxyHostsPaginated(PER_PAGE, offset, search),
|
|
countL4ProxyHosts(search),
|
|
]);
|
|
|
|
return (
|
|
<L4ProxyHostsClient
|
|
hosts={hosts}
|
|
pagination={{ total, page, perPage: PER_PAGE }}
|
|
initialSearch={search ?? ""}
|
|
/>
|
|
);
|
|
}
|