mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
3 files changed
+33
-10
No files matched your search
@@ -24,8 +24,8 @@ class Shape:
|
||||
Shape are visual element not used by the network emulation. Like
|
||||
text, images, rectangle... They are pure SVG elements.
|
||||
"""
|
||||
def __init__(self, project, shape_id=None, svg=None, x=0, y=0, z=0):
|
||||
self.svg = "<svg></svg>"
|
||||
def __init__(self, project, shape_id=None, svg="<svg></svg>", x=0, y=0, z=0):
|
||||
self.svg = svg
|
||||
self._project = project
|
||||
if shape_id is None:
|
||||
self._id = str(uuid.uuid4())
|
||||
@@ -74,9 +74,9 @@ class Shape:
|
||||
@asyncio.coroutine
|
||||
def update(self, **kwargs):
|
||||
"""
|
||||
Update the node on the compute server
|
||||
Update the shape
|
||||
|
||||
:param kwargs: Node properties
|
||||
:param kwargs: Shape properties
|
||||
"""
|
||||
|
||||
# Update node properties with additional elements
|
||||
@@ -96,6 +96,7 @@ class Shape:
|
||||
"x": self._x,
|
||||
"y": self._y,
|
||||
"z": self._z,
|
||||
"svg": self._svg
|
||||
}
|
||||
return {
|
||||
"project_id": self._project.id,
|
||||
@@ -103,6 +104,7 @@ class Shape:
|
||||
"x": self._x,
|
||||
"y": self._y,
|
||||
"z": self._z,
|
||||
"svg": self._svg
|
||||
}
|
||||
|
||||
def __repr__(self):
|
||||
|
||||
@@ -26,7 +26,7 @@ in futur GNS3 versions.
|
||||
<table border="1">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>ID</td>
|
||||
<th>ID</th>
|
||||
<th>Compute</th>
|
||||
<th>Console</th>
|
||||
</tr>
|
||||
@@ -43,9 +43,9 @@ in futur GNS3 versions.
|
||||
<h2>Links</h2>
|
||||
<table border="1">
|
||||
<tr>
|
||||
<th>ID</td>
|
||||
<th>Capture</td>
|
||||
<th>PCAP</td>
|
||||
<th>ID</th>
|
||||
<th>Capture</th>
|
||||
<th>PCAP</th>
|
||||
</tr>
|
||||
{% for link in project.links.values() %}
|
||||
<tr>
|
||||
@@ -56,6 +56,25 @@ in futur GNS3 versions.
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
|
||||
<h2>Shapes</h2>
|
||||
<table border="1">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Position</th>
|
||||
<th>Content</th>
|
||||
</tr>
|
||||
{% for shape in project.shapes.values() %}
|
||||
<tr>
|
||||
<td>{{shape.id}}</td>
|
||||
<td>{{shape.x}}, {{shape.y}}, {{shape.z}}</td>
|
||||
<td>{{shape.svg}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<h2>Notifications</h2>
|
||||
<div id="notifications">
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user