From aaf2b0b534d2ba8e9e77afadd853d54b7d6e540d Mon Sep 17 00:00:00 2001 From: Marek Rogalski Date: Sun, 11 Jun 2023 18:06:14 +0200 Subject: [PATCH] Show the most recent log lines on the main page --- webui.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webui.cc b/webui.cc index 464610d..c022836 100644 --- a/webui.cc +++ b/webui.cc @@ -546,7 +546,9 @@ function ToggleAutoRefresh() { "onclick=\"ToggleAutoRefresh()\">Toggle Auto-refresh"; config_table.RenderTABLE(html, opts); devices_table.RenderTABLE(html, opts); - log_table.RenderTABLE(html, opts); + Table::RenderOptions log_opts = opts; + log_opts.row_offset = std::max(0, messages.size() - opts.row_limit); + log_table.RenderTABLE(html, log_opts); dhcp::table.RenderTABLE(html, opts); dns::table.RenderTABLE(html, opts); html += "";