aboutsummaryrefslogtreecommitdiff
path: root/src/hydrilla/proxy/web_ui/root.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/hydrilla/proxy/web_ui/root.py')
-rw-r--r--src/hydrilla/proxy/web_ui/root.py6
1 files changed, 5 insertions, 1 deletions
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