mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 14:01:15 +02:00
fix(marker): restore markers from topology on project load
_create_link_from_topology_data now restores traffic-insight markers (mirroring how filters are restored via update_filters), so markers — including their color — survive project close/reopen and server restart. Guard start_marker's uBridge POST with 'if self._created' (exactly as update_filters guards its update() call): during project load the link is not yet created, so only _markers state is recorded and the marker is applied once via the NIO flow in create()/_ubridge_apply_markers — no double application.
This commit is contained in:
2 files changed
+30
-7
No files matched your search
@@ -765,6 +765,22 @@ class Project:
|
||||
"Dropping invalid filters on link %s: %s",
|
||||
link_data.get("link_id"), e
|
||||
)
|
||||
# Restore traffic-insight markers. Each marker's capture side is resolved
|
||||
# when the link is (re)created and the marker is applied to uBridge via
|
||||
# _ubridge_apply_markers in add_ubridge_udp_connection.
|
||||
for name, marker in (link_data.get("markers") or {}).items():
|
||||
try:
|
||||
await link.start_marker(
|
||||
name=name,
|
||||
bpf=marker["bpf"],
|
||||
tag=marker.get("tag"),
|
||||
color=marker.get("color"),
|
||||
)
|
||||
except (ControllerError, KeyError) as e:
|
||||
log.warning(
|
||||
"Dropping marker %s on link %s: %s",
|
||||
name, link_data.get("link_id"), e
|
||||
)
|
||||
if "link_style" in link_data:
|
||||
await link.update_link_style(link_data["link_style"])
|
||||
if "show_filters_icon" in link_data:
|
||||
|
||||
Reference in new issue
Block a user