linuxrouter/docker/routlin-dash/app/pages/clientcredentials/content.json
2026-06-08 07:26:45 -04:00

264 lines
7.7 KiB
JSON

{
"client_requirement": "client_is_viewer+",
"items": [
{
"type": "header_page_title",
"items": [
{
"type": "h1",
"text": "Client Credentials"
},
{
"type": "p",
"text": "Username and password credentials for 802.1X supplicants and captive portal authentication."
}
]
},
{
"type": "raw_html",
"html": "%PRO_NOTE%"
},
{
"type": "table",
"datasource": "sqlite:client_credentials",
"empty_message": "No credentials configured.",
"toolbar": {
"client_requirement": "client_is_viewer+",
"items": [
{
"type": "select",
"name": "type_filter",
"value": "all",
"filter_col": "user_type_label",
"options": "%TYPE_FILTER_OPTIONS%"
},
{
"type": "select",
"name": "vlan_filter",
"value": "all",
"filter_col": "vlan",
"options": "%CRED_VLAN_FILTER_OPTIONS%"
}
]
},
"columns": [
{
"label": "Username",
"field": "username",
"class": "col-mono"
},
{
"label": "Description",
"field": "description"
},
{
"label": "Type",
"field": "user_type_label",
"class": "col-narrow"
},
{
"label": "VLAN",
"field": "vlan",
"class": "col-narrow col-mono"
},
{
"label": "Session",
"field": "expires_label",
"class": "col-narrow"
},
{
"label": "Expiration",
"field": "expiration_label",
"class": "col-narrow"
},
{
"label": "Active",
"field": "active",
"class": "col-narrow",
"render": "badge_yes_no"
}
],
"row_actions": [
{
"client_requirement": "client_is_administrator+",
"method": "js_edit",
"target": "add-form",
"text": "Edit",
"class": "btn-ghost btn-sm"
},
{
"client_requirement": "client_is_administrator+",
"action": "/action/clientcredentials/delete",
"method": "post",
"text": "Delete",
"class": "btn-danger btn-sm"
}
]
},
{
"type": "card",
"id": "add-form",
"label": "Add User Account",
"client_requirement": "client_is_administrator+",
"items": [
{
"type": "form",
"action": "/action/clientcredentials/addedit",
"method": "post",
"items": [
{
"type": "hidden",
"name": "row_index",
"value": ""
},
{
"type": "field",
"label": "Account Enabled",
"name": "enabled",
"input_type": "checkbox",
"value": "true"
},
{
"type": "raw_html",
"html": "<script id=\"captive-vlan-data\" type=\"application/json\">%CAPTIVE_VLAN_OPTIONS%</script><script id=\"page-flags\" type=\"application/json\">{\"pro\": %PRO_LICENSE_JS%, \"radius_session_seconds\": %RADIUS_DEFAULT_SESSION_SECONDS_JS%, \"radius_expiration_seconds\": %RADIUS_DEFAULT_EXPIRATION_SECONDS_JS%}</script>"
},
{
"type": "field",
"label": "User Type",
"name": "user_type",
"input_type": "select",
"options": [
{"value": "", "label": "-- Select User Type --"},
{"value": "0", "label": "Captive Portal"},
{"value": "1", "label": "802.1X Supplicant"}
]
},
{
"type": "raw_html",
"html": "<div id=\"vlan-row\">"
},
{
"type": "field",
"label": "VLAN",
"name": "vlan",
"input_type": "select",
"options": "%VLAN_OPTIONS%",
"hint": "VLAN to assign after 802.1X authentication."
},
{
"type": "raw_html",
"html": "</div>"
},
{
"type": "raw_html",
"html": "<div id=\"captive-portal-mode-note\" style=\"display:none\"></div>"
},
{
"type": "hr"
},
{
"type": "field_row",
"cols": 2,
"items": [
{
"type": "field",
"label": "Username",
"name": "username",
"input_type": "text",
"validate": "VALIDATION_DASH_NAME",
"hint": "Lowercase letters, digits, and hyphens."
},
{
"type": "field",
"label": "Password",
"name": "password",
"input_type": "password",
"hint": "Leave blank to auto-generate password."
}
]
},
{
"type": "raw_html",
"html": "<div class=\"edit-mode-note info-bar info-bar-inline info-bar-info\" style=\"display:none\">Updating password will renew account if expired.</div>"
},
{
"type": "field",
"label": "Description",
"name": "description",
"input_type": "text",
"hint": "Optional label."
},
{
"type": "hr"
},
{
"type": "field_row",
"cols": 2,
"items": [
{
"type": "field",
"label": "Session Duration",
"name": "session_duration_value",
"input_type": "number",
"min": 0,
"value": "0",
"hint": "0 = no session limit"
},
{
"type": "field",
"label": "Unit",
"name": "session_duration_unit",
"input_type": "select",
"options": [
{"value": "hours", "label": "Hours"},
{"value": "days", "label": "Days"}
]
}
]
},
{
"type": "field_row",
"cols": 2,
"items": [
{
"type": "field",
"label": "Expiration Duration",
"name": "expiration_duration_value",
"input_type": "number",
"min": 0,
"value": "0",
"hint": "How long before account permanently expires. 0 = never expires."
},
{
"type": "field",
"label": "Unit",
"name": "expiration_duration_unit",
"input_type": "select",
"options": [
{"value": "hours", "label": "Hours"},
{"value": "days", "label": "Days"}
]
}
]
},
{
"type": "button_row",
"items": [
{
"type": "button_primary",
"text": "Add Credential",
"class": "add-credential-btn",
"disabled": "%ADD_CREDENTIAL_DISABLED%"
},
{
"type": "button_cancel",
"text": "Cancel"
}
]
}
]
}
]
}
]
}