mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-06-01 04:54:42 +00:00
5ca3463bf6
Full rewrite of the docs site under app/[locale]/ with next-intl in localePrefix:"always" mode. Every page now exists at both /en/<path> and /es/<path>; the root / shows a meta-refresh + JS redirect to /<defaultLocale>/ so GitHub Pages serves something on the apex URL. Highlights: - 107 doc pages migrated to file-per-page JSON namespaces under messages/en/ and messages/es/. Spanish content is fully translated (no copy-of-English placeholders). - New documentation for the Active Suppressions section in the Settings tab and the per-event Dismiss dropdown in the Health Monitor modal. - New screenshots: dismiss-duration-dropdown.png and an updated health-suppression-settings.png. - Pagefind integrated for client-side search; index is built on every CI deploy (not committed). - RSS feeds: per-locale at /<locale>/rss.xml plus root /rss.xml for backward compat. - Removed the dead app/[locale]/guides/[slug]/ route — every guide now has its own static page and no markdown source remains. - Fixed orphan link /guides/nvidia -> /guides/nvidia-manual in docs/hardware/nvidia-host. - Removed obsolete components (footer2, calendar, drawer). Verified locally with `npm ci && npm run build`: 2804 files in out/, 231 pages indexed by pagefind, root redirect intact, both locale roots and the new Active Suppressions docs render OK.
86 lines
2.7 KiB
TypeScript
86 lines
2.7 KiB
TypeScript
"use client"
|
|
|
|
import React, { useState } from "react"
|
|
import { Copy, Check } from "lucide-react"
|
|
|
|
export interface CommandEntry {
|
|
command: string
|
|
description: string
|
|
}
|
|
|
|
export interface CommandGroup {
|
|
title: string
|
|
commands: CommandEntry[]
|
|
}
|
|
|
|
interface CommandTableProps {
|
|
groups: CommandGroup[]
|
|
}
|
|
|
|
function CopyButton({ text }: { text: string }) {
|
|
const [copied, setCopied] = useState(false)
|
|
|
|
const copyToClipboard = () => {
|
|
navigator.clipboard.writeText(text)
|
|
setCopied(true)
|
|
setTimeout(() => setCopied(false), 2000)
|
|
}
|
|
|
|
return (
|
|
<button
|
|
type="button"
|
|
onClick={copyToClipboard}
|
|
aria-label={copied ? "Copied" : "Copy to clipboard"}
|
|
className="inline-flex items-center gap-1 rounded-md border border-gray-200 bg-white px-2 py-1 text-xs text-gray-600 hover:border-blue-300 hover:bg-blue-50 hover:text-blue-700 transition-colors"
|
|
>
|
|
{copied ? (
|
|
<>
|
|
<Check className="h-3.5 w-3.5 text-emerald-600" aria-hidden />
|
|
<span>Copied</span>
|
|
</>
|
|
) : (
|
|
<>
|
|
<Copy className="h-3.5 w-3.5" aria-hidden />
|
|
<span>Copy</span>
|
|
</>
|
|
)}
|
|
</button>
|
|
)
|
|
}
|
|
|
|
export const CommandTable: React.FC<CommandTableProps> = ({ groups }) => {
|
|
return (
|
|
<div className="space-y-8">
|
|
{groups.map((group, gi) => (
|
|
<section key={gi}>
|
|
<h2 className="text-xl font-semibold mt-6 mb-3 text-gray-900">{group.title}</h2>
|
|
<div className="overflow-x-auto">
|
|
<table className="w-full text-sm border border-gray-200 rounded-md">
|
|
<thead className="bg-gray-50 text-gray-900">
|
|
<tr>
|
|
<th className="text-left px-3 py-2 border-b border-gray-200 w-2/5">Command</th>
|
|
<th className="text-left px-3 py-2 border-b border-gray-200">Description</th>
|
|
<th className="text-left px-3 py-2 border-b border-gray-200 w-24">Action</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody className="text-gray-800">
|
|
{group.commands.map((cmd, ci) => (
|
|
<tr key={ci} className="border-b border-gray-100 last:border-b-0">
|
|
<td className="px-3 py-2 align-top font-mono text-xs whitespace-pre-wrap break-all">
|
|
{cmd.command}
|
|
</td>
|
|
<td className="px-3 py-2 align-top text-gray-700">{cmd.description}</td>
|
|
<td className="px-3 py-2 align-top">
|
|
<CopyButton text={cmd.command} />
|
|
</td>
|
|
</tr>
|
|
))}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</section>
|
|
))}
|
|
</div>
|
|
)
|
|
}
|