Development
This commit is contained in:
parent
44277f9064
commit
263639eb95
1 changed files with 2 additions and 2 deletions
|
|
@ -773,8 +773,8 @@ def collect_tokens():
|
||||||
tokens['VLAN_NAMES_AS_OPTIONS'] = json.dumps([{'value': n, 'label': n} for n in vlan_names])
|
tokens['VLAN_NAMES_AS_OPTIONS'] = json.dumps([{'value': n, 'label': n} for n in vlan_names])
|
||||||
tokens['VPN_VLAN_COUNT'] = str(sum(1 for v in vlans if v.get('is_vpn')))
|
tokens['VPN_VLAN_COUNT'] = str(sum(1 for v in vlans if v.get('is_vpn')))
|
||||||
tokens['EXISTING_VLAN_IDS_JSON'] = json.dumps([v.get('vlan_id') for v in vlans])
|
tokens['EXISTING_VLAN_IDS_JSON'] = json.dumps([v.get('vlan_id') for v in vlans])
|
||||||
_default_vlan = next((v.get('name', '') for v in vlans if v.get('radius_default')), None)
|
_dv = next((v for v in vlans if v.get('radius_default')), None)
|
||||||
tokens['RADIUS_DEFAULT_VLAN'] = _default_vlan if _default_vlan else 'none set'
|
tokens['RADIUS_DEFAULT_VLAN'] = f'"{_dv["name"]}" (VLAN {_dv["vlan_id"]})' if _dv else 'none set'
|
||||||
tokens['STAT_BANNED_IP_COUNT'] = str(sum(1 for b in cfg.get('banned_ips', []) if b.get('enabled', True)))
|
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['STAT_BLOCKLIST_COUNT'] = str(len(cfg.get('dns_blocking', {}).get('blocklists', [])))
|
||||||
tokens['BLOCKLIST_STATS_HTML'] = _blocklist_stats_html(cfg)
|
tokens['BLOCKLIST_STATS_HTML'] = _blocklist_stats_html(cfg)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue