Add mass unban: DELETE /api/bans/all clears all active bans
- Send fail2ban's `unban --all` command via new `unban_all_ips()` service function; returns the count of unbanned IPs - Add `UnbanAllResponse` Pydantic model (message + count) - Add `DELETE /api/bans/all` router endpoint; handles 502 on socket error - Frontend: `bansAll` endpoint constant, `unbanAllBans()` API call, `UnbanAllResponse` type, `unbanAll` action in `useActiveBans` hook - JailsPage: "Clear All Bans" button (visible when bans > 0) with a Fluent UI confirmation Dialog before executing the operation - 7 new tests (3 service, 4 router); 440 total pass, 82% coverage
This commit is contained in:
@@ -184,6 +184,16 @@ export interface ActiveBanListResponse {
|
||||
*
|
||||
* Mirrors `GeoDetail` from `backend/app/models/geo.py`.
|
||||
*/
|
||||
/**
|
||||
* Mirrors `UnbanAllResponse` from `backend/app/models/ban.py`.
|
||||
*/
|
||||
export interface UnbanAllResponse {
|
||||
/** Human-readable summary of the operation. */
|
||||
message: string;
|
||||
/** Number of IP addresses that were unbanned. */
|
||||
count: number;
|
||||
}
|
||||
|
||||
export interface GeoDetail {
|
||||
/** ISO 3166-1 alpha-2 country code (e.g. `"DE"`), or `null`. */
|
||||
country_code: string | null;
|
||||
|
||||
Reference in New Issue
Block a user