Development

This commit is contained in:
Matthew Grotke 2026-06-05 02:23:08 -04:00
parent b307461d44
commit 4734eb41a0
3 changed files with 32 additions and 16 deletions

View file

@ -64,9 +64,19 @@ def collect_tokens(cfg):
fr = cfg.get('radius', {})
fr_opts = fr.get('options', {})
fr_gen = fr.get('general', {})
tokens['RADIUS_MAC_FORMAT'] = fr_opts.get('mac_format', 'aabbccddeeff')
tokens['RADIUS_APPLY_TO'] = fr_opts.get('apply_to', 'all')
tokens['RADIUS_AP_IPS'] = '\n'.join(fr_opts.get('ap_ips', []))
tokens['RADIUS_MAC_FORMAT'] = fr_opts.get('mac_format', 'aabbccddeeff')
tokens['RADIUS_APPLY_TO'] = fr_opts.get('apply_to', 'all')
tokens['RADIUS_AP_IPS'] = json.dumps(fr_opts.get('ap_ips', []))
radius_client_reservations = [
r for r in cfg.get('dhcp_reservations', [])
if r.get('radius_client') is True
and r.get('ip') and r.get('ip') not in ('', 'dynamic')
]
tokens['RADIUS_AP_IPS_OPTIONS'] = json.dumps([
{'value': r['ip'], 'label': f"{r.get('description', r['ip'])} ({r['ip']})"}
for r in radius_client_reservations
])
tokens['RADIUS_LOGGING'] = 'true' if fr_gen.get('logging', False) else ''
tokens['RADIUS_LOGGING_HINT'] = 'Unchecking will clear logs.' if fr_gen.get('logging', False) else ''
tokens['RADIUS_GEN_LOG_MAX_KB'] = str(fr_gen.get('log_max_kb', 1024))