Development
This commit is contained in:
parent
b5b3699590
commit
8ae6985503
1 changed files with 1 additions and 7 deletions
|
|
@ -4,7 +4,6 @@ import json, re, subprocess, os, sys, html as html_mod
|
||||||
import sanitize
|
import sanitize
|
||||||
import validation as validate
|
import validation as validate
|
||||||
from datetime import datetime, timezone
|
from datetime import datetime, timezone
|
||||||
from zoneinfo import ZoneInfo, ZoneInfoNotFoundError
|
|
||||||
from config_utils import core_hash, get_pending_entries, get_dashboard_pending, _seconds_until_next_run, _format_timing, _is_locked, _lock_mtime, WEB_APP_DISPLAY_NAME, CONFIGS_DIR, DATA_DIR
|
from config_utils import core_hash, get_pending_entries, get_dashboard_pending, _seconds_until_next_run, _format_timing, _is_locked, _lock_mtime, WEB_APP_DISPLAY_NAME, CONFIGS_DIR, DATA_DIR
|
||||||
|
|
||||||
bp = Blueprint('view_page', __name__)
|
bp = Blueprint('view_page', __name__)
|
||||||
|
|
@ -431,12 +430,7 @@ def _blocklist_stats_html(core):
|
||||||
entries = sum(1 for _ in f)
|
entries = sum(1 for _ in f)
|
||||||
mtime = int(os.path.getmtime(bl_path))
|
mtime = int(os.path.getmtime(bl_path))
|
||||||
size_str = _fmt_bytes(os.path.getsize(bl_path))
|
size_str = _fmt_bytes(os.path.getsize(bl_path))
|
||||||
tz_name = session.get('timezone', '')
|
last_refreshed = f'{datetime.fromtimestamp(mtime).strftime("%Y-%m-%d %H:%M")} ({_relative_time(mtime)})'
|
||||||
try:
|
|
||||||
tz = ZoneInfo(tz_name) if tz_name else timezone.utc
|
|
||||||
except ZoneInfoNotFoundError:
|
|
||||||
tz = timezone.utc
|
|
||||||
last_refreshed = f'{datetime.fromtimestamp(mtime, tz=tz).strftime("%Y-%m-%d %H:%M")} ({_relative_time(mtime)})'
|
|
||||||
except Exception:
|
except Exception:
|
||||||
entries, size_str, last_refreshed = '-', '-', 'Never'
|
entries, size_str, last_refreshed = '-', '-', 'Never'
|
||||||
rows += (f'<tr>'
|
rows += (f'<tr>'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue