Development

This commit is contained in:
Matthew Grotke 2026-05-27 01:35:52 -04:00
parent c0230f25d8
commit 67186ee6b7

View file

@ -305,8 +305,14 @@ def _config_datasource(name):
row['use_blocklists'] = json.dumps([
{'n': bl, 'd': bl_desc.get(bl, bl)} for bl in v.get('use_blocklists', [])
])
_prefix = v.get('subnet_mask', 24)
_n_octets = 1 if _prefix >= 24 else 2 if _prefix >= 16 else 3 if _prefix >= 8 else 4
row['server_identity_ips'] = json.dumps([
{'n': s['ip'], 'd': s['ip'], 'short': '.' + s['ip'].rsplit('.', 1)[-1], 'mini': '.' + s['ip'].rsplit('.', 1)[-1]}
{
'n': s['ip'], 'd': s['ip'],
'short': '.' + '.'.join(s['ip'].split('.')[-_n_octets:]),
'mini': '.' + '.'.join(s['ip'].split('.')[-_n_octets:]),
}
for s in v.get('server_identities', []) if s.get('ip')
])
row['server_identity_descriptions'] = json.dumps([