Fix blocklist-import bantime, unify filter bar, and improve config navigation
This commit is contained in:
@@ -216,7 +216,6 @@ function JailConfigDetail({
|
||||
ignore_regex: ignoreRegex,
|
||||
date_pattern: datePattern !== "" ? datePattern : null,
|
||||
dns_mode: dnsMode,
|
||||
backend,
|
||||
log_encoding: logEncoding,
|
||||
prefregex: prefRegex !== "" ? prefRegex : null,
|
||||
bantime_escalation: {
|
||||
@@ -231,7 +230,7 @@ function JailConfigDetail({
|
||||
}),
|
||||
[
|
||||
banTime, findTime, maxRetry, failRegex, ignoreRegex, datePattern,
|
||||
dnsMode, backend, logEncoding, prefRegex, escEnabled, escFactor,
|
||||
dnsMode, logEncoding, prefRegex, escEnabled, escFactor,
|
||||
escFormula, escMultipliers, escMaxTime, escRndTime, escOverallJails,
|
||||
jail.ban_time, jail.find_time, jail.max_retry,
|
||||
],
|
||||
@@ -758,7 +757,12 @@ function InactiveJailDetail({
|
||||
*
|
||||
* @returns JSX element.
|
||||
*/
|
||||
export function JailsTab(): React.JSX.Element {
|
||||
interface JailsTabProps {
|
||||
/** Jail name to pre-select when the component mounts. */
|
||||
initialJail?: string;
|
||||
}
|
||||
|
||||
export function JailsTab({ initialJail }: JailsTabProps): React.JSX.Element {
|
||||
const styles = useConfigStyles();
|
||||
const { jails, loading, error, refresh, updateJail } =
|
||||
useJailConfigs();
|
||||
@@ -819,6 +823,13 @@ export function JailsTab(): React.JSX.Element {
|
||||
return [...activeItems, ...inactiveItems];
|
||||
}, [jails, inactiveJails]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!initialJail || selectedName) return;
|
||||
if (listItems.some((item) => item.name === initialJail)) {
|
||||
setSelectedName(initialJail);
|
||||
}
|
||||
}, [initialJail, listItems, selectedName]);
|
||||
|
||||
const activeJailMap = useMemo(
|
||||
() => new Map(jails.map((j) => [j.name, j])),
|
||||
[jails],
|
||||
|
||||
Reference in New Issue
Block a user