Development

This commit is contained in:
Matthew Grotke 2026-06-08 10:48:44 -04:00
parent 58534c3915
commit 114da3cd1c
3 changed files with 33 additions and 4 deletions

View file

@ -92,6 +92,13 @@ def collect_tokens(cfg):
'<option value="802.1X">802.1X Supplicant</option>'
)
tokens['STATUS_FILTER_OPTIONS'] = (
'<option value="all">-- All Account Statuses --</option>'
'<option value="Active">Active Accounts</option>'
'<option value="Disabled">Disabled Accounts</option>'
'<option value="Expired">Expired Accounts</option>'
)
vlans = [v for v in cfg.get('vlans', []) if not v.get('is_vpn')]
tokens['CRED_VLAN_FILTER_OPTIONS'] = (
'<option value="all">-- All VLANs --</option>' +
@ -130,7 +137,12 @@ def collect_tokens(cfg):
expires_seconds = r.get('expires_seconds', 0)
is_expired = (expires_seconds > 0 and
(r.get('date_set', 0) + expires_seconds) <= int(time.time()))
r['active'] = r.get('enabled', 0) == 1 and not is_expired
if r.get('enabled', 0) != 1:
r['account_status'] = 'Disabled'
elif is_expired:
r['account_status'] = 'Expired'
else:
r['account_status'] = 'Active'
display_rows.append(r)
content = factory.load_json(f'{factory.PAGES_DIR}/clientcredentials/content.json')