You've already forked snikket-web-portal
Make version info only available on admin or debug sessions
This commit is contained in:
@@ -79,8 +79,11 @@ async def login() -> typing.Union[str, quart.Response]:
|
|||||||
|
|
||||||
@bp.route("/meta/about.html")
|
@bp.route("/meta/about.html")
|
||||||
async def about() -> str:
|
async def about() -> str:
|
||||||
|
version = None
|
||||||
extra_versions = {}
|
extra_versions = {}
|
||||||
if current_app.debug:
|
|
||||||
|
if current_app.debug or client.is_admin_session:
|
||||||
|
version = _version.version
|
||||||
extra_versions["Quart"] = quart.__version__
|
extra_versions["Quart"] = quart.__version__
|
||||||
extra_versions["aiohttp"] = aiohttp.__version__
|
extra_versions["aiohttp"] = aiohttp.__version__
|
||||||
extra_versions["babel"] = babel.__version__
|
extra_versions["babel"] = babel.__version__
|
||||||
@@ -89,7 +92,7 @@ async def about() -> str:
|
|||||||
|
|
||||||
return await render_template(
|
return await render_template(
|
||||||
"about.html",
|
"about.html",
|
||||||
version=_version.version,
|
version=version,
|
||||||
extra_versions=extra_versions,
|
extra_versions=extra_versions,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
<h3>{% trans %}Software Versions{% endtrans %}</h3>
|
<h3>{% trans %}Software Versions{% endtrans %}</h3>
|
||||||
<pre>Snikket Server
|
<pre>Snikket Server
|
||||||
Domain: {{ config["SNIKKET_DOMAIN"] }}
|
Domain: {{ config["SNIKKET_DOMAIN"] }}
|
||||||
Snikket Web Portal ({{ version }})
|
Snikket Web Portal{% if version %} ({{ version }}){% endif %}
|
||||||
{%- if extra_versions -%}
|
{%- if extra_versions -%}
|
||||||
{% for name, version in extra_versions.items() %}
|
{% for name, version in extra_versions.items() %}
|
||||||
{{ name }} ({{ version }}){% endfor %}
|
{{ name }} ({{ version }}){% endfor %}
|
||||||
|
|||||||
Reference in New Issue
Block a user