Development

This commit is contained in:
Matthew Grotke 2026-06-09 11:37:48 -04:00
parent e4a9d5c038
commit bf4e7175cb
4 changed files with 6 additions and 6 deletions

View file

@ -25,7 +25,7 @@ def _ddns_log_tail():
with open(log_path) as f: with open(log_path) as f:
lines = f.readlines() lines = f.readlines()
if not lines: if not lines:
return '(log is empty)', '' return '(no log entries yet)', ''
total = len(lines) total = len(lines)
tail = lines[-DDNS_LOG_MAX:] tail = lines[-DDNS_LOG_MAX:]
shown = len(tail) shown = len(tail)
@ -39,7 +39,7 @@ def _ddns_log_tail():
) )
return ''.join(tail).strip(), summary return ''.join(tail).strip(), summary
except FileNotFoundError: except FileNotFoundError:
return '(log file not found)', '' return '(no log entries yet)', ''
except Exception: except Exception:
return '(error reading log)', '' return '(error reading log)', ''

View file

@ -17,7 +17,7 @@ def _dnsblocking_log_tail(cfg):
with open(DNS_LOG_FILE) as f: with open(DNS_LOG_FILE) as f:
lines = f.readlines() lines = f.readlines()
if not lines: if not lines:
return '(log is empty)', '' return '(no log entries yet)', ''
total = len(lines) total = len(lines)
tail = lines[-DNS_LOG_MAX:] tail = lines[-DNS_LOG_MAX:]
shown = len(tail) shown = len(tail)
@ -31,7 +31,7 @@ def _dnsblocking_log_tail(cfg):
) )
return ''.join(tail).strip(), summary return ''.join(tail).strip(), summary
except FileNotFoundError: except FileNotFoundError:
return '(log file not found)', '' return '(no log entries yet)', ''
except Exception: except Exception:
return '(error reading log)', '' return '(error reading log)', ''

View file

@ -275,7 +275,7 @@ def api_log_tail():
lines = (prev[-need:] if need and prev else []) + current lines = (prev[-need:] if need and prev else []) + current
if not lines: if not lines:
return jsonify({'log': '(log is empty)', 'left': '', 'right': ''}) return jsonify({'log': '(no log entries yet)', 'left': '', 'right': ''})
log_dir = os.path.dirname(RADIUS_LOG_FILE) log_dir = os.path.dirname(RADIUS_LOG_FILE)
try: try:

View file

@ -32,7 +32,7 @@ def radius_log_tail(cfg):
lines = (prev[-need:] if need and prev else []) + current lines = (prev[-need:] if need and prev else []) + current
if not lines: if not lines:
return '(log is empty)', '' return '(no log entries yet)', ''
log_dir = os.path.dirname(RADIUS_LOG_FILE) log_dir = os.path.dirname(RADIUS_LOG_FILE)
try: try: