Development
This commit is contained in:
parent
e37029a066
commit
574a45111d
8 changed files with 164 additions and 110 deletions
|
|
@ -13,8 +13,19 @@ def collect_tokens(cfg):
|
|||
tokens['EXISTING_VLAN_IDS_JSON'] = json.dumps([v.get('vlan_id') for v in vlans])
|
||||
tokens['EXISTING_VLAN_NAMES_JSON'] = json.dumps([v.get('name') for v in vlans])
|
||||
tokens['RADIUS_DEFAULT_VLAN'] = f'"{dv["name"]}" (VLAN {dv["vlan_id"]})' if dv else 'none set'
|
||||
tokens['RESTRICTED_VLAN_LABEL'] = 'Restricted VLAN' if PRO_LICENSE else 'Restricted VLAN (PRO FEATURE)'
|
||||
tokens['RESTRICTED_VLAN_DISABLED'] = '' if PRO_LICENSE else 'true'
|
||||
tokens['PRO_LICENSE_JS'] = 'true' if PRO_LICENSE else ''
|
||||
if PRO_LICENSE:
|
||||
tokens['RESTRICTED_VLAN_OPTIONS'] = json.dumps([
|
||||
{'value': '', 'label': 'Unrestricted'},
|
||||
{'value': 'q', 'label': 'Quarantined'},
|
||||
{'value': 'c', 'label': 'Captive Portal'},
|
||||
])
|
||||
else:
|
||||
tokens['RESTRICTED_VLAN_OPTIONS'] = json.dumps([
|
||||
{'value': '', 'label': 'Unrestricted'},
|
||||
{'value': 'q', 'label': 'Quarantined (PRO REQUIRED)', 'disabled': True},
|
||||
{'value': 'c', 'label': 'Captive Portal (PRO REQUIRED)', 'disabled': True},
|
||||
])
|
||||
tokens['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