Expose ban-time escalation settings in jail detail and config UI
- Backend: Add BantimeEscalation + BantimeEscalationUpdate Pydantic models to app/models/config.py; add bantime_escalation field to Jail in jail.py - Backend: jail_service.get_jail_detail() fetches 7 bantime.* socket commands (increment, factor, formula, multipliers, maxtime, rndtime, overalljails) and populates bantime_escalation on the returned Jail object - Backend: config_service.get_jail_config() fetches same 7 commands; update_jail_config() writes escalation fields when provided - Frontend: Add BantimeEscalation + BantimeEscalationUpdate interfaces to types/config.ts; extend JailConfig + JailConfigUpdate; extend Jail in types/jail.ts - Frontend: JailDetailPage.tsx adds BantimeEscalationSection component that renders only when increment is enabled (shows factor, formula, multipliers, max_time, rnd_time, overall_jails) - Frontend: ConfigPage.tsx JailAccordionPanel adds full escalation edit form (Switch for enable/disable, number inputs for factor/max_time/rnd_time, text inputs for formula/multipliers, Switch for overall_jails); handleSave includes bantime_escalation in the JailConfigUpdate payload - Tests: Update ConfigPageLogPath.test.tsx mock to include bantime_escalation:null - Docs: Mark Task 6 as DONE in Tasks.md
This commit is contained in:
@@ -5,6 +5,8 @@ Request, response, and domain models used by the jails router and service.
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
from app.models.config import BantimeEscalation
|
||||
|
||||
|
||||
class JailStatus(BaseModel):
|
||||
"""Runtime metrics for a single jail."""
|
||||
@@ -37,6 +39,10 @@ class Jail(BaseModel):
|
||||
ban_time: int = Field(..., description="Duration (seconds) of a ban. -1 means permanent.")
|
||||
max_retry: int = Field(..., description="Number of failures before a ban is issued.")
|
||||
actions: list[str] = Field(default_factory=list, description="Names of actions attached to this jail.")
|
||||
bantime_escalation: BantimeEscalation | None = Field(
|
||||
default=None,
|
||||
description="Incremental ban-time escalation settings, or None if not configured.",
|
||||
)
|
||||
status: JailStatus | None = Field(default=None, description="Runtime counters.")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user