Skip to content
Snippets Groups Projects
Commit 2e796496 authored by Alberto Gonzalez Barneo's avatar Alberto Gonzalez Barneo
Browse files

Changed apps by qkd_apps

parent 02804f19
Branches
Tags
2 merge requests!294Release TeraFlowSDN 4.0,!264Resolve "(OPT) UI Integration for QKD Management (WebUI)"
......@@ -19,7 +19,7 @@ from flask_healthz import healthz, HealthError
from common.tools.grpc.Tools import grpc_message_to_json
from context.client.ContextClient import ContextClient
from device.client.DeviceClient import DeviceClient
from app.client.QKDAppClient import QKDAppClient
from qkd_app.client.QKDAppClient import QKDAppClient
def get_working_context() -> str:
return session['context_uuid'] if 'context_uuid' in session else '---'
......@@ -72,48 +72,48 @@ class SetSubAppMiddleware():
return self.app(environ, start_response)
def create_app(use_config=None, web_app_root=None):
app = Flask(__name__)
qkd_app = Flask(__name__)
if use_config:
app.config.from_mapping(**use_config)
qkd_app.config.from_mapping(**use_config)
app.config.update(HEALTHZ={
qkd_app.config.update(HEALTHZ={
'live': liveness,
'ready': readiness
})
app.register_blueprint(healthz, url_prefix='/healthz')
qkd_app.register_blueprint(healthz, url_prefix='/healthz')
from webui.service.js.routes import js # pylint: disable=import-outside-toplevel
app.register_blueprint(js)
qkd_app.register_blueprint(js)
from webui.service.main.routes import main # pylint: disable=import-outside-toplevel
app.register_blueprint(main)
qkd_app.register_blueprint(main)
from webui.service.load_gen.routes import load_gen # pylint: disable=import-outside-toplevel
app.register_blueprint(load_gen)
qkd_app.register_blueprint(load_gen)
from webui.service.service.routes import service # pylint: disable=import-outside-toplevel
app.register_blueprint(service)
qkd_app.register_blueprint(service)
from webui.service.slice.routes import slice # pylint: disable=import-outside-toplevel,redefined-builtin
app.register_blueprint(slice)
qkd_app.register_blueprint(slice)
from webui.service.device.routes import device # pylint: disable=import-outside-toplevel
app.register_blueprint(device)
qkd_app.register_blueprint(device)
from webui.service.bgpls.routes import bgpls # pylint: disable=import-outside-toplevel
app.register_blueprint(bgpls)
qkd_app.register_blueprint(bgpls)
from webui.service.link.routes import link # pylint: disable=import-outside-toplevel
app.register_blueprint(link)
qkd_app.register_blueprint(link)
from webui.service.app.routes import app as _app # pylint: disable=import-outside-toplevel
app.register_blueprint(_app)
from webui.service.qkd_app.routes import qkd_app as _qkd_app # pylint: disable=import-outside-toplevel
qkd_app.register_blueprint(_qkd_app)
from webui.service.policy_rule.routes import policy_rule # pylint: disable=import-outside-toplevel
app.register_blueprint(policy_rule)
qkd_app.register_blueprint(policy_rule)
app.jinja_env.globals.update({ # pylint: disable=no-member
qkd_app.jinja_env.globals.update({ # pylint: disable=no-member
'enumerate' : enumerate,
'grpc_message_to_json': grpc_message_to_json,
'json_to_list' : json_to_list,
......@@ -123,5 +123,5 @@ def create_app(use_config=None, web_app_root=None):
})
if web_app_root is not None:
app.wsgi_app = SetSubAppMiddleware(app.wsgi_app, web_app_root)
return app
qkd_app.wsgi_qkd_app = SetSubAppMiddleware(qkd_app.wsgi_qkd_app, web_qkd_app_root)
return qkd_app
......@@ -21,11 +21,11 @@ from common.tools.context_queries.Context import get_context
from common.tools.context_queries.Device import get_device
from common.tools.context_queries.Topology import get_topology
from context.client.ContextClient import ContextClient
from app.client.QKDAppClient import QKDAppClient
from qkd_app.client.QKDAppClient import QKDAppClient
LOGGER = logging.getLogger(__name__)
app = Blueprint('qkd_app', __name__, url_prefix='/app')
app = Blueprint('qkd_app', __name__, url_prefix='/qkd_app')
qkd_app_client = QKDAppClient()
context_client = ContextClient()
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment