Stage 7: configuration view — backend service, routers, tests, and frontend
- config_service.py: read/write jail config via asyncio.gather, global settings, in-process regex validation, log preview via _read_tail_lines - server_service.py: read/write server settings, flush logs - config router: 9 endpoints for jail/global config, regex-test, logpath management, log preview - server router: GET/PUT settings, POST flush-logs - models/config.py expanded with JailConfig, GlobalConfigUpdate, LogPreview* models - 285 tests pass (68 new), ruff clean, mypy clean (44 files) - Frontend: types/config.ts, api/config.ts, hooks/useConfig.ts, ConfigPage.tsx full implementation (Jails accordion editor, Global config, Server settings, Regex Tester with preview) - Fixed pre-existing frontend lint: JSX.Element → React.JSX.Element (10 files), void/promise patterns in useServerStatus + useJails, no-misused-spread in client.ts, eslint.config.ts self-excluded
This commit is contained in:
@@ -100,7 +100,7 @@ export function useJails(): UseJailsResult {
|
||||
|
||||
useEffect(() => {
|
||||
load();
|
||||
return () => {
|
||||
return (): void => {
|
||||
abortRef.current?.abort();
|
||||
};
|
||||
}, [load]);
|
||||
@@ -120,9 +120,9 @@ export function useJails(): UseJailsResult {
|
||||
refresh: load,
|
||||
startJail: withRefresh(startJail),
|
||||
stopJail: withRefresh(stopJail),
|
||||
setIdle: (name, on) => setJailIdle(name, on).then(() => load()),
|
||||
setIdle: (name, on) => setJailIdle(name, on).then((): void => { load(); }),
|
||||
reloadJail: withRefresh(reloadJail),
|
||||
reloadAll: () => reloadAllJails().then(() => load()),
|
||||
reloadAll: () => reloadAllJails().then((): void => { load(); }),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ export function useJailDetail(name: string): UseJailDetailResult {
|
||||
|
||||
useEffect(() => {
|
||||
load();
|
||||
return () => {
|
||||
return (): void => {
|
||||
abortRef.current?.abort();
|
||||
};
|
||||
}, [load]);
|
||||
@@ -278,7 +278,7 @@ export function useActiveBans(): UseActiveBansResult {
|
||||
|
||||
useEffect(() => {
|
||||
load();
|
||||
return () => {
|
||||
return (): void => {
|
||||
abortRef.current?.abort();
|
||||
};
|
||||
}, [load]);
|
||||
|
||||
Reference in New Issue
Block a user