Development
This commit is contained in:
parent
8bd5d022e0
commit
e140628c5e
2 changed files with 4 additions and 4 deletions
|
|
@ -138,7 +138,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "raw_html",
|
"type": "raw_html",
|
||||||
"html": "<script id=\"captive-vlan-data\" type=\"application/json\">%CAPTIVE_VLAN_OPTIONS%</script>"
|
"html": "<script id=\"captive-vlan-data\" type=\"application/json\">%CAPTIVE_VLAN_OPTIONS%</script><script id=\"page-flags\" type=\"application/json\">{\"pro\": %PRO_LICENSE_JS%}</script>"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "field",
|
"type": "field",
|
||||||
|
|
|
||||||
|
|
@ -68,16 +68,16 @@ def collect_tokens(cfg):
|
||||||
'<span>Client Credentials is a Routlin Pro feature. '
|
'<span>Client Credentials is a Routlin Pro feature. '
|
||||||
'Credentials can be viewed but not added or edited without a Pro license.</span></div>'
|
'Credentials can be viewed but not added or edited without a Pro license.</span></div>'
|
||||||
)
|
)
|
||||||
tokens['ADD_CREDENTIAL_DISABLED'] = '' if PRO_LICENSE else 'true'
|
tokens['ADD_CREDENTIAL_DISABLED'] = 'true'
|
||||||
|
|
||||||
vlans = [v for v in cfg.get('vlans', []) if not v.get('is_vpn')]
|
vlans = [v for v in cfg.get('vlans', []) if not v.get('is_vpn')]
|
||||||
tokens['VLAN_OPTIONS'] = json.dumps(
|
tokens['VLAN_OPTIONS'] = json.dumps(
|
||||||
[{'value': '', 'label': '— Select VLAN —'}] +
|
[{'value': '', 'label': '- Select VLAN -'}] +
|
||||||
[{'value': v['name'], 'label': f"{v['name']} (VLAN {v['vlan_id']})"} for v in vlans]
|
[{'value': v['name'], 'label': f"{v['name']} (VLAN {v['vlan_id']})"} for v in vlans]
|
||||||
)
|
)
|
||||||
captive_vlans = [v for v in cfg.get('vlans', []) if v.get('restricted_vlan') == 'c']
|
captive_vlans = [v for v in cfg.get('vlans', []) if v.get('restricted_vlan') == 'c']
|
||||||
tokens['CAPTIVE_VLAN_OPTIONS'] = json.dumps(
|
tokens['CAPTIVE_VLAN_OPTIONS'] = json.dumps(
|
||||||
[{'value': '', 'label': '— Select VLAN —'}] +
|
[{'value': '', 'label': '- Select VLAN -'}] +
|
||||||
[{'value': v['name'], 'label': f"{v['name']} (VLAN {v['vlan_id']})"} for v in captive_vlans]
|
[{'value': v['name'], 'label': f"{v['name']} (VLAN {v['vlan_id']})"} for v in captive_vlans]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue