Development
This commit is contained in:
parent
bb07e67d53
commit
69b5f00d5b
8 changed files with 165 additions and 26 deletions
|
|
@ -23,14 +23,22 @@ def collect_tokens(cfg):
|
|||
|
||||
display_rows = []
|
||||
for vlan in captive_vlans:
|
||||
terms = vlan.get('portal_terms', [])
|
||||
cp = vlan.get('captive_portal', {})
|
||||
title = cp.get('portal_splash_title', vlan.get('portal_splash_title', ''))
|
||||
text = cp.get('portal_splash_text', vlan.get('portal_splash_text', ''))
|
||||
terms = cp.get('portal_terms', vlan.get('portal_terms', []))
|
||||
require_upw = cp.get('require_username_password', vlan.get('require_username_password', False))
|
||||
duration = cp.get('default_duration_seconds', vlan.get('default_duration_seconds', 0))
|
||||
n = len(terms)
|
||||
display_rows.append({
|
||||
'vlan_name': vlan['name'],
|
||||
'portal_splash_title': vlan.get('portal_splash_title', ''),
|
||||
'portal_splash_text': vlan.get('portal_splash_text', ''),
|
||||
'portal_terms': terms,
|
||||
'portal_terms_display': f'{n} term{"s" if n != 1 else ""}' if n else '--',
|
||||
'vlan_name': vlan['name'],
|
||||
'portal_splash_title': title,
|
||||
'portal_splash_text': text,
|
||||
'portal_terms': terms,
|
||||
'portal_terms_display': f'{n} term{"s" if n != 1 else ""}' if n else '--',
|
||||
'require_upw': require_upw,
|
||||
'require_username_password': require_upw,
|
||||
'default_duration_seconds': duration,
|
||||
})
|
||||
|
||||
content = factory.load_json(f'{factory.PAGES_DIR}/captiveportal/content.json')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue