mirror of
https://github.com/GNS3/gns3-server
synced 2024-12-01 04:38:12 +00:00
Send updated event when you update the node
This commit is contained in:
parent
7ebbdcd47c
commit
82f82f8cf9
@ -105,6 +105,12 @@ class BaseNode:
|
||||
def status(self, status):
|
||||
|
||||
self._node_status = status
|
||||
self.updated()
|
||||
|
||||
def updated(self):
|
||||
"""
|
||||
Send a updated event
|
||||
"""
|
||||
self.project.emit("node.updated", self)
|
||||
|
||||
@property
|
||||
|
@ -255,6 +255,7 @@ class DockerHandler:
|
||||
container.environment = request.json.get("environment", container.environment)
|
||||
container.adapters = request.json.get("adapters", container.adapters)
|
||||
yield from container.update()
|
||||
container.updated()
|
||||
response.json(container)
|
||||
|
||||
@Route.post(
|
||||
|
@ -106,6 +106,7 @@ class DynamipsDeviceHandler:
|
||||
for port in request.json["ports"]:
|
||||
yield from device.set_port_settings(port["port"], port)
|
||||
|
||||
device.updated()
|
||||
response.json(device)
|
||||
|
||||
@Route.delete(
|
||||
|
@ -122,6 +122,7 @@ class DynamipsVMHandler:
|
||||
dynamips_manager = Dynamips.instance()
|
||||
vm = dynamips_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
yield from dynamips_manager.update_vm_settings(vm, request.json)
|
||||
vm.updated()
|
||||
response.json(vm)
|
||||
|
||||
@Route.delete(
|
||||
|
@ -112,6 +112,7 @@ class EthernetHubHandler:
|
||||
|
||||
# builtin_manager = Builtin.instance()
|
||||
# node = builtin_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
node.updated()
|
||||
response.json(node)
|
||||
|
||||
@Route.delete(
|
||||
|
@ -123,6 +123,7 @@ class IOUHandler:
|
||||
vm.startup_config = request.json.get("startup_config_content")
|
||||
if "private_config_content" in request.json:
|
||||
vm.private_config = request.json.get("private_config_content")
|
||||
vm.updated()
|
||||
response.json(vm)
|
||||
|
||||
@Route.delete(
|
||||
|
@ -119,6 +119,7 @@ class QEMUHandler:
|
||||
if hasattr(vm, name) and getattr(vm, name) != value:
|
||||
setattr(vm, name, value)
|
||||
|
||||
vm.updated()
|
||||
response.json(vm)
|
||||
|
||||
@Route.delete(
|
||||
|
@ -30,6 +30,7 @@ from gns3server.schemas.virtualbox import (
|
||||
VBOX_OBJECT_SCHEMA
|
||||
)
|
||||
|
||||
|
||||
class VirtualBoxHandler:
|
||||
|
||||
"""
|
||||
@ -137,6 +138,7 @@ class VirtualBoxHandler:
|
||||
if hasattr(vm, name) and getattr(vm, name) != value:
|
||||
setattr(vm, name, value)
|
||||
|
||||
vm.updated()
|
||||
response.json(vm)
|
||||
|
||||
@Route.delete(
|
||||
|
@ -111,6 +111,7 @@ class VMwareHandler:
|
||||
if hasattr(vm, name) and getattr(vm, name) != value:
|
||||
setattr(vm, name, value)
|
||||
|
||||
vm.updated()
|
||||
response.json(vm)
|
||||
|
||||
@Route.delete(
|
||||
|
@ -98,6 +98,7 @@ class VPCSHandler:
|
||||
vm.name = request.json.get("name", vm.name)
|
||||
vm.console = request.json.get("console", vm.console)
|
||||
vm.startup_script = request.json.get("startup_script", vm.startup_script)
|
||||
vm.updated()
|
||||
response.json(vm)
|
||||
|
||||
@Route.delete(
|
||||
|
Loading…
Reference in New Issue
Block a user