Development
This commit is contained in:
parent
e52fe9bf8a
commit
db837af548
9 changed files with 98 additions and 25 deletions
|
|
@ -97,7 +97,7 @@
|
|||
},
|
||||
{
|
||||
"type": "raw_html",
|
||||
"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>"
|
||||
"html": "<script id=\"captive-vlan-data\" type=\"application/json\">%CAPTIVE_VLAN_OPTIONS%</script><script id=\"page-flags\" type=\"application/json\">{\"pro\": %PRO_LICENSE_JS%, \"radius_session_seconds\": %RADIUS_DEFAULT_SESSION_SECONDS_JS%}</script>"
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
|
|
|
|||
|
|
@ -69,6 +69,9 @@ def collect_tokens(cfg):
|
|||
'Credentials can be viewed but not added or edited without a Pro license.</span></div>'
|
||||
)
|
||||
tokens['ADD_CREDENTIAL_DISABLED'] = 'true'
|
||||
tokens['RADIUS_DEFAULT_SESSION_SECONDS_JS'] = str(
|
||||
cfg.get('radius', {}).get('options', {}).get('default_session_seconds', 0) or 0
|
||||
)
|
||||
|
||||
vlans = [v for v in cfg.get('vlans', []) if not v.get('is_vpn')]
|
||||
tokens['VLAN_OPTIONS'] = json.dumps(
|
||||
|
|
@ -84,8 +87,8 @@ def collect_tokens(cfg):
|
|||
'label': f"{v['name']} (VLAN {v['vlan_id']})",
|
||||
'require_upw': v.get('captive_portal', {}).get('require_username_password',
|
||||
v.get('require_username_password', False)),
|
||||
'default_duration_seconds': v.get('captive_portal', {}).get('default_duration_seconds',
|
||||
v.get('default_duration_seconds', 0)),
|
||||
'default_session_seconds': v.get('captive_portal', {}).get('default_session_seconds',
|
||||
v.get('default_session_seconds', 0)),
|
||||
}
|
||||
for v in captive_vlans
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue