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" export async function generateMetadata({ params, }: { params: Promise<{ locale: string }> }): Promise { const { locale } = await params const t = await getTranslations({ locale, namespace: "docs.network.configAnalysis.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/config-analysis", }, } } type DiffersRow = { aspect: string; bridge: string; config: string } type Step = { title: string; body: string; tone: "blue" | "amber" | "emerald" } type RelatedItem = { label: string; href: string; tail?: string; tailRich?: string } const TONE_CLASSES: Record = { blue: "border-blue-400 bg-blue-50", amber: "border-amber-400 bg-amber-50", emerald: "border-emerald-400 bg-emerald-50", } export default async function ConfigAnalysisPage({ params, }: { params: Promise<{ locale: string }> }) { const { locale } = await params setRequestLocale(locale) const t = await getTranslations({ locale, namespace: "docs.network.configAnalysis" }) const messages = (await getMessages({ locale })) as unknown as { docs: { network: { configAnalysis: { differs: { rows: DiffersRow[] } step2: { steps: Step[] } related: { items: RelatedItem[] } } } } } const differsRows = messages.docs.network.configAnalysis.differs.rows const cleanupSteps = messages.docs.network.configAnalysis.step2.steps const relatedItems = messages.docs.network.configAnalysis.related.items const code = (chunks: React.ReactNode) => {chunks} const strong = (chunks: React.ReactNode) => {chunks} const em = (chunks: React.ReactNode) => {chunks} const bridgeLink = (chunks: React.ReactNode) => ( {chunks} ) const persistentLink = (chunks: React.ReactNode) => ( {chunks} ) const link = bridgeLink return (
{t.rich("intro.body", { code, em })}

{t("differs.heading")}

{differsRows.map((row, idx) => ( ))}
{t("differs.headerAspect")} {t("differs.headerBridge")} {t("differs.headerConfig")}
{t.rich(`differs.rows.${idx}.aspect`, { code })} {t.rich(`differs.rows.${idx}.bridge`, { code })} {t.rich(`differs.rows.${idx}.config`, { code })}

{t.rich("differs.outro", { strong, link })}

{t("step1.heading")}

{t("step1.intro")}

{`🔍 NETWORK CONFIGURATION ANALYSIS
==================================================

📋 CONFIGURED INTERFACES
==============================
🔌 Interface: enp3s0
   ❌ Status: NOT FOUND
   âš ī¸  Issue: Configured but doesn't exist

🔌 Interface: eno1
   ✅ Status: EXISTS (UP)
   🌐 IP: 192.168.1.10/24
   â„šī¸  Type: Physical interface

🔌 Interface: vmbr0
   ✅ Status: EXISTS (UP)
   🌐 IP: 192.168.1.10/24
   â„šī¸  Type: Virtual interface (normal)

🔧 SUGGESTION FOR enp3s0:
   This interface is configured but doesn't exist physically
   Consider removing its configuration
   Command: sed -i '/iface enp3s0/,/^$/d' /etc/network/interfaces

📊 ANALYSIS SUMMARY
=========================
Interfaces configured: 3
Issues found: 1

âš ī¸  IMPORTANT: No changes have been made to your system
Use the Guided Cleanup option to fix issues safely`}
{t.rich("step1.virtBody", { code })}

{t("step2.heading")}

{t("step2.intro")}

{cleanupSteps.map((step, idx) => (
{step.title}

{t.rich(`step2.steps.${idx}.body`, { code, em, strong })}

))}
{t.rich("step2.noRestartBody", { code })}

{t("caveats.heading")}

{t.rich("caveats.boundaryBody", { code, strong })} {t.rich("caveats.tandemBody", { code, link: bridgeLink })}

{t("troubleshoot.heading")}

{t.rich("troubleshoot.notFoundBody", { code, link: persistentLink })} {t("troubleshoot.tooMuchBody")}
{`cp /var/backups/proxmenux/interfaces_backup_ /etc/network/interfaces`}
{t("troubleshoot.tooMuchOutro")}
{t.rich("troubleshoot.bridgeBreakBody", { code, link: bridgeLink })}

{t("related.heading")}

    {relatedItems.map((item) => (
  • {item.label} {item.tail}
  • ))}
) }