Development
This commit is contained in:
parent
901e3b3f2d
commit
03ccf44c8c
3 changed files with 51 additions and 7 deletions
|
|
@ -121,6 +121,42 @@ 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])
|
||||
bl_options = ''.join(
|
||||
f'<option value="{factory.e(bl["name"])}">{factory.e(bl["name"])}</option>'
|
||||
for bl in blocklists if bl.get('name')
|
||||
)
|
||||
tokens['BLOCKLIST_SEARCH_HTML'] = (
|
||||
'<div style="display:flex;gap:0.75rem;align-items:flex-end;flex-wrap:wrap;">'
|
||||
'<div>'
|
||||
'<label class="form-label">Match</label>'
|
||||
'<select id="bl-search-match" class="form-input" style="width:auto;">'
|
||||
'<option value="partial">Partial</option>'
|
||||
'<option value="exact">Exact</option>'
|
||||
'<option value="starts_with">Starts With</option>'
|
||||
'<option value="ends_with">Ends With</option>'
|
||||
'</select>'
|
||||
'</div>'
|
||||
'<div>'
|
||||
'<label class="form-label">Search Where</label>'
|
||||
'<select id="bl-search-list" class="form-input" style="width:auto;">'
|
||||
'<option value="">-- All Blocklists --</option>'
|
||||
f'{bl_options}'
|
||||
'</select>'
|
||||
'</div>'
|
||||
'<div>'
|
||||
'<label class="form-label">Limit</label>'
|
||||
'<input id="bl-search-limit" type="number" class="form-input" min="1" max="5000" value="500" style="width:6rem;">'
|
||||
'</div>'
|
||||
'<div style="flex:1 1 200px;">'
|
||||
'<label class="form-label">Search term</label>'
|
||||
'<input id="bl-search-term" type="text" class="form-input" placeholder="e.g. doubleclick.net">'
|
||||
'</div>'
|
||||
'<div style="padding-top:1.4rem;">'
|
||||
'<button id="bl-search-btn" class="btn btn-primary">Search</button>'
|
||||
'</div>'
|
||||
'</div>'
|
||||
'<div id="bl-search-results" style="margin-top:1rem;"></div>'
|
||||
)
|
||||
vlans = cfg.get('vlans', [])
|
||||
vlan_checkboxes = ''.join(
|
||||
f'<label class="form-checkbox-row">'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue