Development
This commit is contained in:
parent
f81acce23a
commit
fcdaf09477
2 changed files with 7 additions and 3 deletions
|
|
@ -779,7 +779,7 @@ def collect_tokens():
|
|||
try:
|
||||
tokens['RADIUS_SECRET'] = open(f'{CONFIGS_DIR}/.radius-secret').read().strip()
|
||||
except OSError:
|
||||
tokens['RADIUS_SECRET'] = '(not yet generated - run core apply)'
|
||||
tokens['RADIUS_SECRET'] = '(Generation is pending - visit Actions to apply generation command)'
|
||||
tokens['STAT_BANNED_IP_COUNT'] = str(sum(1 for b in cfg.get('banned_ips', []) if b.get('enabled', True)))
|
||||
tokens['STAT_BLOCKLIST_COUNT'] = str(len(cfg.get('dns_blocking', {}).get('blocklists', [])))
|
||||
tokens['BLOCKLIST_STATS_HTML'] = _blocklist_stats_html(cfg)
|
||||
|
|
@ -1121,6 +1121,10 @@ def serve_view(page_name):
|
|||
|
||||
tokens = collect_tokens()
|
||||
|
||||
if page_name == 'radius' and not os.path.exists(f'{CONFIGS_DIR}/.radius-secret'):
|
||||
from config_utils import queue_command
|
||||
queue_command('gen radius')
|
||||
|
||||
flash_html = ''
|
||||
for category, message in get_flashed_messages(with_categories=True):
|
||||
variant = {'error': 'danger', 'warning': 'warning', 'success': 'success'}.get(category, 'info')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue