Browse Source

[gns3-server] update link colors patch. Remove unnecessary self.update() method call

master
Pekka Helenius 3 years ago
parent
commit
4d7987af2a
1 changed files with 5 additions and 6 deletions
  1. +5
    -6
      patches/gns3-server/patch_gns3server_linkcolors.patch

+ 5
- 6
patches/gns3-server/patch_gns3server_linkcolors.patch View File

@ -1,5 +1,5 @@
Author: Pekka Helenius <pekka.helenius@fjordtek.com> Author: Pekka Helenius <pekka.helenius@fjordtek.com>
Date: Sun, 6 Jun 2021 15:16:28 +0200
Date: Sun, 22 Aug 2021 17:12:44 +0200
Subject: [PATCH] GNS3 Server: Link colors. Subject: [PATCH] GNS3 Server: Link colors.
Add link color support for GNS3 Server. Add link color support for GNS3 Server.
@ -67,7 +67,7 @@ Add link color support for GNS3 Server.
port = node.get_port(node_link["adapter_number"], node_link["port_number"]) port = node.get_port(node_link["adapter_number"], node_link["port_number"])
--- a/gns3server/controller/link.py --- a/gns3server/controller/link.py
+++ b/gns3server/controller/link.py +++ b/gns3server/controller/link.py
@@ -125,6 +125,8 @@
@@ -125,6 +125,8 @@ class Link:
self._suspended = False self._suspended = False
self._filters = {} self._filters = {}
@ -76,21 +76,20 @@ Add link color support for GNS3 Server.
@property @property
def filters(self): def filters(self):
""" """
@@ -209,6 +211,13 @@
@@ -209,6 +211,12 @@ class Link:
self._project.emit_notification("link.updated", self.__json__()) self._project.emit_notification("link.updated", self.__json__())
self._project.dump() self._project.dump()
+ async def update_link_style(self, link_style): + async def update_link_style(self, link_style):
+ if link_style != self._link_style: + if link_style != self._link_style:
+ self._link_style = link_style + self._link_style = link_style
+ await self.update()
+ self._project.emit_notification("link.updated", self.__json__()) + self._project.emit_notification("link.updated", self.__json__())
+ self._project.dump() + self._project.dump()
+ +
@property @property
def created(self): def created(self):
""" """
@@ -446,6 +455,7 @@
@@ -446,6 +454,7 @@ class Link:
"nodes": res, "nodes": res,
"link_id": self._id, "link_id": self._id,
"filters": self._filters, "filters": self._filters,
@ -98,7 +97,7 @@ Add link color support for GNS3 Server.
"suspend": self._suspended "suspend": self._suspended
} }
return { return {
@@ -457,5 +467,6 @@
@@ -457,5 +466,6 @@ class Link:
"capture_file_path": self.capture_file_path, "capture_file_path": self.capture_file_path,
"link_type": self._link_type, "link_type": self._link_type,
"filters": self._filters, "filters": self._filters,


Loading…
Cancel
Save