diff --git a/docker/routlin-dash/app/view_page.py b/docker/routlin-dash/app/view_page.py index 390bfff..4760fa4 100644 --- a/docker/routlin-dash/app/view_page.py +++ b/docker/routlin-dash/app/view_page.py @@ -465,6 +465,7 @@ DDNS_LOG_MAX = 50 def _ddns_log_tail(): log_path = f'{CONFIGS_DIR}/ddns.log' try: + size_kb = os.path.getsize(log_path) / 1024 with open(log_path) as f: lines = f.readlines() if not lines: @@ -473,10 +474,11 @@ def _ddns_log_tail(): tail = lines[-DDNS_LOG_MAX:] shown = len(tail) hidden = total - shown + size_str = f'{size_kb:.1f}KB' if hidden > 0: - summary = f'Showing last {shown} lines ({hidden} lines not shown)' + summary = f'Log file size: {size_str}. Showing last {shown} lines ({hidden} lines not shown).' else: - summary = f'Showing {shown} lines' + summary = f'Log file size: {size_str}. Showing {shown} lines.' return ''.join(tail).strip(), f'
{summary}
' except FileNotFoundError: return '(log file not found)', ''