235 lines
No EOL
6.3 KiB
JSON
235 lines
No EOL
6.3 KiB
JSON
{
|
|
"client_requirement": "client_is_viewer+",
|
|
"items": [
|
|
{
|
|
"type": "header_page_title",
|
|
"items": [
|
|
{
|
|
"type": "h1",
|
|
"text": "DHCP"
|
|
},
|
|
{
|
|
"type": "p",
|
|
"text": "Active leases, IP reservations, and VLAN authorizations."
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "table",
|
|
"datasource": "live:dhcp_leases",
|
|
"empty_message": "No active DHCP leases found.",
|
|
"columns": [
|
|
{
|
|
"label": "Hostname",
|
|
"field": "hostname"
|
|
},
|
|
{
|
|
"label": "IP Address",
|
|
"field": "ip_address",
|
|
"class": "col-mono"
|
|
},
|
|
{
|
|
"label": "MAC Address",
|
|
"field": "mac_address",
|
|
"class": "col-mono"
|
|
},
|
|
{
|
|
"label": "VLAN",
|
|
"field": "vlan_name"
|
|
},
|
|
{
|
|
"label": "Expires",
|
|
"field": "expires"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "table",
|
|
"datasource": "config:dhcp_reservations",
|
|
"empty_message": "No DHCP reservations configured.",
|
|
"columns": [
|
|
{
|
|
"label": "Description",
|
|
"field": "description"
|
|
},
|
|
{
|
|
"label": "Hostname",
|
|
"field": "hostname",
|
|
"class": "col-mono"
|
|
},
|
|
{
|
|
"label": "MAC",
|
|
"field": "mac",
|
|
"class": "col-mono"
|
|
},
|
|
{
|
|
"label": "IP",
|
|
"field": "ip",
|
|
"class": "col-mono"
|
|
},
|
|
{
|
|
"label": "VLAN",
|
|
"field": "vlan_name"
|
|
},
|
|
{
|
|
"label": "RADIUS",
|
|
"field": "radius_client",
|
|
"render": "badge_yes_no"
|
|
},
|
|
{
|
|
"label": "Status",
|
|
"field": "enabled",
|
|
"render": "badge_enabled_disabled"
|
|
}
|
|
],
|
|
"toolbar": {
|
|
"items": [
|
|
{
|
|
"type": "select",
|
|
"name": "vlan_filter",
|
|
"value": "all",
|
|
"options": "%VLAN_FILTER_OPTIONS%",
|
|
"filter_col": "vlan_name"
|
|
}
|
|
]
|
|
},
|
|
"row_actions": [
|
|
{
|
|
"client_requirement": "client_is_administrator+",
|
|
"action": "/action/dhcp/reservations_edit",
|
|
"method": "inline_edit",
|
|
"text": "Edit",
|
|
"class": "btn-ghost btn-sm",
|
|
"fields": [
|
|
{
|
|
"col": "description",
|
|
"input_type": "text"
|
|
},
|
|
{
|
|
"col": "hostname",
|
|
"input_type": "text",
|
|
"validate": "VALIDATION_NETWORK_NAME"
|
|
},
|
|
{
|
|
"col": "mac",
|
|
"input_type": "text",
|
|
"validate": "VALIDATION_MAC"
|
|
},
|
|
{
|
|
"col": "ip",
|
|
"input_type": "text",
|
|
"validate": "VALIDATION_IPV4_FORMAT|VALIDATION_ADDRESS",
|
|
"attrs": {
|
|
"data-vlan-subnets": "%VLAN_SUBNET_INFO_JSON%"
|
|
}
|
|
},
|
|
{
|
|
"col": "radius_client",
|
|
"input_type": "checkbox",
|
|
"checkbox_label": "Enabled"
|
|
},
|
|
{
|
|
"col": "enabled",
|
|
"input_type": "checkbox",
|
|
"checkbox_label": "Enabled"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"client_requirement": "client_is_administrator+",
|
|
"action": "/action/dhcp/reservations_delete",
|
|
"method": "post",
|
|
"text": "Delete",
|
|
"class": "btn-danger btn-sm"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "card",
|
|
"id": "add-form",
|
|
"label": "Add Reservation/Authorization",
|
|
"client_requirement": "client_is_administrator+",
|
|
"items": [
|
|
{
|
|
"type": "form",
|
|
"action": "/action/dhcp/addreservation_add",
|
|
"method": "post",
|
|
"items": [
|
|
{
|
|
"type": "field",
|
|
"label": "VLAN",
|
|
"name": "vlan_name",
|
|
"input_type": "select",
|
|
"options": "%VLAN_NAMES_AS_OPTIONS%",
|
|
"hint": "VLAN this reservation belongs to."
|
|
},
|
|
{
|
|
"type": "field",
|
|
"label": "Description",
|
|
"name": "description",
|
|
"input_type": "text",
|
|
"placeholder": "e.g. NAS"
|
|
},
|
|
{
|
|
"type": "field",
|
|
"label": "Hostname",
|
|
"name": "hostname",
|
|
"input_type": "text",
|
|
"validate": "VALIDATION_NETWORK_NAME",
|
|
"optional": true,
|
|
"placeholder": "e.g. nas",
|
|
"attrs": {
|
|
"data-res-hosts-by-vlan": "%RESERVATION_HOSTNAMES_BY_VLAN_JSON%"
|
|
}
|
|
},
|
|
{
|
|
"type": "field",
|
|
"label": "MAC Address",
|
|
"name": "mac",
|
|
"input_type": "text",
|
|
"validate": "VALIDATION_MAC",
|
|
"placeholder": "e.g. aa:bb:cc:dd:ee:ff"
|
|
},
|
|
{
|
|
"type": "field",
|
|
"label": "IP Address",
|
|
"name": "ip",
|
|
"input_type": "text",
|
|
"validate": "VALIDATION_IPV4_FORMAT|VALIDATION_ADDRESS",
|
|
"optional": true,
|
|
"placeholder": "e.g. 192.168.10.50",
|
|
"hint": "Leave blank to authorize device on this VLAN dynamically.",
|
|
"attrs": {
|
|
"data-res-ips-by-vlan": "%RESERVATION_IPS_BY_VLAN_JSON%",
|
|
"data-vlan-subnets": "%VLAN_SUBNET_INFO_JSON%",
|
|
"data-vlan-select": "vlan_name"
|
|
}
|
|
},
|
|
{
|
|
"type": "field",
|
|
"label": "RADIUS Client",
|
|
"name": "radius_client",
|
|
"input_type": "checkbox",
|
|
"hint": "This device acts as a RADIUS authenticator, verifying credentials of other devices on the network."
|
|
},
|
|
{
|
|
"type": "button_row",
|
|
"items": [
|
|
{
|
|
"type": "button_primary",
|
|
"action": "/action/dhcp/addreservation_add",
|
|
"method": "post",
|
|
"text": "Add"
|
|
},
|
|
{
|
|
"type": "button_cancel",
|
|
"text": "Cancel"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
} |