Development
This commit is contained in:
parent
6d9aac0460
commit
59ac3c5973
20 changed files with 1466 additions and 1 deletions
15
docker/routlin-dash/app/pages/networklayout/view.py
Normal file
15
docker/routlin-dash/app/pages/networklayout/view.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import json
|
||||
|
||||
|
||||
def collect_tokens(cfg):
|
||||
vlans = cfg.get('vlans', [])
|
||||
dv = next((v for v in vlans if v.get('radius_default')), None)
|
||||
return {
|
||||
'EXISTING_VLAN_IDS_JSON': json.dumps([v.get('vlan_id') for v in vlans]),
|
||||
'EXISTING_VLAN_NAMES_JSON': json.dumps([v.get('name') for v in vlans]),
|
||||
'RADIUS_DEFAULT_VLAN': f'"{dv["name"]}" (VLAN {dv["vlan_id"]})' if dv else 'none set',
|
||||
'BLOCKLIST_NAME_OPTIONS': json.dumps([
|
||||
{'value': bl.get('name', ''), 'label': bl.get('description', bl.get('name', ''))}
|
||||
for bl in cfg.get('dns_blocking', {}).get('blocklists', [])
|
||||
]),
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue