{ "client_requirement": "client_is_viewer+", "items": [ { "type": "header_page_title", "items": [ { "type": "h1", "text": "Port Wrangling" }, { "type": "p", "text": "DNAT rules that redirect traffic on a given port to a local host, regardless of the original destination." } ] }, { "type": "table", "datasource": "config:port_wrangling", "empty_message": "No port wrangling rules configured.", "toolbar": { "items": [ { "type": "select", "name": "vlan_filter", "value": "all", "filter_col": "vlan_name", "options": "%VLAN_FILTER_OPTIONS%" } ] }, "columns": [ { "label": "Description", "field": "description" }, { "label": "VLAN", "field": "vlan_name" }, { "label": "Protocol", "field": "protocol", "class": "col-mono col-narrow" }, { "label": "Dest Port", "field": "dest_port", "class": "col-mono col-narrow" }, { "label": "Redirect To", "field": "redirect_to", "class": "col-mono" }, { "label": "Status", "field": "enabled", "render": "badge_enabled_disabled" } ], "row_actions": [ { "client_requirement": "client_is_administrator+", "action": "/action/portwrangling/rules_edit", "method": "inline_edit", "text": "Edit", "class": "btn-ghost btn-sm", "fields": [ { "col": "description", "input_type": "text" }, { "col": "protocol", "input_type": "select", "options": "%PROTOCOL_OPTIONS%" }, { "col": "dest_port", "input_type": "number" }, { "col": "redirect_to", "input_type": "text", "validate": "VALIDATION_IPV4_FORMAT|VALIDATION_ADDRESS", "attrs": { "data-vlan-subnets": "%VLAN_SUBNET_INFO_JSON%" } }, { "col": "enabled", "input_type": "checkbox", "checkbox_label": "Enabled" } ] }, { "client_requirement": "client_is_administrator+", "action": "/action/portwrangling/rules_delete", "method": "post", "text": "Delete", "class": "btn-danger btn-sm" } ] }, { "type": "card", "id": "add-form", "label": "Add Rule", "client_requirement": "client_is_administrator+", "items": [ { "type": "form", "action": "/action/portwrangling/addrule_add", "method": "post", "items": [ { "type": "field", "label": "VLAN", "name": "vlan_name", "input_type": "select", "options": "%VLAN_NAMES_AS_OPTIONS%", "required": true }, { "type": "field", "label": "Description", "name": "description", "input_type": "text", "placeholder": "e.g. DNS wrangling" }, { "type": "field_row", "cols": 3, "items": [ { "type": "field", "label": "Protocol", "name": "protocol", "input_type": "select", "options": "%PROTOCOL_OPTIONS%" }, { "type": "field", "label": "Dest Port", "name": "dest_port", "input_type": "number", "validate": "VALIDATION_PORT", "min": 1, "max": 65535, "placeholder": "e.g. 53" }, { "type": "field", "label": "Redirect To", "name": "redirect_to", "input_type": "text", "validate": "VALIDATION_IPV4_FORMAT|VALIDATION_ADDRESS", "placeholder": "e.g. 192.168.1.1", "attrs": { "data-vlan-subnets": "%VLAN_SUBNET_INFO_JSON%", "data-vlan-select": "vlan_name" } } ] }, { "type": "button_row", "items": [ { "type": "button_primary", "action": "/action/portwrangling/addrule_add", "method": "post", "text": "Add Rule" }, { "type": "button_cancel", "text": "Cancel" } ] } ] } ] } ] }