fix(nodes): persist show_port_numbers across reloads
The Show Port Numbers toggle reset on every reload because the backend never stored it: the column was missing from the Node model and the field was stripped by NodeSave/NodeBase/NodeUpdate schemas, so canvas/save silently dropped it. Add the show_port_numbers column (idempotent migration), and the field to the node schemas so it round-trips through save/load. Add regression tests covering persistence and the default-false case. Fixes #184 ha-relevant: yes
This commit is contained in:
@@ -54,6 +54,7 @@ class Node(Base):
|
||||
ram_gb: Mapped[float | None] = mapped_column(Float, nullable=True)
|
||||
disk_gb: Mapped[float | None] = mapped_column(Float, nullable=True)
|
||||
show_hardware: Mapped[bool] = mapped_column(Boolean, default=False)
|
||||
show_port_numbers: Mapped[bool] = mapped_column(Boolean, default=False)
|
||||
properties: Mapped[list[Any]] = mapped_column(JSON, default=list)
|
||||
width: Mapped[float | None] = mapped_column(Float, nullable=True)
|
||||
height: Mapped[float | None] = mapped_column(Float, nullable=True)
|
||||
|
||||
Reference in New Issue
Block a user