import type { Metadata } from "next" import { getTranslations, getMessages, setRequestLocale } from "next-intl/server" import { Link } from "@/i18n/navigation" import { DocHeader } from "@/components/ui/doc-header" import { Callout } from "@/components/ui/callout" import { DataFlowDiagram } from "@/components/ui/data-flow-diagram" export async function generateMetadata({ params, }: { params: Promise<{ locale: string }> }): Promise { const { locale } = await params const t = await getTranslations({ locale, namespace: "docs.network.persistentNames.meta" }) return { title: t("title"), description: t("description"), openGraph: { title: t("ogTitle"), description: t("ogDescription"), type: "article", url: "https://macrimi.github.io/ProxMenux/docs/network/persistent-names", }, } } type ScopeRow = { type: string; behaviour: string; why: string } type RelatedItem = { label: string; href: string; tail?: string; tailRich?: string } export default async function PersistentNamesPage({ params, }: { params: Promise<{ locale: string }> }) { const { locale } = await params setRequestLocale(locale) const t = await getTranslations({ locale, namespace: "docs.network.persistentNames" }) const messages = (await getMessages({ locale })) as unknown as { docs: { network: { persistentNames: { problem: { items: string[] } scope: { rows: ScopeRow[] } afterReboot: { items: string[] } related: { items: RelatedItem[] } } } } } const problemItems = messages.docs.network.persistentNames.problem.items const scopeRows = messages.docs.network.persistentNames.scope.rows const afterRebootItems = messages.docs.network.persistentNames.afterReboot.items const relatedItems = messages.docs.network.persistentNames.related.items const code = (chunks: React.ReactNode) => {chunks} const em = (chunks: React.ReactNode) => {chunks} return (
{t.rich("intro.body", { code, em })}

{t("problem.heading")}

{t.rich("problem.intro", { code, em })}

    {problemItems.map((_, idx) => (
  • {t.rich(`problem.items.${idx}`, { code })}
  • ))}

{t.rich("problem.outro", { code, em })}

{t("howWorks.heading")}

{t("howWorks.minimalIntro")}

{`# /etc/systemd/network/10-eno1.link
[Match]
MACAddress=aa:bb:cc:dd:ee:ff

[Link]
Name=eno1`}

{t.rich("howWorks.minimalOutro", { em, code })}

{t("scope.heading")}

{scopeRows.map((row, idx) => ( ))}
{t("scope.headerType")} {t("scope.headerBehaviour")} {t("scope.headerWhy")}
{row.type} {t.rich(`scope.rows.${idx}.behaviour`, { code })} {t.rich(`scope.rows.${idx}.why`, { code })}

{t("safety.heading")}

{t.rich("safety.intro", { code })}

{`/etc/systemd/network/backup-20260426-143012/
├── 10-eno1.link    (previous version)
└── 10-enp3s0.link  (previous version)`}

{t("safety.outro")}

{t.rich("safety.rebootBody", { code, em })}

{t("afterReboot.heading")}

{t("afterReboot.intro")}

    {afterRebootItems.map((_, idx) => (
  1. {t.rich(`afterReboot.items.${idx}`, { code })}
  2. ))}

{t("troubleshoot.heading")}

{t.rich("troubleshoot.emptyBody", { code })} {t.rich("troubleshoot.noChangeBody", { code })} {t.rich("troubleshoot.undoBody", { code })}

{t("related.heading")}

    {relatedItems.map((item, idx) => (
  • {item.label} {item.tailRich ? t.rich(`related.items.${idx}.tailRich`, { em }) : item.tail}
  • ))}
) }