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.bridgeAnalysis.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/bridge-analysis", }, } } 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 BridgeAnalysisPage({ params, }: { params: Promise<{ locale: string }> }) { const { locale } = await params setRequestLocale(locale) const t = await getTranslations({ locale, namespace: "docs.network.bridgeAnalysis" }) const messages = (await getMessages({ locale })) as unknown as { docs: { network: { bridgeAnalysis: { when: { items: string[] } step1: { items: string[] } step2: { steps: Step[] } related: { items: RelatedItem[] } } } } } const whenItems = messages.docs.network.bridgeAnalysis.when.items const step1Items = messages.docs.network.bridgeAnalysis.step1.items const repairSteps = messages.docs.network.bridgeAnalysis.step2.steps const relatedItems = messages.docs.network.bridgeAnalysis.related.items const code = (chunks: React.ReactNode) => {chunks} const strong = (chunks: React.ReactNode) => {chunks} const em = (chunks: React.ReactNode) => {chunks} const persistentLink = (chunks: React.ReactNode) => ( {chunks} ) const configLink = (chunks: React.ReactNode) => ( {chunks} ) return (
{t.rich("intro.body", { code, strong })}

{t("when.heading")}

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

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

{t.rich("when.outro", { link: persistentLink })}

{t("bigPicture.heading")}

{t("step1.heading")}

{t.rich("step1.intro", { strong })}

    {step1Items.map((_, idx) => (
  • {t.rich(`step1.items.${idx}`, { code })}
  • ))}
{`🔍 BRIDGE CONFIGURATION ANALYSIS
==================================================

🌉 Bridge: vmbr0
   📍 Status: DOWN
   🌐 IP: No IP assigned
   🔌 Configured Ports: enp3s0
   ❌ Port enp3s0: NOT FOUND

🔧 SUGGESTION FOR vmbr0:
   Replace invalid port(s) 'enp3s0' with: eno1
   Command: sed -i 's/bridge-ports.*/bridge-ports eno1/' /etc/network/interfaces

📊 ANALYSIS SUMMARY
=========================
Bridges analyzed: 1
Issues found: 1
Physical interfaces available: 2

⚠️  IMPORTANT: No changes have been made to your system
Use the Guided Repair option to fix issues safely`}
{t.rich("step1.readonlyBody", { code })}

{t("step2.heading")}

{t("step2.intro")}

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

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

))}
{t.rich("step2.restartBody", { code, em })}

{t("edits.heading")}

{t.rich("edits.body", { code, link: configLink })}

{t("troubleshoot.heading")}

{t.rich("troubleshoot.unsupportedBody", { code })} {t.rich("troubleshoot.noSuggestBody", { code, em })} {t.rich("troubleshoot.stillDownBody", { code })} {t("troubleshoot.lostSshIntro")}
{`cp /var/backups/proxmenux/interfaces_backup_ /etc/network/interfaces
systemctl restart networking`}
{t("troubleshoot.lostSshOutro")}

{t("related.heading")}

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