import Link from "next/link" import { Suspense } from "react" import { env } from "@/lib/env" import { listRecords } from "@/lib/records" import { applyConfigAction, deleteRecordAction, toggleRecordAction } from "./actions" import { ApplyButton } from "./_components/ApplyButton" import { disableButtonClass, enableButtonClass, secondaryButtonClass, } from "./_components/button-styles" import { DeleteButton } from "./_components/DeleteButton" export const metadata = { title: "域名记录" } const cardClass = "rounded-lg border border-black/10 p-4 dark:border-white/15" // Status is shown as a tag rather than plain text so the column can be skimmed without // reading the label. The dot carries the same meaning for anyone who cannot tell the two // greens/zincs apart. const statusTagBase = "inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium ring-1 ring-inset" const statusTagEnabled = `${statusTagBase} bg-emerald-50 text-emerald-700 ring-emerald-600/20 dark:bg-emerald-500/10 dark:text-emerald-400 dark:ring-emerald-500/20` const statusTagDisabled = `${statusTagBase} bg-zinc-100 text-zinc-600 ring-zinc-500/20 dark:bg-white/5 dark:text-zinc-400 dark:ring-white/15` const statusDotEnabled = "size-1.5 rounded-full bg-emerald-500 dark:bg-emerald-400" const statusDotDisabled = "size-1.5 rounded-full bg-zinc-400 dark:bg-zinc-500" export default function RecordsPage() { return (

域名记录

记录保存在 SQLite 中,修改后需要「应用并重启」才会写入 dnsmasq 配置。

新增记录

生效

配置文件:{env.confPath} · 目标容器:{env.containerName}

加载中…

}>
) } async function RecordTable() { const records = await listRecords() if (records.length === 0) { return (

还没有任何记录,点右上角「新增记录」开始。

) } return (
{records.map((record) => ( ))}
域名 类型 目标值 状态 备注 操作
{record.domain} {record.type} {record.value} {record.comment || "—"}
编辑
) }