From 6408e6076303aea982384d0354fca695f8f20882 Mon Sep 17 00:00:00 2001 From: Lluis Gifre Renom Date: Fri, 5 May 2023 09:24:50 +0000 Subject: [PATCH] WebUI component: - Corrected issue with policy tab --- src/webui/service/__init__.py | 4 +- .../{policy => policy_rule}/__init__.py | 0 .../service/{policy => policy_rule}/routes.py | 8 +- src/webui/service/templates/base.html | 8 +- src/webui/service/templates/policy/home.html | 84 ------------------- .../service/templates/policy_rule/home.html | 84 +++++++++++++++++++ 6 files changed, 94 insertions(+), 94 deletions(-) rename src/webui/service/{policy => policy_rule}/__init__.py (100%) rename src/webui/service/{policy => policy_rule}/routes.py (90%) delete mode 100644 src/webui/service/templates/policy/home.html create mode 100644 src/webui/service/templates/policy_rule/home.html diff --git a/src/webui/service/__init__.py b/src/webui/service/__init__.py index e7f50ed42..3c64f45c9 100644 --- a/src/webui/service/__init__.py +++ b/src/webui/service/__init__.py @@ -95,8 +95,8 @@ def create_app(use_config=None, web_app_root=None): from webui.service.link.routes import link # pylint: disable=import-outside-toplevel app.register_blueprint(link) - from webui.service.policy.routes import policy # pylint: disable=import-outside-toplevel - app.register_blueprint(policy) + from webui.service.policy_rule.routes import policy_rule # pylint: disable=import-outside-toplevel + app.register_blueprint(policy_rule) app.jinja_env.globals.update({ # pylint: disable=no-member 'enumerate' : enumerate, diff --git a/src/webui/service/policy/__init__.py b/src/webui/service/policy_rule/__init__.py similarity index 100% rename from src/webui/service/policy/__init__.py rename to src/webui/service/policy_rule/__init__.py diff --git a/src/webui/service/policy/routes.py b/src/webui/service/policy_rule/routes.py similarity index 90% rename from src/webui/service/policy/routes.py rename to src/webui/service/policy_rule/routes.py index 6d14f86b4..9077892ad 100644 --- a/src/webui/service/policy/routes.py +++ b/src/webui/service/policy_rule/routes.py @@ -18,11 +18,11 @@ from common.proto.context_pb2 import Empty from common.proto.policy_pb2 import PolicyRuleStateEnum from context.client.ContextClient import ContextClient -policy = Blueprint('policy', __name__, url_prefix='/policy') +policy_rule = Blueprint('policy_rule', __name__, url_prefix='/policy_rule') context_client = ContextClient() -@policy.get('/') +@policy_rule.get('/') def home(): context_client.connect() policy_rules = context_client.ListPolicyRules(Empty()) @@ -30,8 +30,8 @@ def home(): context_client.close() return render_template('policy/home.html', policy_rules=policy_rules, prse=PolicyRuleStateEnum) -#@policy.get('/detail') -#def detail(policy_uuid: str): +#@policy_rule.get('/detail') +#def detail(policy_rule_uuid: str): # try: # context_client.connect() # diff --git a/src/webui/service/templates/base.html b/src/webui/service/templates/base.html index 61c283b0d..4c31b6193 100644 --- a/src/webui/service/templates/base.html +++ b/src/webui/service/templates/base.html @@ -84,10 +84,10 @@ {% endif %}