Development
This commit is contained in:
parent
d5dfb637fc
commit
2e4921ab73
4 changed files with 48 additions and 1 deletions
|
|
@ -99,6 +99,18 @@ def collect_tokens(cfg):
|
|||
tokens['DNS_LOG_TAIL'], tokens['DNS_LOG_SUMMARY'] = _dnsblocking_log_tail(cfg)
|
||||
blocklists = cfg.get('dns_blocking', {}).get('blocklists', [])
|
||||
tokens['BLOCKLIST_EXISTING_NAMES_JS'] = json.dumps([bl.get('name', '') for bl in blocklists])
|
||||
vlans = cfg.get('vlans', [])
|
||||
vlan_checkboxes = ''.join(
|
||||
f'<label class="form-checkbox-row">'
|
||||
f'<input type="checkbox" name="used_by_vlans" value="{factory.e(v["name"])}" class="form-checkbox">'
|
||||
f' <span class="form-checkbox-label">{factory.e(v["name"])}</span>'
|
||||
f'</label>'
|
||||
for v in vlans if v.get('name')
|
||||
)
|
||||
tokens['VLAN_USED_BY_CHECKBOXES'] = (
|
||||
f'<div class="form-group"><label class="form-label">Used By</label>'
|
||||
f'<div>{vlan_checkboxes}</div></div>'
|
||||
) if vlan_checkboxes else ''
|
||||
content = factory.load_json(f'{factory.PAGES_DIR}/dnsblocking/content.json')
|
||||
for table_item in factory.iter_table_items(content.get('items', [])):
|
||||
ds = table_item.get('datasource', '')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue