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__,
template_folder='web/templates',
static_folder='web/static')
babel = Babel(app,
locale_selector=my_get_locale,
timezone_selector=my_get_tz,
default_translation_directories='../translations')
app.register_blueprint(web_routes)

View File

@@ -1,6 +1,7 @@
from quart import Blueprint
from quart import render_template, url_for
from quart import send_from_directory
from quart_babel import format_datetime
import os
web_routes = Blueprint('web_routes', __name__)
@@ -50,6 +51,7 @@ async def data_fetch():
TsunCnt += 1
return {
"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 -->
<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>
{% 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>
{% endif %}
</div>
<!-- Sidebar/menu -->