Development
This commit is contained in:
parent
9c395ab1e8
commit
c0230f25d8
3 changed files with 13 additions and 2 deletions
|
|
@ -126,7 +126,8 @@ def networklayout_tablevlans_edit():
|
|||
flash(f"'{raw_ip}' is not a valid IP address.", 'error')
|
||||
return redirect(VIEW)
|
||||
identity_ips.append(clean)
|
||||
identity_descs = request.form.get('server_identity_descriptions', '').splitlines()
|
||||
identity_descs = request.form.get('server_identity_descriptions', '').splitlines()
|
||||
identity_hostnames = request.form.get('server_identity_hostnames', '').splitlines()
|
||||
|
||||
subnet_mask_raw = request.form.get('subnet_mask')
|
||||
if subnet_mask_raw is not None:
|
||||
|
|
@ -187,6 +188,11 @@ def networklayout_tablevlans_edit():
|
|||
entry['description'] = desc
|
||||
else:
|
||||
entry.pop('description', None)
|
||||
hostname = identity_hostnames[i].strip() if i < len(identity_hostnames) else ''
|
||||
if hostname:
|
||||
entry['hostname'] = hostname
|
||||
else:
|
||||
entry.pop('hostname', None)
|
||||
new_identities.append(entry)
|
||||
|
||||
before = {k: existing.get(k) for k in _VLAN_FIELDS}
|
||||
|
|
|
|||
|
|
@ -312,6 +312,9 @@ def _config_datasource(name):
|
|||
row['server_identity_descriptions'] = json.dumps([
|
||||
s.get('description', '') for s in v.get('server_identities', []) if s.get('ip')
|
||||
])
|
||||
row['server_identity_hostnames'] = json.dumps([
|
||||
s.get('hostname', '') for s in v.get('server_identities', []) if s.get('ip')
|
||||
])
|
||||
rows.append(row)
|
||||
return rows
|
||||
|
||||
|
|
|
|||
|
|
@ -1581,7 +1581,9 @@
|
|||
"col": "server_identity_ips",
|
||||
"input_type": "textarea_pair",
|
||||
"pair_col": "server_identity_descriptions",
|
||||
"pair_placeholder": "Description"
|
||||
"pair_placeholder": "Description",
|
||||
"pair_col2": "server_identity_hostnames",
|
||||
"pair_placeholder2": "Hostname"
|
||||
},
|
||||
{
|
||||
"col": "radius_default",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue