import type { Metadata } from "next" import { getTranslations, getMessages, setRequestLocale } from "next-intl/server" import { Link } from "@/i18n/navigation" import Image from "next/image" import { Server, HardDrive } from "lucide-react" import { DocHeader } from "@/components/ui/doc-header" import { Callout } from "@/components/ui/callout" import CopyableCode from "@/components/CopyableCode" export async function generateMetadata({ params, }: { params: Promise<{ locale: string }> }): Promise { const { locale } = await params const t = await getTranslations({ locale, namespace: "docs.createVm.systemLinux.meta" }) return { title: t("title"), description: t("description"), openGraph: { title: t("ogTitle"), description: t("ogDescription"), type: "article", url: "https://macrimi.github.io/ProxMenux/docs/create-vm/system-linux", images: [ { url: "/vm/menu_linux.png", width: 1200, height: 630, alt: t("ogImageAlt"), }, ], }, } } type ConfigRow = { param: string; value?: string; valueRich?: string; options?: string; optionsRich?: string } type Distro = { name: string; variants: string[] } type StringItem = string type RelatedItem = { href: string; label: string; tail?: string } export default async function SystemLinuxPage({ params, }: { params: Promise<{ locale: string }> }) { const { locale } = await params setRequestLocale(locale) const t = await getTranslations({ locale, namespace: "docs.createVm.systemLinux" }) const messages = (await getMessages({ locale })) as unknown as { docs: { createVm: { systemLinux: { config: { defaultRows: ConfigRow[]; advancedRows: ConfigRow[] } storagePlan: { virtualDiskItems: StringItem[]; importDiskItems: StringItem[]; pciItems: StringItem[] } installOptions: { distros: Distro[] } endToEnd: { items: StringItem[] } postInstall: { trimItems: StringItem[] } related: { items: RelatedItem[] } } } } } const defaultRows = messages.docs.createVm.systemLinux.config.defaultRows const advancedRows = messages.docs.createVm.systemLinux.config.advancedRows const virtualDiskItems = messages.docs.createVm.systemLinux.storagePlan.virtualDiskItems const importDiskItems = messages.docs.createVm.systemLinux.storagePlan.importDiskItems const pciItems = messages.docs.createVm.systemLinux.storagePlan.pciItems const distros = messages.docs.createVm.systemLinux.installOptions.distros const endToEndItems = messages.docs.createVm.systemLinux.endToEnd.items const trimItems = messages.docs.createVm.systemLinux.postInstall.trimItems const relatedItems = messages.docs.createVm.systemLinux.related.items const code = (chunks: React.ReactNode) => {chunks} const strong = (chunks: React.ReactNode) => {chunks} const em = (chunks: React.ReactNode) => {chunks} const gpuLink = (chunks: React.ReactNode) => ( {chunks} ) return (
{t("intro.body")}
{t("image.alt")}
{t("image.caption")}

{t("config.heading")}

{t("config.intro")}

{t("config.defaultHeading")}

{defaultRows.map((row, idx) => ( ))}
{t("config.headerParam")} {t("config.headerValue")}
{row.param} {row.valueRich ? t.rich(`config.defaultRows.${idx}.valueRich`, { code }) : row.value}

{t("config.advancedHeading")}

{t("config.advancedIntro")}

{advancedRows.map((row, idx) => ( ))}
{t("config.headerParam")} {t("config.headerOptions")}
{row.param} {row.optionsRich ? t.rich(`config.advancedRows.${idx}.optionsRich`, { code }) : row.options}

{t("storagePlan.heading")}

{t.rich("storagePlan.body", { strong })}

{t("storagePlan.virtualDiskTitle")}

    {virtualDiskItems.map((_, idx) => (
  • {t.rich(`storagePlan.virtualDiskItems.${idx}`, { code })}
  • ))}

{t("storagePlan.importDiskTitle")}

    {importDiskItems.map((_, idx) => (
  • {t.rich(`storagePlan.importDiskItems.${idx}`, { code })}
  • ))}

{t("storagePlan.pciTitle")}

    {pciItems.map((_, idx) => (
  • {t.rich(`storagePlan.pciItems.${idx}`, { em, code })}
  • ))}
{t.rich("storagePlan.resetBody", { strong })}

{t("gpu.heading")}

{t.rich("gpu.body", { gpuLink })}

{t("autoFeatures.heading")}

{t("autoFeatures.efiTitle")}

{t("autoFeatures.efiBody")}

{t("autoFeatures.isoTitle")}

{t.rich("autoFeatures.isoBody", { code })}

{t("autoFeatures.guestTitle")}

{t("autoFeatures.guestBody")}

{t("installOptions.heading")}

{t("installOptions.officialHeading")}

{t.rich("installOptions.officialBody", { code })}

{distros.map((d) => (
{d.name}
    {d.variants.map((v) => (
  • {v}
  • ))}
))}
{t("installOptions.officialImageAlt")}
{t("installOptions.officialImageCaption")}

{t("installOptions.localHeading")}

{t.rich("installOptions.localBody", { code })}

{t("installOptions.localImageAlt")}
{t("installOptions.localImageCaption")}

{t("endToEnd.heading")}

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

{t("postInstall.heading")}

{t("postInstall.guestAgentHeading")}

{t("postInstall.guestAgentBody")}

{t("postInstall.debian")}

{t("postInstall.fedora")}

{t("postInstall.arch")}

{t("postInstall.opensuse")}

{t("postInstall.virtioHeading")}

{t.rich("postInstall.virtioBody", { code })}

{t("postInstall.virtioWarnBody")}

{t("postInstall.trimHeading")}

{t.rich("postInstall.trimBody", { code })}

    {trimItems.map((_, idx) => (
  • {t.rich(`postInstall.trimItems.${idx}`, { code })}
  • ))}

{t("postInstall.balloonHeading")}

{t.rich("postInstall.balloonBody", { code })}

{t("related.heading")}

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