From ba580db6b07d6fcb4877259f13052ddee34afb90 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Tue, 27 Sep 2022 11:03:55 +0200 Subject: [proxy] make some (possibly confusing) web UI parts only display to advanced users --- src/hydrilla/proxy/web_ui/root.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/hydrilla/proxy/web_ui/root.py') diff --git a/src/hydrilla/proxy/web_ui/root.py b/src/hydrilla/proxy/web_ui/root.py index ed030d2..21c491b 100644 --- a/src/hydrilla/proxy/web_ui/root.py +++ b/src/hydrilla/proxy/web_ui/root.py @@ -64,11 +64,14 @@ def authenticate_by_referrer() -> t.Optional[werkzeug.Response]: flask.abort(403) -def get_current_endpoint() -> t.Optional[str]: +def get_current_endpoint() -> str: endpoint = flask.request.endpoint assert endpoint is not None return endpoint +def get_settings() -> st.HaketiloGlobalSettings: + return _app.get_haketilo_state().get_settings() + class WebUIAppImpl(_app.WebUIApp): def __init__(self): @@ -87,6 +90,7 @@ class WebUIAppImpl(_app.WebUIApp): } self.jinja_env.globals['get_current_endpoint'] = get_current_endpoint + self.jinja_env.globals['get_settings'] = get_settings self.jinja_env.globals['EnabledStatus'] = st.EnabledStatus self.jinja_env.globals['FrozenStatus'] = st.FrozenStatus self.jinja_env.globals['InstalledStatus'] = st.InstalledStatus -- cgit v1.2.3