diff --git a/src/meshcore_hub/collector/cli.py b/src/meshcore_hub/collector/cli.py index 3f81a91..8e78cc0 100644 --- a/src/meshcore_hub/collector/cli.py +++ b/src/meshcore_hub/collector/cli.py @@ -804,12 +804,12 @@ def _import_routes( route.description = value.get("description") route.visibility = visibility route.match_width = match_width - route.window_hours = value.get("window_hours", 24) + route.window_hours = value.get("window_hours", 48) route.packet_count_threshold = value.get( "packet_count_threshold", 3 ) route.clear_threshold = value.get("clear_threshold") - route.max_hop_span = value.get("max_hop_span") + route.max_hop_span = value.get("max_hop_span", 8) route.enabled = value.get("enabled", True) route.reversible = value.get("reversible", True) # Replace path nodes wholesale @@ -826,10 +826,10 @@ def _import_routes( description=value.get("description"), visibility=visibility, match_width=match_width, - window_hours=value.get("window_hours", 24), + window_hours=value.get("window_hours", 48), packet_count_threshold=value.get("packet_count_threshold", 3), clear_threshold=value.get("clear_threshold"), - max_hop_span=value.get("max_hop_span"), + max_hop_span=value.get("max_hop_span", 8), enabled=value.get("enabled", True), reversible=value.get("reversible", True), ) diff --git a/src/meshcore_hub/common/models/route.py b/src/meshcore_hub/common/models/route.py index 6eeb884..cf5c0a0 100644 --- a/src/meshcore_hub/common/models/route.py +++ b/src/meshcore_hub/common/models/route.py @@ -69,7 +69,7 @@ class Route(Base, UUIDMixin, TimestampMixin): ) window_hours: Mapped[int] = mapped_column( Integer, - default=24, + default=48, nullable=False, ) packet_count_threshold: Mapped[int] = mapped_column( @@ -83,6 +83,7 @@ class Route(Base, UUIDMixin, TimestampMixin): ) max_hop_span: Mapped[Optional[int]] = mapped_column( Integer, + default=8, nullable=True, ) enabled: Mapped[bool] = mapped_column( diff --git a/src/meshcore_hub/common/schemas/routes.py b/src/meshcore_hub/common/schemas/routes.py index 9a7a8f4..d2df380 100644 --- a/src/meshcore_hub/common/schemas/routes.py +++ b/src/meshcore_hub/common/schemas/routes.py @@ -64,7 +64,7 @@ class RouteCreate(BaseModel): default=1, ge=1, le=3, description="Hash prefix width (1-3 bytes)" ) window_hours: int = Field( - default=24, ge=1, le=720, description="Evaluation window in hours" + default=48, ge=1, le=720, description="Evaluation window in hours" ) packet_count_threshold: int = Field( default=3, ge=1, le=10000, description="Minimum distinct packets for healthy" @@ -73,7 +73,7 @@ class RouteCreate(BaseModel): default=None, description="Comfort bar (null = 2x threshold)" ) max_hop_span: Optional[int] = Field( - default=None, description="Max hop distance between first and last node" + default=8, description="Max hop distance between first and last node" ) enabled: bool = Field(default=True, description="Whether this route is evaluated") reversible: bool = Field( @@ -232,10 +232,10 @@ class RoutePreviewRequest(BaseModel): ..., description="Ordered path node public keys" ) match_width: int = Field(default=1, ge=1, le=3) - window_hours: int = Field(default=24, ge=1, le=720) + window_hours: int = Field(default=48, ge=1, le=720) packet_count_threshold: int = Field(default=3, ge=1, le=10000) clear_threshold: Optional[int] = None - max_hop_span: Optional[int] = None + max_hop_span: Optional[int] = Field(default=8) observer_public_keys: Optional[list[str]] = None reversible: bool = Field(default=True) diff --git a/src/meshcore_hub/web/static/js/spa/pages/routes.js b/src/meshcore_hub/web/static/js/spa/pages/routes.js index 2a386f8..f86a128 100644 --- a/src/meshcore_hub/web/static/js/spa/pages/routes.js +++ b/src/meshcore_hub/web/static/js/spa/pages/routes.js @@ -400,7 +400,7 @@ function renderRouteModal({ modalState, onSave, onCancel, saving }) {