Development
This commit is contained in:
parent
4a24c71d87
commit
d004026285
1 changed files with 5 additions and 6 deletions
|
|
@ -474,12 +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'Log file size: {size_str}. Showing last {shown} lines ({hidden} lines not shown).'
|
||||
else:
|
||||
summary = f'Log file size: {size_str}. Showing {shown} lines.'
|
||||
return ''.join(tail).strip(), f'<p class="text-muted" style="margin-top:0.5em;">{summary}</p>'
|
||||
size_str = f'{size_kb:.1f} KB'
|
||||
left = f'Showing last {shown} lines ({hidden} lines not shown)' if hidden > 0 else f'Showing {shown} lines'
|
||||
summary = (f'<div class="text-muted" style="display:flex;justify-content:space-between;margin-top:0.5em;">'
|
||||
f'<span>{left}</span><span>Log file size: {size_str}</span></div>')
|
||||
return ''.join(tail).strip(), summary
|
||||
except FileNotFoundError:
|
||||
return '(log file not found)', ''
|
||||
except Exception:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue