/** * Jail detail page. * * Fetches and displays the full configuration and state of a single jail * identified by the `:name` route parameter. */ import { Button, MessageBar, MessageBarBody, Spinner, Text, makeStyles } from "@fluentui/react-components"; import { ArrowLeftRegular } from "@fluentui/react-icons"; import { Link, useParams } from "react-router-dom"; import { useJailData } from "../hooks/useJailData"; import { useJailCommands } from "../hooks/useJailCommands"; import { useJailBannedIps } from "../hooks/useJailBannedIps"; import { BannedIpsSection } from "../components/jail/BannedIpsSection"; import { JailInfoSection } from "../components/jail/JailInfoSection"; import { PatternsSection } from "../components/jail/PatternsSection"; import { BantimeEscalationSection } from "../components/jail/BantimeEscalationSection"; import { IgnoreListSection } from "../components/jail/IgnoreListSection"; import { useJailDetailPageStyles } from "../components/jail/jailDetailPageStyles"; const useLinkStyles = makeStyles({ link: { textDecoration: "none", }, }); export function JailDetailPage(): React.JSX.Element { const linkStyles = useLinkStyles(); const styles = useJailDetailPageStyles(); const { name = "" } = useParams<{ name: string }>(); const { jail, ignoreList, ignoreSelf, loading, error, refresh } = useJailData(name); const { addIp, removeIp, toggleIgnoreSelf, start, stop, reload, setIdle } = useJailCommands(name, refresh); const { items, total, page, pageSize, search, loading: bannedLoading, error: bannedError, opError, refresh: refreshBanned, setPage, setPageSize, setSearch, unban, } = useJailBannedIps(name); if (loading && !jail) { return (