From 3b5e9e7eaaba27f212462f8232c8c6265d09ea46 Mon Sep 17 00:00:00 2001 From: Matthew Grotke Date: Thu, 28 May 2026 09:28:26 -0400 Subject: [PATCH] Development --- .../app/pages/networklayout/content.json | 65 ++++--------------- docker/routlin-dash/app/view_page.py | 14 ++-- 2 files changed, 21 insertions(+), 58 deletions(-) diff --git a/docker/routlin-dash/app/pages/networklayout/content.json b/docker/routlin-dash/app/pages/networklayout/content.json index 17b8963..9e2fd18 100644 --- a/docker/routlin-dash/app/pages/networklayout/content.json +++ b/docker/routlin-dash/app/pages/networklayout/content.json @@ -94,61 +94,10 @@ "row_actions": [ { "client_requirement": "client_is_administrator+", - "action": "/action/networklayout/vlans_edit", - "method": "inline_edit", + "method": "js_edit", + "target": "edit-vlan-form", "text": "Edit", - "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%" - } - ] + "class": "btn-ghost btn-sm" }, { "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", "id": "add-form", diff --git a/docker/routlin-dash/app/view_page.py b/docker/routlin-dash/app/view_page.py index e22068b..77da58d 100644 --- a/docker/routlin-dash/app/view_page.py +++ b/docker/routlin-dash/app/view_page.py @@ -1854,7 +1854,7 @@ def _render_table(item, tokens, inherited_req=None): action = e(apply_tokens(ra.get('action', '#'), tokens)) method = ra.get('method', 'post').lower() 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'): btns += f'' continue @@ -2195,10 +2195,16 @@ def _render_nav_item(item, active_view, level, in_dropdown=False, inherited_req= def _inline_js(): try: - with open(f'{DATA_DIR}/app.js') as f: - return f.read() + with open(f'{DATA_DIR}/validation.js') as f: + val_js = f.read() 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 ============================================================