Development
This commit is contained in:
parent
c5b02b1289
commit
6f23a57220
7 changed files with 505 additions and 3 deletions
206
docker/routlin-dash/app/pages/dhcpreservations/content.json
Normal file
206
docker/routlin-dash/app/pages/dhcpreservations/content.json
Normal file
|
|
@ -0,0 +1,206 @@
|
|||
{
|
||||
"client_requirement": "client_is_viewer+",
|
||||
"items": [
|
||||
{
|
||||
"type": "header_page_title",
|
||||
"items": [
|
||||
{
|
||||
"type": "h1",
|
||||
"text": "DHCP Reservations"
|
||||
},
|
||||
{
|
||||
"type": "p",
|
||||
"text": "IP reservations and VLAN authorizations."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "table",
|
||||
"datasource": "config:dhcp_reservations",
|
||||
"empty_message": "No DHCP reservations configured.",
|
||||
"toolbar": {
|
||||
"items": [
|
||||
{
|
||||
"type": "select",
|
||||
"name": "vlan_filter",
|
||||
"value": "all",
|
||||
"options": "%VLAN_FILTER_OPTIONS%",
|
||||
"filter_col": "vlan_name"
|
||||
}
|
||||
]
|
||||
},
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"row_actions": [
|
||||
{
|
||||
"client_requirement": "client_is_administrator+",
|
||||
"action": "/action/dhcpreservations/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/dhcpreservations/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/dhcpreservations/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/dhcpreservations/addreservation_add",
|
||||
"method": "post",
|
||||
"text": "Add"
|
||||
},
|
||||
{
|
||||
"type": "button_cancel",
|
||||
"text": "Cancel"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue