updated to work with changes for rel/5.2
This commit is contained in:
parent
b18d5b5805
commit
38ddec1ed9
3 changed files with 144 additions and 200 deletions
307
webapp/app.py
307
webapp/app.py
|
@ -12,16 +12,16 @@ from flask_socketio import SocketIO
|
||||||
from flask_socketio import emit
|
from flask_socketio import emit
|
||||||
|
|
||||||
from core import logger
|
from core import logger
|
||||||
from core.data import ConfigData
|
|
||||||
from core.emulator.coreemu import CoreEmu
|
from core.emulator.coreemu import CoreEmu
|
||||||
from core.emulator.emudata import InterfaceData
|
from core.emulator.emudata import InterfaceData
|
||||||
from core.emulator.emudata import LinkOptions
|
from core.emulator.emudata import LinkOptions
|
||||||
from core.emulator.emudata import NodeOptions
|
from core.emulator.emudata import NodeOptions
|
||||||
from core.enumerations import EventTypes, ConfigFlags, ConfigDataTypes
|
from core.enumerations import EventTypes
|
||||||
from core.enumerations import LinkTypes
|
from core.enumerations import LinkTypes
|
||||||
from core.enumerations import NodeTypes
|
from core.enumerations import NodeTypes
|
||||||
from core.misc import nodeutils
|
from core.misc import nodeutils
|
||||||
from core.misc.ipaddress import Ipv4Prefix, Ipv6Prefix
|
from core.misc.ipaddress import Ipv4Prefix, Ipv6Prefix
|
||||||
|
from core.service import ServiceManager
|
||||||
|
|
||||||
CORE_LOCK = Lock()
|
CORE_LOCK = Lock()
|
||||||
|
|
||||||
|
@ -32,13 +32,6 @@ socketio = SocketIO(app)
|
||||||
coreemu = CoreEmu()
|
coreemu = CoreEmu()
|
||||||
|
|
||||||
|
|
||||||
def custom_service_values(service):
|
|
||||||
valmap = [service._dirs, service._configs, service._startindex, service._startup,
|
|
||||||
service._shutdown, service._validate, service._meta, service._starttime]
|
|
||||||
vals = map(lambda a, b: "%s=%s" % (a, str(b)), service.keys, valmap)
|
|
||||||
return "|".join(vals)
|
|
||||||
|
|
||||||
|
|
||||||
def synchronized(function):
|
def synchronized(function):
|
||||||
global CORE_LOCK
|
global CORE_LOCK
|
||||||
|
|
||||||
|
@ -185,7 +178,7 @@ def get_session(session_id):
|
||||||
if nodeutils.is_node(node, NodeTypes.EMANE):
|
if nodeutils.is_node(node, NodeTypes.EMANE):
|
||||||
emane_model = node.model.name
|
emane_model = node.model.name
|
||||||
|
|
||||||
services = [x._name for x in getattr(node, "services", [])]
|
services = [x.name for x in getattr(node, "services", [])]
|
||||||
nodes.append({
|
nodes.append({
|
||||||
"id": node.objid,
|
"id": node.objid,
|
||||||
"name": node.name,
|
"name": node.name,
|
||||||
|
@ -207,34 +200,39 @@ def get_session(session_id):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.route("/sessions/<int:session_id>/config", methods=["PUT"])
|
@app.route("/sessions/<int:session_id>/emane/config", methods=["PUT"])
|
||||||
@synchronized
|
@synchronized
|
||||||
def set_config(session_id):
|
def set_emane_config(session_id):
|
||||||
session = coreemu.sessions.get(session_id)
|
session = coreemu.sessions.get(session_id)
|
||||||
if not session:
|
if not session:
|
||||||
return jsonify(error="session does not exist"), 404
|
return jsonify(error="session does not exist"), 404
|
||||||
|
|
||||||
data = request.get_json() or {}
|
data = request.get_json() or {}
|
||||||
name = data["name"]
|
|
||||||
node_id = data.get("node")
|
node_id = data.get("node")
|
||||||
values = data["values"]
|
values = data["values"]
|
||||||
data_types = [value["type"] for value in values]
|
config = {x["name"]: x["value"] for x in values}
|
||||||
data_values = "|".join(["%s=%s" % (value["name"], value["value"]) for value in values])
|
session.emane.set_configs(config)
|
||||||
|
|
||||||
config_data = ConfigData(
|
|
||||||
node=node_id,
|
|
||||||
object=name,
|
|
||||||
type=ConfigFlags.NONE.value,
|
|
||||||
data_types=tuple(data_types),
|
|
||||||
data_values=data_values
|
|
||||||
)
|
|
||||||
logger.info("setting config: %s", config_data)
|
|
||||||
session.config_object(config_data)
|
|
||||||
return jsonify()
|
return jsonify()
|
||||||
|
|
||||||
|
|
||||||
@app.route("/sessions/<int:session_id>/config")
|
@app.route("/sessions/<int:session_id>/emane/model/config", methods=["PUT"])
|
||||||
def get_config(session_id):
|
@synchronized
|
||||||
|
def set_emane_model_config(session_id):
|
||||||
|
session = coreemu.sessions.get(session_id)
|
||||||
|
if not session:
|
||||||
|
return jsonify(error="session does not exist"), 404
|
||||||
|
|
||||||
|
data = request.get_json() or {}
|
||||||
|
model_name = data["name"]
|
||||||
|
node_id = data.get("node")
|
||||||
|
values = data["values"]
|
||||||
|
config = {x["name"]: x["value"] for x in values}
|
||||||
|
session.emane.set_model_config(node_id, model_name, config)
|
||||||
|
return jsonify()
|
||||||
|
|
||||||
|
|
||||||
|
@app.route("/sessions/<int:session_id>/emane/config")
|
||||||
|
def get_emane_config(session_id):
|
||||||
session = coreemu.sessions.get(session_id)
|
session = coreemu.sessions.get(session_id)
|
||||||
if not session:
|
if not session:
|
||||||
return jsonify(error="session does not exist"), 404
|
return jsonify(error="session does not exist"), 404
|
||||||
|
@ -243,59 +241,66 @@ def get_config(session_id):
|
||||||
if node_id.isdigit():
|
if node_id.isdigit():
|
||||||
node_id = int(node_id)
|
node_id = int(node_id)
|
||||||
|
|
||||||
name = request.args["name"]
|
config = session.emane.get_configs()
|
||||||
|
|
||||||
config_data = ConfigData(
|
|
||||||
node=node_id,
|
|
||||||
object=name,
|
|
||||||
type=ConfigFlags.REQUEST.value
|
|
||||||
)
|
|
||||||
replies = session.config_object(config_data)
|
|
||||||
if len(replies) != 1:
|
|
||||||
return jsonify(error="failure getting config options"), 404
|
|
||||||
config_groups = replies[0]
|
|
||||||
|
|
||||||
captions = config_groups.captions.split("|")
|
|
||||||
data_values = config_groups.data_values.split("|")
|
|
||||||
possible_values = config_groups.possible_values.split("|")
|
|
||||||
groups = config_groups.groups.split("|")
|
|
||||||
|
|
||||||
config_options = []
|
config_options = []
|
||||||
for i, data_type in enumerate(config_groups.data_types):
|
for configuration in session.emane.emane_config.configurations():
|
||||||
data_value = data_values[i].split("=")
|
value = config[configuration.id]
|
||||||
value = None
|
config_options.append({
|
||||||
name = data_value[0]
|
"label": configuration.label,
|
||||||
if len(data_value) == 2:
|
"name": configuration.id,
|
||||||
value = data_value[1]
|
|
||||||
|
|
||||||
possible_value = possible_values[i]
|
|
||||||
select = None
|
|
||||||
if possible_value:
|
|
||||||
select = possible_value.split(",")
|
|
||||||
|
|
||||||
label = captions[i]
|
|
||||||
|
|
||||||
config_option = {
|
|
||||||
"label": label,
|
|
||||||
"name": name,
|
|
||||||
"value": value,
|
"value": value,
|
||||||
"type": data_type,
|
"type": configuration.type.value,
|
||||||
"select": select
|
"select": configuration.options
|
||||||
}
|
})
|
||||||
config_options.append(config_option)
|
|
||||||
|
|
||||||
config_groups = []
|
response = []
|
||||||
for group in groups:
|
for config_group in session.emane.emane_config.config_groups():
|
||||||
name, indexes = group.split(":")
|
start = config_group.start - 1
|
||||||
indexes = [int(x) for x in indexes.split("-")]
|
stop = config_group.stop
|
||||||
start = indexes[0] - 1
|
response.append({
|
||||||
stop = indexes[1]
|
"name": config_group.name,
|
||||||
config_groups.append({
|
|
||||||
"name": name,
|
|
||||||
"options": config_options[start: stop]
|
"options": config_options[start: stop]
|
||||||
})
|
})
|
||||||
|
|
||||||
return jsonify(groups=config_groups)
|
return jsonify(groups=response)
|
||||||
|
|
||||||
|
|
||||||
|
@app.route("/sessions/<int:session_id>/emane/model/config")
|
||||||
|
def get_emane_model_config(session_id):
|
||||||
|
session = coreemu.sessions.get(session_id)
|
||||||
|
if not session:
|
||||||
|
return jsonify(error="session does not exist"), 404
|
||||||
|
|
||||||
|
node_id = request.args.get("node")
|
||||||
|
if node_id.isdigit():
|
||||||
|
node_id = int(node_id)
|
||||||
|
|
||||||
|
model_name = request.args["name"]
|
||||||
|
model = session.emane.models[model_name]
|
||||||
|
config = session.emane.get_model_config(node_id, model_name)
|
||||||
|
|
||||||
|
config_options = []
|
||||||
|
for configuration in model.configurations():
|
||||||
|
value = config[configuration.id]
|
||||||
|
config_options.append({
|
||||||
|
"label": configuration.label,
|
||||||
|
"name": configuration.id,
|
||||||
|
"value": value,
|
||||||
|
"type": configuration.type.value,
|
||||||
|
"select": configuration.options
|
||||||
|
})
|
||||||
|
|
||||||
|
response = []
|
||||||
|
for config_group in model.config_groups():
|
||||||
|
start = config_group.start - 1
|
||||||
|
stop = config_group.stop
|
||||||
|
response.append({
|
||||||
|
"name": config_group.name,
|
||||||
|
"options": config_options[start: stop]
|
||||||
|
})
|
||||||
|
|
||||||
|
return jsonify(groups=response)
|
||||||
|
|
||||||
|
|
||||||
@app.route("/sessions/<int:session_id>/emane/models")
|
@app.route("/sessions/<int:session_id>/emane/models")
|
||||||
|
@ -305,7 +310,7 @@ def get_emane_models(session_id):
|
||||||
return jsonify(error="session does not exist"), 404
|
return jsonify(error="session does not exist"), 404
|
||||||
|
|
||||||
models = []
|
models = []
|
||||||
for model in session.emane._modelclsmap.keys():
|
for model in session.emane.models.keys():
|
||||||
if len(model.split("_")) != 2:
|
if len(model.split("_")) != 2:
|
||||||
continue
|
continue
|
||||||
models.append(model)
|
models.append(model)
|
||||||
|
@ -340,16 +345,8 @@ def create_node(session_id):
|
||||||
# configure emane if provided
|
# configure emane if provided
|
||||||
emane_model = data.get("emane")
|
emane_model = data.get("emane")
|
||||||
if emane_model:
|
if emane_model:
|
||||||
config_data = ConfigData(
|
session.emane.set_model_config(node_id, emane_model)
|
||||||
node=node_id,
|
|
||||||
object=emane_model,
|
|
||||||
type=2
|
|
||||||
)
|
|
||||||
session.config_object(config_data)
|
|
||||||
|
|
||||||
logger.info("custom services: %s", session.services.customservices)
|
|
||||||
for service in node.services:
|
|
||||||
logger.info("node services: %s - %s", service._name, service._custom)
|
|
||||||
return jsonify(
|
return jsonify(
|
||||||
id=node.objid,
|
id=node.objid,
|
||||||
url="/sessions/%s/nodes/%s" % (session_id, node.objid)
|
url="/sessions/%s/nodes/%s" % (session_id, node.objid)
|
||||||
|
@ -414,7 +411,7 @@ def get_node(session_id, node_id):
|
||||||
"flowid": interface.flow_id
|
"flowid": interface.flow_id
|
||||||
})
|
})
|
||||||
|
|
||||||
services = [x._name for x in getattr(node, "services", [])]
|
services = [x.name for x in getattr(node, "services", [])]
|
||||||
|
|
||||||
emane_model = None
|
emane_model = None
|
||||||
if nodeutils.is_node(node, NodeTypes.EMANE):
|
if nodeutils.is_node(node, NodeTypes.EMANE):
|
||||||
|
@ -468,6 +465,7 @@ def delete_node(session_id, node_id):
|
||||||
return jsonify(error="failure to delete node"), 404
|
return jsonify(error="failure to delete node"), 404
|
||||||
|
|
||||||
|
|
||||||
|
# TODO: this should just be a general service query
|
||||||
@app.route("/sessions/<int:session_id>/nodes/<node_id>/services")
|
@app.route("/sessions/<int:session_id>/nodes/<node_id>/services")
|
||||||
def get_node_services(session_id, node_id):
|
def get_node_services(session_id, node_id):
|
||||||
session = coreemu.sessions.get(session_id)
|
session = coreemu.sessions.get(session_id)
|
||||||
|
@ -477,33 +475,16 @@ def get_node_services(session_id, node_id):
|
||||||
if node_id.isdigit():
|
if node_id.isdigit():
|
||||||
node_id = int(node_id)
|
node_id = int(node_id)
|
||||||
|
|
||||||
config_data = ConfigData(
|
|
||||||
node=node_id,
|
|
||||||
object="services",
|
|
||||||
type=ConfigFlags.REQUEST.value,
|
|
||||||
)
|
|
||||||
logger.debug("configuration message for %s node %s", config_data.object, config_data.node)
|
|
||||||
|
|
||||||
# dispatch to any registered callback for this object type
|
|
||||||
replies = session.config_object(config_data)
|
|
||||||
if len(replies) != 1:
|
|
||||||
return jsonify(error="failure getting node services"), 404
|
|
||||||
|
|
||||||
service_data = replies[0]
|
|
||||||
names = service_data.captions.split("|")
|
|
||||||
services = {}
|
services = {}
|
||||||
for group in service_data.groups.split("|"):
|
for service in ServiceManager.services.itervalues():
|
||||||
group = group.split(":")
|
service_group = services.setdefault(service.group, [])
|
||||||
group_name = group[0]
|
service_group.append(service.name)
|
||||||
group_start, group_stop = [int(x) for x in group[1].split("-")]
|
|
||||||
group_start -= 1
|
|
||||||
services[group_name] = names[group_start:group_stop]
|
|
||||||
|
|
||||||
return jsonify(services)
|
return jsonify(services)
|
||||||
|
|
||||||
|
|
||||||
@app.route("/sessions/<int:session_id>/nodes/<node_id>/services/<service>")
|
@app.route("/sessions/<int:session_id>/nodes/<node_id>/services/<service_name>")
|
||||||
def get_node_service(session_id, node_id, service):
|
def get_node_service(session_id, node_id, service_name):
|
||||||
session = coreemu.sessions.get(session_id)
|
session = coreemu.sessions.get(session_id)
|
||||||
if not session:
|
if not session:
|
||||||
return jsonify(error="session does not exist"), 404
|
return jsonify(error="session does not exist"), 404
|
||||||
|
@ -511,41 +492,22 @@ def get_node_service(session_id, node_id, service):
|
||||||
if node_id.isdigit():
|
if node_id.isdigit():
|
||||||
node_id = int(node_id)
|
node_id = int(node_id)
|
||||||
|
|
||||||
config_data = ConfigData(
|
service = session.services.get_service(node_id, service_name, default_service=True)
|
||||||
node=node_id,
|
service_config = {
|
||||||
object="services",
|
"dirs": service.dirs,
|
||||||
opaque="service:%s" % service,
|
"files": service.configs,
|
||||||
type=ConfigFlags.REQUEST.value,
|
"startidx": "0",
|
||||||
)
|
"cmdup": service.startup,
|
||||||
logger.debug("configuration message for %s node %s", config_data.object, config_data.node)
|
"cmddown": service.shutdown,
|
||||||
|
"cmdval": service.validate,
|
||||||
# dispatch to any registered callback for this object type
|
"meta": service.meta,
|
||||||
replies = session.config_object(config_data)
|
"starttime": "0"
|
||||||
if len(replies) != 1:
|
}
|
||||||
return jsonify(error="failure getting node services"), 404
|
|
||||||
response = replies[0]
|
|
||||||
data_values = response.data_values
|
|
||||||
|
|
||||||
# check if this is a custom service, since core cant currently handle this right
|
|
||||||
node_services, _ = session.services.servicesfromopaque("service:%s" % service, node_id)
|
|
||||||
node_service = node_services[0]
|
|
||||||
if node_service._custom:
|
|
||||||
data_values = custom_service_values(node_service)
|
|
||||||
|
|
||||||
data_values = data_values.split("|")
|
|
||||||
service_config = {}
|
|
||||||
for data_value in data_values:
|
|
||||||
name, value = data_value.split("=")
|
|
||||||
if value.startswith("("):
|
|
||||||
value = value.strip("()").split(",")
|
|
||||||
value = [x.strip(" '") for x in value if x]
|
|
||||||
service_config[name] = value
|
|
||||||
|
|
||||||
return jsonify(service_config)
|
return jsonify(service_config)
|
||||||
|
|
||||||
|
|
||||||
@app.route("/sessions/<int:session_id>/nodes/<node_id>/services/<service>", methods=["PUT"])
|
@app.route("/sessions/<int:session_id>/nodes/<node_id>/services/<service_name>", methods=["PUT"])
|
||||||
def set_node_service(session_id, node_id, service):
|
def set_node_service(session_id, node_id, service_name):
|
||||||
session = coreemu.sessions.get(session_id)
|
session = coreemu.sessions.get(session_id)
|
||||||
if not session:
|
if not session:
|
||||||
return jsonify(error="session does not exist"), 404
|
return jsonify(error="session does not exist"), 404
|
||||||
|
@ -558,57 +520,24 @@ def set_node_service(session_id, node_id, service):
|
||||||
|
|
||||||
data = request.get_json() or {}
|
data = request.get_json() or {}
|
||||||
|
|
||||||
data_types = list()
|
logger.info("setting custom service node(%s) service(%s)", node_id, service_name)
|
||||||
data_values = list()
|
# guarantee custom service exists
|
||||||
data_types.append(ConfigDataTypes.STRING.value)
|
session.services.set_service(node_id, service_name)
|
||||||
data_values.append("startidx=%s" % data["index"])
|
service = session.services.get_service(node_id, service_name)
|
||||||
index = data["time"]
|
startup = data["startup"] or ""
|
||||||
if index:
|
service.startup = tuple(startup.split("\n"))
|
||||||
data_types.append(ConfigDataTypes.STRING.value)
|
logger.info("custom startup: %s", service.startup)
|
||||||
data_values.append("starttime=%s" % index)
|
validate = data["validate"] or ""
|
||||||
startup = create_tuple_str(data["startup"])
|
service.validate = tuple(validate.split("\n"))
|
||||||
if startup:
|
logger.info("custom validate: %s", service.validate)
|
||||||
data_types.append(ConfigDataTypes.STRING.value)
|
shutdown = data["shutdown"] or ""
|
||||||
data_values.append("cmdup=%s" % startup)
|
service.shutdown = tuple(shutdown.split("\n"))
|
||||||
shutdown = create_tuple_str(data["shutdown"])
|
logger.info("custom shutdown: %s", service.shutdown)
|
||||||
if shutdown:
|
|
||||||
data_types.append(ConfigDataTypes.STRING.value)
|
|
||||||
data_values.append("cmddown=%s" % shutdown)
|
|
||||||
validate = create_tuple_str(data["validate"])
|
|
||||||
if validate:
|
|
||||||
data_types.append(ConfigDataTypes.STRING.value)
|
|
||||||
data_values.append("cmdval=%s" % validate)
|
|
||||||
data_values = "|".join(data_values)
|
|
||||||
logger.info("service types: %s", data_types)
|
|
||||||
logger.info("service values: %s", data_values)
|
|
||||||
|
|
||||||
config_data = ConfigData(
|
|
||||||
node=node_id,
|
|
||||||
object="services",
|
|
||||||
opaque="service:%s" % service,
|
|
||||||
type=ConfigFlags.NONE.value,
|
|
||||||
data_types=data_types,
|
|
||||||
data_values=data_values
|
|
||||||
)
|
|
||||||
session.config_object(config_data)
|
|
||||||
logger.info("custom services: %s", session.services.customservices)
|
|
||||||
return jsonify()
|
return jsonify()
|
||||||
|
|
||||||
|
|
||||||
def create_tuple_str(data):
|
@app.route("/sessions/<int:session_id>/nodes/<node_id>/services/<service_name>/file")
|
||||||
if not data:
|
def get_node_service_file(session_id, node_id, service_name):
|
||||||
return None
|
|
||||||
data = data.strip()
|
|
||||||
|
|
||||||
output = "("
|
|
||||||
for line in data.split("\n"):
|
|
||||||
output += "'%s'," % line.strip()
|
|
||||||
output += ")"
|
|
||||||
return output
|
|
||||||
|
|
||||||
|
|
||||||
@app.route("/sessions/<int:session_id>/nodes/<node_id>/services/<service>/file")
|
|
||||||
def get_node_service_file(session_id, node_id, service):
|
|
||||||
session = coreemu.sessions.get(session_id)
|
session = coreemu.sessions.get(session_id)
|
||||||
if not session:
|
if not session:
|
||||||
return jsonify(error="session does not exist"), 404
|
return jsonify(error="session does not exist"), 404
|
||||||
|
@ -619,9 +548,9 @@ def get_node_service_file(session_id, node_id, service):
|
||||||
if not node:
|
if not node:
|
||||||
return jsonify(error="node does not exist"), 404
|
return jsonify(error="node does not exist"), 404
|
||||||
|
|
||||||
|
# get custom service file or default
|
||||||
service_file = request.args["file"]
|
service_file = request.args["file"]
|
||||||
services, _ = session.services.servicesfromopaque("service:%s" % service, node_id)
|
file_data = session.services.get_service_file(node, service_name, service_file)
|
||||||
file_data = session.services.getservicefile(services, node, service_file)
|
|
||||||
return jsonify(file_data.data)
|
return jsonify(file_data.data)
|
||||||
|
|
||||||
|
|
||||||
|
@ -640,7 +569,7 @@ def set_node_service_file(session_id, node_id, service):
|
||||||
data = request.get_json() or {}
|
data = request.get_json() or {}
|
||||||
file_name = data["name"]
|
file_name = data["name"]
|
||||||
data = data["data"]
|
data = data["data"]
|
||||||
session.add_node_service_file(node_id, service, file_name, None, data)
|
session.services.set_service_file(node_id, service, file_name, data)
|
||||||
return jsonify()
|
return jsonify()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -78,12 +78,20 @@ class CoreRest {
|
||||||
return await $.getJSON(`/sessions/${this.currentSession}/emane/models`);
|
return await $.getJSON(`/sessions/${this.currentSession}/emane/models`);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getConfig(config) {
|
async getEmaneConfig(config) {
|
||||||
return await $.getJSON(`/sessions/${this.currentSession}/config`, config);
|
return await $.getJSON(`/sessions/${this.currentSession}/emane/config`, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
async setConfig(config) {
|
async getEmaneModelConfig(config) {
|
||||||
return await putJson(`/sessions/${this.currentSession}/config`, config);
|
return await $.getJSON(`/sessions/${this.currentSession}/emane/model/config`, config);
|
||||||
|
}
|
||||||
|
|
||||||
|
async setEmaneConfig(config) {
|
||||||
|
return await putJson(`/sessions/${this.currentSession}/emane/config`, config);
|
||||||
|
}
|
||||||
|
|
||||||
|
async setEmaneModelConfig(config) {
|
||||||
|
return await putJson(`/sessions/${this.currentSession}/emane/model/config`, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getNode(nodeId) {
|
async getNode(nodeId) {
|
||||||
|
|
|
@ -83,11 +83,18 @@ class ConfigModel {
|
||||||
configs.push({name, value, type: dataType});
|
configs.push({name, value, type: dataType});
|
||||||
}
|
}
|
||||||
console.log('config data: ', configs);
|
console.log('config data: ', configs);
|
||||||
await this.coreRest.setConfig({
|
if (configType === "emane") {
|
||||||
name: configType,
|
await this.coreRest.setEmaneConfig({
|
||||||
node: nodeId,
|
node: nodeId,
|
||||||
values: configs
|
values: configs
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
await this.coreRest.setEmaneModelConfig({
|
||||||
|
node: nodeId,
|
||||||
|
name: configType,
|
||||||
|
values: configs
|
||||||
|
});
|
||||||
|
}
|
||||||
this.$modal.modal('hide');
|
this.$modal.modal('hide');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,7 +131,7 @@ class ConfigModel {
|
||||||
const configName = 'emane';
|
const configName = 'emane';
|
||||||
this.$modal.data('type', configName);
|
this.$modal.data('type', configName);
|
||||||
this.$title.text('EMANE Options');
|
this.$title.text('EMANE Options');
|
||||||
const config = await this.coreRest.getConfig({node: nodeId, name: configName});
|
const config = await this.coreRest.getEmaneConfig({node: nodeId});
|
||||||
console.log('emane options clicked: ', config);
|
console.log('emane options clicked: ', config);
|
||||||
this.showConfig(config);
|
this.showConfig(config);
|
||||||
return false;
|
return false;
|
||||||
|
@ -137,7 +144,7 @@ class ConfigModel {
|
||||||
this.$modal.data('type', configName);
|
this.$modal.data('type', configName);
|
||||||
this.$title.text('EMANE Model Options');
|
this.$title.text('EMANE Model Options');
|
||||||
console.log('emane model clicked: ', configName);
|
console.log('emane model clicked: ', configName);
|
||||||
const config = await this.coreRest.getConfig({node: nodeId, name: configName});
|
const config = await this.coreRest.getEmaneModelConfig({node: nodeId, name: configName});
|
||||||
console.log('emane model options clicked: ', config);
|
console.log('emane model options clicked: ', config);
|
||||||
this.showConfig(config);
|
this.showConfig(config);
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue