mirror of
https://github.com/hansjone/netx.git
synced 2026-10-16 11:30:50 +08:00
Harden topology tree against bad view filters and allow deleting UME World.
Coerce non-dict filter JSON so /tree no longer 500s, surface API failure details, and let users remove the UME World container for local resets. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
35a3980dc0
commit
961d523479
7 changed files with 89 additions and 30 deletions
|
|
@ -19,6 +19,14 @@ PHYSICAL_VIEW_NAME = "Physical topology"
|
|||
# Legacy system region name (no longer auto-created; stripped on bootstrap when empty).
|
||||
_LEGACY_UNASSIGNED_NAME = "Unassigned"
|
||||
|
||||
|
||||
def view_filter_dict(raw: Any) -> dict[str, Any]:
|
||||
"""Coerce TopoView.filter JSON to a dict (bad rows must not 500 the tree)."""
|
||||
if isinstance(raw, dict):
|
||||
return dict(raw)
|
||||
return {}
|
||||
|
||||
|
||||
PAGE_DEFAULT = 100
|
||||
PAGE_MAX = 2000
|
||||
VIEW_GRAPH_NODE_HARD_CAP = 2000
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue