diff --git a/CHANGELOG b/CHANGELOG index fcd128f1..84b1d639 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,16 @@ # Change Log +## 3.0.0a2 06/09/2022 + +* Add web-ui v3.0.0a2 +* Upgrade FastAPI to v0.82.0 +* API endpoint to get the locked status of a project +* Global project lock and unlock +* Update appliance files +* Require name for custom adapters. Fixes #2098 +* Allow empty adapter slots for Dynamips templates. Ref https://github.com/GNS3/gns3-gui/issues/3373 +* Use original $PATH in init.sh for Docker containers. Ref #2069 + ## 3.0.0a1 04/08/2022 * Bundle gns3-web-ui v3.0.0a1 diff --git a/gns3server/api/routes/controller/projects.py b/gns3server/api/routes/controller/projects.py index b8797e3c..91021f64 100644 --- a/gns3server/api/routes/controller/projects.py +++ b/gns3server/api/routes/controller/projects.py @@ -30,7 +30,7 @@ import logging log = logging.getLogger() -from fastapi import APIRouter, Depends, Request, Response, Body, HTTPException, status, WebSocket, WebSocketDisconnect +from fastapi import APIRouter, Depends, Request, Body, HTTPException, status, WebSocket, WebSocketDisconnect from fastapi.encoders import jsonable_encoder from fastapi.responses import StreamingResponse, FileResponse from websockets.exceptions import ConnectionClosed, WebSocketException @@ -395,6 +395,15 @@ async def duplicate_project( return new_project.asdict() +@router.get("/{project_id}/locked") +async def locked_project(project: Project = Depends(dep_project)) -> bool: + """ + Returns whether a project is locked or not + """ + + return project.locked + + @router.post("/{project_id}/lock", status_code=status.HTTP_204_NO_CONTENT) async def lock_project(project: Project = Depends(dep_project)) -> None: """ diff --git a/gns3server/controller/project.py b/gns3server/controller/project.py index 37446cae..7107429a 100644 --- a/gns3server/controller/project.py +++ b/gns3server/controller/project.py @@ -1144,6 +1144,21 @@ class Project: self.emit_notification("node.updated", node.asdict()) self.dump() + @property + @open_required + def locked(self): + """ + Check if all items in a project are locked and not + """ + + for drawing in self._drawings.values(): + if not drawing.locked: + return False + for node in self.nodes.values(): + if not node.locked: + return False + return True + def dump(self): """ Dump topology to disk diff --git a/gns3server/crash_report.py b/gns3server/crash_report.py index 46ebd97e..53dc218e 100644 --- a/gns3server/crash_report.py +++ b/gns3server/crash_report.py @@ -59,7 +59,7 @@ class CrashReport: Report crash to a third party service """ - DSN = "https://db7d5c538c3642b281fd27bb2fb6349f@o19455.ingest.sentry.io/38482" + DSN = "https://bad2bd9ef9f14c8d9239d6f815ed453f@o19455.ingest.sentry.io/38482" _instance = None def __init__(self): diff --git a/gns3server/static/web-ui/index.html b/gns3server/static/web-ui/index.html index 820fe55f..70846673 100644 --- a/gns3server/static/web-ui/index.html +++ b/gns3server/static/web-ui/index.html @@ -31,7 +31,7 @@ } })(); - +