diff --git a/main.py b/main.py index 087967b..afab781 100644 --- a/main.py +++ b/main.py @@ -180,7 +180,7 @@ app.clientside_callback( """ function(data) { if (!data) return ''; - setTimeout(function() { + requestAnimationFrame(() => { const btn = document.getElementById('load-more-logs-btn'); const info = document.getElementById('logs-info-text'); if (!btn || !info || info.innerText.toLowerCase().includes('all')) { @@ -194,7 +194,7 @@ app.clientside_callback( containers.forEach(container => { container.onscroll = function() { - if (container.scrollHeight - container.scrollTop - container.clientHeight < 200) { + if (container.scrollHeight - container.scrollTop - container.clientHeight < 1500) { if (btn && btn.dataset.loading === "false") { btn.dataset.loading = "true"; btn.click(); @@ -202,14 +202,14 @@ app.clientside_callback( } }; - if (container.scrollHeight - container.scrollTop - container.clientHeight < 200) { + if (container.scrollHeight - container.scrollTop - container.clientHeight < 1500) { if (btn && btn.dataset.loading === "false") { btn.dataset.loading = "true"; btn.click(); } } }); - }, 200); + }); return ''; } """, @@ -243,7 +243,7 @@ def update_logs_table(vehicle, bus, n_clicks, current_data): current_data = [] offset = len(current_data) if current_data else 0 - chunk_size = 1000 + chunk_size = 50000 if offset >= total_rows: return current_data, columns, f"Displaying all {total_rows} total frames." @@ -359,4 +359,4 @@ def update_corr(method, target, vehicle, bus, tab): return plot_correlation_heatmap(corr_df, target_id=target_id, title=title) if __name__ == '__main__': - app.run(debug=False) \ No newline at end of file + app.run(debug=False)