add list of last 3 warnings/errors to page

This commit is contained in:
Stefan Allius
2025-05-04 15:26:46 +02:00
parent d5b3b804bc
commit ddf8222003
2 changed files with 9 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ from quart_babel import format_datetime, _
from infos import Infos
from . import web
from .log_handler import LogHandler
def _get_device_icon(client_mode: bool):
@@ -79,5 +80,7 @@ async def data_fetch():
data["conn-table"] = await render_template('templ_table.html.j2',
table=get_table_data())
data["notes-list"] = await render_template('templ_notes_list.html.j2')
data["notes-list"] = await render_template(
'templ_notes_list.html.j2',
notes=LogHandler().get_buffer(3))
return data

View File

@@ -4,6 +4,7 @@ from quart_babel import format_datetime, _
from mqtt import Mqtt
from . import web
from .log_handler import LogHandler
def _get_row(inv: InverterBase):
@@ -55,4 +56,8 @@ async def mqtt_fetch():
data["mqtt-table"] = await render_template('templ_table.html.j2',
table=get_table_data())
data["notes-list"] = await render_template(
'templ_notes_list.html.j2',
notes=LogHandler().get_buffer(3))
return data