/** * Configuration page — fail2ban jail and server configuration editor. * * Renders the top-level tab bar and delegates rendering to the appropriate * tab component from {@link ../components/config}. * * Tabs: * Jails — per-jail config accordion with inline editing * Filters — structured filter.d form editor * Actions — structured action.d form editor * Server — server-level settings, map thresholds, service health + log viewer * Regex Tester — live pattern tester * Export — raw file editors for jail, filter, and action files */ import { useEffect, useState } from "react"; import { useLocation } from "react-router-dom"; import { Tab, TabList, Text, makeStyles, tokens } from "@fluentui/react-components"; import { ActionsTab, FiltersTab, JailsTab, RegexTesterTab, ServerTab, } from "../components/config"; // --------------------------------------------------------------------------- // Page-level styles (tab shell only — component styles live in configStyles.ts) // --------------------------------------------------------------------------- const useStyles = makeStyles({ page: { padding: tokens.spacingVerticalXXL, maxWidth: "1100px", }, header: { marginBottom: tokens.spacingVerticalL, }, tabContent: { marginTop: tokens.spacingVerticalL, animationName: "fadeInUp", animationDuration: tokens.durationNormal, animationTimingFunction: tokens.curveDecelerateMid, animationFillMode: "both", }, infoText: { color: tokens.colorNeutralForeground3, fontStyle: "italic", }, }); type TabValue = | "jails" | "filters" | "actions" | "server" | "regex"; export function ConfigPage(): React.JSX.Element { const styles = useStyles(); const location = useLocation(); const [tab, setTab] = useState("jails"); useEffect(() => { const state = location.state as { tab?: string; jail?: string } | null; if (state?.tab === "jails") { setTab("jails"); } }, [location.state]); return (
Configuration Inspect and edit fail2ban jail configuration, global settings, and server parameters.
{ setTab(d.value as TabValue); }} > Jails Filters Actions Server Regex Tester
{tab === "jails" && ( )} {tab === "filters" && } {tab === "actions" && } {tab === "server" && } {tab === "regex" && }
); }