UI improvements and input validations

This commit is contained in:
Matthew Grotke 2026-05-20 04:06:50 -04:00
parent b8c4914a52
commit 270856b391
22 changed files with 1548 additions and 302 deletions

View file

@ -275,7 +275,7 @@
"cells": [
{
"type": "grid_label",
"text": "Upstream Servers"
"text": "DNS Providers"
},
{
"type": "grid_value",
@ -440,6 +440,10 @@
"text": "Add Provider",
"action": "/action/add_ddns_provider",
"method": "post"
},
{
"type": "button_cancel",
"text": "Cancel"
}
]
}
@ -491,41 +495,41 @@
{
"type": "card",
"label": "Network Interfaces",
"client_requirement": "client_is_viewer+",
"client_requirement": "client_is_administrator+",
"items": [
{
"type": "table",
"datasource": "config:interfaces",
"empty_message": "No interfaces configured.",
"columns": [
"type": "form",
"action": "/action/apply_interface",
"method": "post",
"items": [
{
"label": "Type",
"field": "iface_type",
"class": "col-mono"
"type": "field",
"label": "WAN Interface",
"name": "wan_interface",
"input_type": "interface_picker",
"value": "%GENERAL_WAN_INTERFACE%",
"data": "%NETWORK_INTERFACE_DATA_JSON%"
},
{
"label": "Interface",
"field": "interface",
"class": "col-mono"
"type": "field",
"label": "LAN Interface",
"name": "lan_interface",
"input_type": "interface_picker",
"value": "%GENERAL_LAN_INTERFACE%",
"data": "%NETWORK_INTERFACE_DATA_JSON%"
},
{
"label": "Status",
"field": "status",
"render": "interface_status"
}
],
"row_actions": [
{
"text": "Edit",
"class": "btn-ghost btn-sm",
"action": "/action/apply_interface",
"method": "inline_edit",
"client_requirement": "client_is_administrator+",
"fields": [
"type": "button_row",
"items": [
{
"col": "interface",
"input_type": "select",
"options": "%NETWORK_INTERFACE_STATUS_OPTIONS%"
"type": "button_primary",
"text": "Save",
"action": "/action/apply_interface",
"method": "post"
},
{
"type": "button_cancel",
"text": "Cancel"
}
]
}
@ -535,7 +539,87 @@
},
{
"type": "card",
"label": "General",
"id": "iface-config-card",
"label": "Interface Configuration",
"hidden": true,
"client_requirement": "client_is_administrator+",
"items": [
{
"type": "form",
"action": "/action/apply_iface_config",
"method": "post",
"items": [
{
"type": "hidden",
"name": "original_mtu",
"value": ""
},
{
"type": "hidden",
"name": "original_mac",
"value": ""
},
{
"type": "field_row",
"cols": 3,
"items": [
{
"type": "field",
"label": "Interface",
"name": "iface",
"input_type": "text",
"readonly": true,
"value": ""
},
{
"type": "field",
"label": "MTU",
"name": "mtu",
"input_type": "select",
"value": "",
"options": [
{"value": "576", "label": "576"},
{"value": "1280", "label": "1280"},
{"value": "1492", "label": "1492"},
{"value": "1500", "label": "1500"},
{"value": "4096", "label": "4096"},
{"value": "9000", "label": "9000"}
]
},
{
"type": "field",
"label": "MAC Address",
"name": "mac",
"input_type": "text",
"validate": "mac",
"value": ""
}
]
},
{
"type": "button_row",
"items": [
{
"type": "button_primary",
"text": "Apply",
"action": "/action/apply_iface_config",
"method": "post"
},
{
"type": "button_secondary",
"text": "Cancel",
"action": "#",
"class": "iface-config-cancel"
}
]
}
]
}
]
},
{
"type": "card",
"label": "Logging",
"items": [
{
"type": "form",
@ -630,7 +714,7 @@
"name": "strict_order",
"input_type": "checkbox",
"value": "%DNS_STRICT_ORDER%",
"hint": "Query upstream servers in list order rather than in parallel."
"hint": "Query DNS providers in list order rather than in parallel."
},
{
"type": "field",
@ -643,11 +727,12 @@
},
{
"type": "editable_list",
"label": "Upstream Servers",
"label": "DNS Providers",
"name": "upstream_servers",
"items": "%DNS_UPSTREAM_SERVERS_JSON%",
"item_placeholder": "e.g. 1.1.1.1",
"add_label": "Add Server",
"add_label": "Add Provider",
"validate": "ip",
"hint": "DNS resolvers queried for external hostnames. Supports IPv4 and IPv6."
},
{
@ -660,9 +745,8 @@
"method": "post"
},
{
"type": "button_secondary",
"text": "Cancel",
"action": "/view/view_upstream_dns"
"type": "button_cancel",
"text": "Cancel"
}
]
}
@ -780,6 +864,10 @@
"text": "Add Banned IP",
"action": "/action/add_banned_ip",
"method": "post"
},
{
"type": "button_cancel",
"text": "Cancel"
}
]
}
@ -845,11 +933,13 @@
},
{
"col": "host",
"input_type": "text"
"input_type": "text",
"validate": "domainname"
},
{
"col": "ip",
"input_type": "text"
"input_type": "text",
"validate": "ip"
},
{
"col": "enabled",
@ -889,6 +979,7 @@
"label": "Hostname",
"name": "host",
"input_type": "text",
"validate": "domainname",
"placeholder": "e.g. server.home.local"
},
{
@ -896,6 +987,7 @@
"label": "Resolves To",
"name": "ip",
"input_type": "text",
"validate": "ip",
"placeholder": "e.g. 192.168.1.100"
},
{
@ -906,6 +998,10 @@
"text": "Add Host Override",
"action": "/action/add_host_override",
"method": "post"
},
{
"type": "button_cancel",
"text": "Cancel"
}
]
}
@ -977,7 +1073,8 @@
"fields": [
{
"col": "name",
"input_type": "text"
"input_type": "text",
"validate": "dashname"
},
{
"col": "description",
@ -990,7 +1087,8 @@
},
{
"col": "url",
"input_type": "text"
"input_type": "text",
"validate": "url"
}
]
},
@ -1019,6 +1117,7 @@
"label": "Name",
"name": "name",
"input_type": "text",
"validate": "dashname",
"placeholder": "e.g. steven-black"
},
{
@ -1040,6 +1139,7 @@
"label": "Source URL",
"name": "url",
"input_type": "text",
"validate": "url",
"placeholder": "https://..."
},
{
@ -1050,6 +1150,10 @@
"text": "Add Blocklist",
"action": "/action/add_blocklist",
"method": "post"
},
{
"type": "button_cancel",
"text": "Cancel"
}
]
}
@ -1089,40 +1193,44 @@
{
"label": "VLAN ID",
"field": "vlan_id",
"class": "col-mono"
"class": "col-mono col-narrow"
},
{
"label": "Name",
"field": "name"
"field": "name",
"class": "col-narrow"
},
{
"label": "Interface",
"field": "interface",
"class": "col-mono"
"class": "col-mono col-narrow"
},
{
"label": "Subnet",
"field": "subnet",
"class": "col-mono"
"class": "col-mono col-narrow"
},
{
"label": "Mask",
"field": "subnet_mask",
"class": "col-mono"
"class": "col-mono col-narrow"
},
{
"label": "Blocklists",
"field": "use_blocklists",
"class": "col-expand",
"render": "tag_list"
},
{
"label": "RADIUS Default",
"field": "radius_default",
"class": "col-narrow",
"render": "badge_enabled_disabled"
},
{
"label": "mDNS Reflection",
"field": "mdns_reflection",
"class": "col-narrow",
"render": "badge_enabled_disabled"
}
],
@ -1136,7 +1244,8 @@
"fields": [
{
"col": "name",
"input_type": "text"
"input_type": "text",
"validate": "dashname"
},
{
"col": "subnet",
@ -1196,6 +1305,7 @@
"label": "VLAN Name",
"name": "name",
"input_type": "text",
"validate": "dashname",
"hint": "Lowercase letters, digits, hyphens. E.g. iot"
},
{
@ -1277,6 +1387,10 @@
"method": "post",
"class": "add-vlan-btn",
"disabled": true
},
{
"type": "button_cancel",
"text": "Cancel"
}
]
}
@ -1412,6 +1526,7 @@
"label": "Source",
"name": "src_ip_or_subnet",
"input_type": "text",
"validate": "ipv4cidr",
"placeholder": "e.g. 192.168.20.0/24"
},
{
@ -1419,6 +1534,7 @@
"label": "Destination",
"name": "dst_ip_or_subnet",
"input_type": "text",
"validate": "ipv4",
"placeholder": "e.g. 192.168.10.100"
},
{
@ -1426,6 +1542,7 @@
"label": "Dest Port",
"name": "dst_port",
"input_type": "text",
"validate": "port",
"placeholder": "e.g. 8009"
},
{
@ -1436,6 +1553,10 @@
"text": "Add Exception",
"action": "/action/add_inter_vlan",
"method": "post"
},
{
"type": "button_cancel",
"text": "Cancel"
}
]
}
@ -1571,6 +1692,7 @@
"label": "Ext Port",
"name": "dest_port",
"input_type": "text",
"validate": "port",
"placeholder": "e.g. 25565"
},
{
@ -1578,6 +1700,7 @@
"label": "NAT IP",
"name": "nat_ip",
"input_type": "text",
"validate": "ipv4",
"placeholder": "e.g. 192.168.1.50"
},
{
@ -1585,6 +1708,7 @@
"label": "NAT Port",
"name": "nat_port",
"input_type": "text",
"validate": "port",
"placeholder": "e.g. 25565"
},
{
@ -1595,6 +1719,10 @@
"text": "Add Rule",
"action": "/action/add_port_forward",
"method": "post"
},
{
"type": "button_cancel",
"text": "Cancel"
}
]
}
@ -1714,15 +1842,18 @@
},
{
"col": "hostname",
"input_type": "text"
"input_type": "text",
"validate": "networkname"
},
{
"col": "mac",
"input_type": "text"
"input_type": "text",
"validate": "mac"
},
{
"col": "ip",
"input_type": "text"
"input_type": "text",
"validate": "ipv4"
},
{
"col": "radius_client",
@ -1774,6 +1905,7 @@
"label": "Hostname",
"name": "hostname",
"input_type": "text",
"validate": "networkname",
"placeholder": "e.g. nas"
},
{
@ -1781,6 +1913,7 @@
"label": "MAC Address",
"name": "mac",
"input_type": "text",
"validate": "mac",
"placeholder": "e.g. aa:bb:cc:dd:ee:ff"
},
{
@ -1788,6 +1921,7 @@
"label": "IP Address",
"name": "ip",
"input_type": "text",
"validate": "ipv4",
"placeholder": "e.g. 192.168.10.50"
},
{
@ -1805,6 +1939,10 @@
"text": "Add Reservation",
"action": "/action/add_dhcp_reservation",
"method": "post"
},
{
"type": "button_cancel",
"text": "Cancel"
}
]
}
@ -1841,11 +1979,6 @@
"label": "Peer",
"field": "peer_name"
},
{
"label": "Interface",
"field": "interface",
"class": "col-mono"
},
{
"label": "Tunnel IP",
"field": "tunnel_ip",
@ -1883,7 +2016,12 @@
"field": "name"
},
{
"label": "IP",
"label": "Assigned VLAN",
"field": "vlan_display",
"class": "col-mono"
},
{
"label": "Assigned IP",
"field": "ip",
"class": "col-mono"
},
@ -1912,7 +2050,8 @@
"fields": [
{
"col": "name",
"input_type": "text"
"input_type": "text",
"validate": "dashname"
},
{
"col": "split_tunnel",
@ -1955,14 +2094,23 @@
"label": "Name",
"name": "peer_name",
"input_type": "text",
"validate": "dashname",
"placeholder": "e.g. laptop",
"hint": "Friendly name for this peer."
},
{
"type": "field",
"label": "IP Address",
"label": "Assigned VLAN",
"name": "peer_vlan",
"input_type": "select",
"options": "%VPN_VLAN_OPTIONS%"
},
{
"type": "field",
"label": "Assigned IP",
"name": "peer_ip",
"input_type": "text",
"validate": "ipv4",
"placeholder": "e.g. 192.168.40.2",
"hint": "Static IP assigned to this peer within the VPN subnet."
},
@ -1973,6 +2121,13 @@
"input_type": "checkbox",
"hint": "Route only VPN subnet traffic through the tunnel. When unchecked all traffic is routed through the VPN."
},
{
"type": "field",
"label": "Enabled",
"name": "enabled",
"input_type": "checkbox",
"checked": true
},
{
"type": "button_row",
"items": [
@ -2017,6 +2172,7 @@
"label": "Server Endpoint",
"name": "vpn_server_endpoint",
"input_type": "text",
"validate": "endpoint",
"value": "%VPN_SERVER_ENDPOINT%",
"placeholder": "e.g. vpn.example.com",
"hint": "Publicly reachable hostname or IP of this server, embedded in client config files."
@ -2026,6 +2182,7 @@
"label": "Domain",
"name": "vpn_domain",
"input_type": "text",
"validate": "dashname",
"value": "%VPN_DOMAIN%",
"placeholder": "e.g. local",
"hint": "DNS search domain pushed to VPN clients."
@ -2035,6 +2192,7 @@
"label": "DNS Override",
"name": "vpn_dns_server",
"input_type": "text",
"validate": "ipv4",
"value": "%VPN_DNS_SERVER%",
"placeholder": "Leave blank to use gateway IP (%VPN_GATEWAY%)",
"hint": "Explicit DNS server pushed to peers. Defaults to the gateway IP."