Redesign FiltersTab with active/inactive layout and assign/create dialogs (Tasks 2.3/2.4)

- Rewrite FiltersTab: use fetchFilters() for FilterConfig[] with embedded active
  status; show 'Active — sshd, apache-auth' badge labels; FilterDetail sub-
  component with source_file/override badges, FilterForm, Assign button, raw
  config section
- New AssignFilterDialog: selects jail from enabled-jails list, calls
  POST /config/jails/{name}/filter with optional fail2ban reload
- New CreateFilterDialog: name+failregex+ignoreregex form, calls
  POST /config/filters, closes and selects new filter on success
- Extend ConfigListDetail: add listHeader (for Create button) and
  itemBadgeLabel (for custom badge text) optional props
- Fix updateFilterFile bug: was PUT /config/filters/{name} (structured
  endpoint), now correctly PUT /config/filters/{name}/raw
- Fix createFilterFile bug: was POST /config/filters, now POST /config/filters/raw
- Add updateFilter, createFilter, deleteFilter, assignFilterToJail to api/config.ts
- Add FilterUpdateRequest, FilterCreateRequest, AssignFilterRequest to types/config.ts
- Add configFiltersRaw, configJailFilter endpoints
- Tests: 24 new tests across FiltersTab, AssignFilterDialog, CreateFilterDialog
  (all 89 frontend tests passing)
This commit is contained in:
2026-03-13 18:46:45 +01:00
parent e15ad8fb62
commit 2f60b0915e
12 changed files with 1358 additions and 83 deletions

View File

@@ -10,12 +10,16 @@ export { ActionForm } from "./ActionForm";
export type { ActionFormProps } from "./ActionForm";
export { ActivateJailDialog } from "./ActivateJailDialog";
export type { ActivateJailDialogProps } from "./ActivateJailDialog";
export { AssignFilterDialog } from "./AssignFilterDialog";
export type { AssignFilterDialogProps } from "./AssignFilterDialog";
export { AutoSaveIndicator } from "./AutoSaveIndicator";
export type { AutoSaveStatus, AutoSaveIndicatorProps } from "./AutoSaveIndicator";
export { ConfFilesTab } from "./ConfFilesTab";
export type { ConfFilesTabProps } from "./ConfFilesTab";
export { ConfigListDetail } from "./ConfigListDetail";
export type { ConfigListDetailProps } from "./ConfigListDetail";
export { CreateFilterDialog } from "./CreateFilterDialog";
export type { CreateFilterDialogProps } from "./CreateFilterDialog";
export { ExportTab } from "./ExportTab";
export { FilterForm } from "./FilterForm";
export type { FilterFormProps } from "./FilterForm";