Add reload and restart buttons to Server tab

Adds ability to reload or restart fail2ban service from the Server tab UI.

Backend changes:
- Add new restart() method to jail_service.py that sends 'restart' command
- Add new POST /api/config/restart endpoint in config router
- Endpoint returns 204 on success, 502 if fail2ban unreachable
- Includes structured logging via 'fail2ban_restarted' log entry

Frontend changes:
- Add configRestart endpoint to endpoints.ts
- Add restartFail2Ban() API function in config.ts API module
- Import ArrowSync24Regular icon from Fluent UI
- Add reload and restart button handlers to ServerTab
- Display 'Reload fail2ban' and 'Restart fail2ban' buttons in action row
- Show loading spinner during operation
- Display success/error MessageBar with appropriate feedback
- Update ServerTab docstring to document new buttons

All 115 frontend tests pass.
This commit is contained in:
2026-03-14 22:03:58 +01:00
parent 1da38361a9
commit 1e33220f59
5 changed files with 122 additions and 3 deletions

View File

@@ -88,7 +88,7 @@ export async function updateGlobalConfig(
}
// ---------------------------------------------------------------------------
// Reload
// Reload and Restart
// ---------------------------------------------------------------------------
export async function reloadConfig(
@@ -96,6 +96,11 @@ export async function reloadConfig(
await post<undefined>(ENDPOINTS.configReload, undefined);
}
export async function restartFail2Ban(
): Promise<void> {
await post<undefined>(ENDPOINTS.configRestart, undefined);
}
// ---------------------------------------------------------------------------
// Regex tester
// ---------------------------------------------------------------------------