diff --git a/gns3server/api/routes/controller/links.py b/gns3server/api/routes/controller/links.py index 31ecff6e..a1db1adf 100644 --- a/gns3server/api/routes/controller/links.py +++ b/gns3server/api/routes/controller/links.py @@ -81,6 +81,8 @@ async def create_link(project_id: UUID, link_data: schemas.LinkCreate) -> schema link_data = jsonable_encoder(link_data, exclude_unset=True) if "filters" in link_data: await link.update_filters(link_data["filters"]) + if "link_style" in link_data: + await link.update_link_style(link_data["link_style"]) if "suspend" in link_data: await link.update_suspend(link_data["suspend"]) try: @@ -124,6 +126,8 @@ async def update_link(link_data: schemas.LinkUpdate, link: Link = Depends(dep_li link_data = jsonable_encoder(link_data, exclude_unset=True) if "filters" in link_data: await link.update_filters(link_data["filters"]) + if "link_style" in link_data: + await link.update_link_style(link_data["link_style"]) if "suspend" in link_data: await link.update_suspend(link_data["suspend"]) if "nodes" in link_data: diff --git a/gns3server/controller/link.py b/gns3server/controller/link.py index c805af0f..b4a02c0e 100644 --- a/gns3server/controller/link.py +++ b/gns3server/controller/link.py @@ -175,7 +175,7 @@ class Link: if link_style != self._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.asdict()) self._project.dump() @property diff --git a/gns3server/handlers/api/compute/dynamips_vm_handler.py b/gns3server/handlers/api/compute/dynamips_vm_handler.py deleted file mode 100644 index e69de29b..00000000 diff --git a/gns3server/handlers/api/compute/iou_handler.py b/gns3server/handlers/api/compute/iou_handler.py deleted file mode 100644 index e69de29b..00000000 diff --git a/gns3server/handlers/api/compute/qemu_handler.py b/gns3server/handlers/api/compute/qemu_handler.py deleted file mode 100644 index e69de29b..00000000 diff --git a/gns3server/handlers/api/controller/link_handler.py b/gns3server/handlers/api/controller/link_handler.py deleted file mode 100644 index e69de29b..00000000 diff --git a/gns3server/schemas/controller/links.py b/gns3server/schemas/controller/links.py index 6a375cb9..af3f3952 100644 --- a/gns3server/schemas/controller/links.py +++ b/gns3server/schemas/controller/links.py @@ -42,6 +42,13 @@ class LinkType(str, Enum): serial = "serial" +class LinkStyle(BaseModel): + + color: Optional[str] = None + width: Optional[int] = None + type: Optional[int] = None + + class LinkBase(BaseModel): """ Link data. @@ -49,6 +56,7 @@ class LinkBase(BaseModel): nodes: Optional[List[LinkNode]] = Field(None, min_items=0, max_items=2) suspend: Optional[bool] = None + link_style: Optional[LinkStyle] = None filters: Optional[dict] = None