Development

This commit is contained in:
Matthew Grotke 2026-05-28 09:28:26 -04:00
parent 3bdba52d57
commit 3b5e9e7eaa
2 changed files with 21 additions and 58 deletions

View file

@ -94,61 +94,10 @@
"row_actions": [ "row_actions": [
{ {
"client_requirement": "client_is_administrator+", "client_requirement": "client_is_administrator+",
"action": "/action/networklayout/vlans_edit", "method": "js_edit",
"method": "inline_edit", "target": "edit-vlan-form",
"text": "Edit", "text": "Edit",
"class": "btn-ghost btn-sm", "class": "btn-ghost btn-sm"
"fields": [
{
"col": "name",
"input_type": "text",
"validate": "dashname"
},
{
"col": "subnet",
"input_type": "text",
"validate": "ipv4"
},
{
"col": "subnet_mask",
"input_type": "number",
"min": 1,
"max": 30
},
{
"col": "server_identity_ips",
"input_type": "textarea_pair",
"col_label": "IP Address",
"pair_col": "server_identity_descriptions",
"pair_label": "Description (Opt)",
"pair_wide": true,
"pair_col2": "server_identity_hostnames",
"pair_label2": "Hostname (Opt)",
"gateway_col": "server_identity_gateway",
"dns_col": "server_identity_dns_server",
"ntp_col": "server_identity_ntp_server"
},
{
"col": "radius_default",
"input_type": "checkbox",
"checkbox_label": "Enabled"
},
{
"col": "mdns_reflection",
"input_type": "checkbox",
"checkbox_label": "Enabled"
},
{
"col": "dnsmasq_log_queries",
"input_type": "checkbox",
"checkbox_label": "Record"
},
{
"col": "use_blocklists",
"input_type": "checkbox_multi",
"options": "%BLOCKLIST_NAME_OPTIONS%"
}
]
}, },
{ {
"client_requirement": "client_is_administrator+", "client_requirement": "client_is_administrator+",
@ -163,6 +112,14 @@
} }
] ]
}, },
{
"type": "card",
"id": "edit-vlan-form",
"label": "Edit VLAN",
"hidden": true,
"client_requirement": "client_is_administrator+",
"items": []
},
{ {
"type": "card", "type": "card",
"id": "add-form", "id": "add-form",

View file

@ -1854,7 +1854,7 @@ def _render_table(item, tokens, inherited_req=None):
action = e(apply_tokens(ra.get('action', '#'), tokens)) action = e(apply_tokens(ra.get('action', '#'), tokens))
method = ra.get('method', 'post').lower() method = ra.get('method', 'post').lower()
if method == 'post': if method == 'post':
disable_if = ra.get('disable_i') disable_if = ra.get('disable_if')
if disable_if and row.get(disable_if.get('field')) == disable_if.get('value'): if disable_if and row.get(disable_if.get('field')) == disable_if.get('value'):
btns += f'<button type="button" class="btn {cls}" disabled>{text}</button>' btns += f'<button type="button" class="btn {cls}" disabled>{text}</button>'
continue continue
@ -2195,10 +2195,16 @@ def _render_nav_item(item, active_view, level, in_dropdown=False, inherited_req=
def _inline_js(): def _inline_js():
try: try:
with open(f'{DATA_DIR}/app.js') as f: with open(f'{DATA_DIR}/validation.js') as f:
return f.read() val_js = f.read()
except Exception: except Exception:
return '' val_js = ''
try:
with open(f'{DATA_DIR}/app.js') as f:
app_js = f.read()
except Exception:
app_js = ''
return val_js + '\n' + app_js
# Routes ============================================================ # Routes ============================================================