Replace infinite scroll with paginated log view

This commit is contained in:
2026-07-22 23:09:47 +02:00
parent 3b703e845f
commit fab448785b
2 changed files with 105 additions and 65 deletions
+11 -4
View File
@@ -3,7 +3,10 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
import pandas as pd
from dash import html, dash_table
from dash import html, dash_table, dcc
import dash_bootstrap_components as dbc
PAGE_SIZE = 25000
def prepare_logs_data(df: pd.DataFrame) -> pd.DataFrame:
if df is None or df.empty:
@@ -44,7 +47,7 @@ def get_logs_table_component():
id='logs-table',
virtualization=True,
page_action='none',
style_table={'overflowX': 'auto', 'height': '75vh', 'overflowY': 'auto'},
style_table={'overflowX': 'auto', 'height': '70vh', 'overflowY': 'auto'},
style_header={
'backgroundColor': '#1a1a1a',
'color': 'white',
@@ -71,6 +74,10 @@ def get_logs_table_component():
'fontFamily': 'Segoe UI, Arial, sans-serif'
}
),
html.Button("Load More", id="load-more-logs-btn", n_clicks=0, style={'display': 'none'}),
html.Div(id='dummy-output', style={'display': 'none'})
html.Div([
dbc.Button("Prev", id='logs-prev-btn', color="secondary", outline=True, size="sm", className="me-2"),
html.Div(id='logs-page-nav', className="d-inline-block", style={'verticalAlign': 'middle'}),
dbc.Button("Next", id='logs-next-btn', color="secondary", outline=True, size="sm", className="ms-2"),
], className="d-flex justify-content-center align-items-center mt-3"),
dcc.Store(id='logs-current-page', data=0),
])