display time of last update and add reload button

This commit is contained in:
Stefan Allius
2025-04-21 00:28:47 +02:00
parent 3b4a0c37fe
commit f1fb43ff67
5 changed files with 19 additions and 2 deletions

View File

@@ -41,11 +41,16 @@ def my_get_locale():
) )
def my_get_tz():
return 'CET'
app = Quart(__name__, app = Quart(__name__,
template_folder='web/templates', template_folder='web/templates',
static_folder='web/static') static_folder='web/static')
babel = Babel(app, babel = Babel(app,
locale_selector=my_get_locale, locale_selector=my_get_locale,
timezone_selector=my_get_tz,
default_translation_directories='../translations') default_translation_directories='../translations')
app.register_blueprint(web_routes) app.register_blueprint(web_routes)

View File

@@ -1,6 +1,7 @@
from quart import Blueprint from quart import Blueprint
from quart import render_template, url_for from quart import render_template, url_for
from quart import send_from_directory from quart import send_from_directory
from quart_babel import format_datetime
import os import os
web_routes = Blueprint('web_routes', __name__) web_routes = Blueprint('web_routes', __name__)
@@ -50,6 +51,7 @@ async def data_fetch():
TsunCnt += 1 TsunCnt += 1
return { return {
"proxy-cnt": f"<h3>{TsunCnt}</h3>", "proxy-cnt": f"<h3>{TsunCnt}</h3>",
"update-time": format_datetime(format="medium"),
} }

File diff suppressed because one or more lines are too long

View File

@@ -24,7 +24,11 @@
<!-- Top container --> <!-- Top container -->
<div class="w3-bar w3-top w3-black w3-large" style="z-index:4"> <div class="w3-bar w3-top w3-black w3-large" style="z-index:4">
<button class="w3-bar-item w3-button w3-hide-large w3-hover-none w3-hover-text-light-grey" onclick="w3_open();"><i class="fa fa-bars"></i>  Menu</button> <button class="w3-bar-item w3-button w3-hide-large w3-hover-none w3-hover-text-light-grey" onclick="w3_open();"><i class="fa fa-bars"></i>  Menu</button>
{% if fetch_url is defined %}
<span class="w3-bar-item w3-right" onclick="fetch_data();"><span class="w3-hide-small">{{_('Updated:')}}  </span><span id="update-time"></span>  <i class="fa fa-rotate-right w3-medium"></i></span>
{% else %}
<span class="w3-bar-item w3-right">Logo</span> <span class="w3-bar-item w3-right">Logo</span>
{% endif %}
</div> </div>
<!-- Sidebar/menu --> <!-- Sidebar/menu -->

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: tsun-gen3-proxy 0.14.0\n" "Project-Id-Version: tsun-gen3-proxy 0.14.0\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2025-04-20 18:53+0200\n" "POT-Creation-Date: 2025-04-20 21:21+0200\n"
"PO-Revision-Date: 2025-04-18 16:24+0200\n" "PO-Revision-Date: 2025-04-18 16:24+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: de\n" "Language: de\n"
@@ -19,6 +19,10 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.17.0\n" "Generated-By: Babel 2.17.0\n"
#: src/web/templates/base.html.j2:27
msgid "Updated:"
msgstr "Aktualisiert:"
#: src/web/templates/base.html.j2:46 #: src/web/templates/base.html.j2:46
msgid "Connections" msgid "Connections"
msgstr "Verbindungen" msgstr "Verbindungen"