acrn-hypervisor/misc/acrn-config/config_app/app.py
Shuang Zheng 00da5a994e acrn-config: web UI app for acrn-config tool
The web UI application for ACRN VM configuration tool based on Flask web framework:
1. import board info xml which is generated by acrn-config/target on target boards; or select one
board from the imported list of UI.
2. load scenario settings or import scenario settings from local.
3. edit scenario settings from web UI.
4. export and save the edited scenario setting, the application will prompt error messages from UI
if there are illegal configured items.
5. generate board source code, generate scenario source code.
6. load launch settings or import launch settings from local.
7. edit launch settings from web UI.
8. export and save the edited launch setting; the application will prompt error messages from UI
if there are illegal configurable items
9. generate launch scripts based on current launch setting.

Tracked-On: #3602
Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
Acked-by: Terry Zou <terry.zou@intel.com>
2019-09-11 13:43:35 +08:00

44 lines
1.4 KiB
Python

# Copyright (C) 2019 Intel Corporation.
# SPDX-License-Identifier: BSD-3-Clause
"""Entry for config app.
"""
import os
import sys
import threading
import webbrowser
# flask: Copyright 2010 Pallets
# SPDX-License-Identifier: BSD-3-Clause
# Refer to https://github.com/pallets/flask/blob/master/LICENSE.rst for the permission notice.
from flask import Flask
# flask: Copyright (c) 2013, Marc Brinkmann
# SPDX-License-Identifier: BSD-3-Clause
# Refer to https://pypi.org/project/Flask-Bootstrap/ for the permission notice.
from flask_bootstrap import Bootstrap
import configs
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..'))
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'library'))
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..',
'board_config'))
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..',
'scenario_config'))
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..',
'launch_config'))
from views import CONFIG_APP
APP = Flask(__name__)
APP.config.from_object(configs)
APP.register_blueprint(CONFIG_APP)
APP.jinja_env.add_extension('jinja2.ext.do')
Bootstrap(app=APP)
if __name__ == '__main__':
URL = "http://127.0.0.1:5001/scenario"
threading.Timer(1, lambda: webbrowser.open(URL)).start()
APP.run(port=5001, debug=False)