Development
This commit is contained in:
parent
3bdba52d57
commit
3b5e9e7eaa
2 changed files with 21 additions and 58 deletions
|
|
@ -94,61 +94,10 @@
|
|||
"row_actions": [
|
||||
{
|
||||
"client_requirement": "client_is_administrator+",
|
||||
"action": "/action/networklayout/vlans_edit",
|
||||
"method": "inline_edit",
|
||||
"method": "js_edit",
|
||||
"target": "edit-vlan-form",
|
||||
"text": "Edit",
|
||||
"class": "btn-ghost btn-sm",
|
||||
"fields": [
|
||||
{
|
||||
"col": "name",
|
||||
"input_type": "text",
|
||||
"validate": "dashname"
|
||||
},
|
||||
{
|
||||
"col": "subnet",
|
||||
"input_type": "text",
|
||||
"validate": "ipv4"
|
||||
},
|
||||
{
|
||||
"col": "subnet_mask",
|
||||
"input_type": "number",
|
||||
"min": 1,
|
||||
"max": 30
|
||||
},
|
||||
{
|
||||
"col": "server_identity_ips",
|
||||
"input_type": "textarea_pair",
|
||||
"col_label": "IP Address",
|
||||
"pair_col": "server_identity_descriptions",
|
||||
"pair_label": "Description (Opt)",
|
||||
"pair_wide": true,
|
||||
"pair_col2": "server_identity_hostnames",
|
||||
"pair_label2": "Hostname (Opt)",
|
||||
"gateway_col": "server_identity_gateway",
|
||||
"dns_col": "server_identity_dns_server",
|
||||
"ntp_col": "server_identity_ntp_server"
|
||||
},
|
||||
{
|
||||
"col": "radius_default",
|
||||
"input_type": "checkbox",
|
||||
"checkbox_label": "Enabled"
|
||||
},
|
||||
{
|
||||
"col": "mdns_reflection",
|
||||
"input_type": "checkbox",
|
||||
"checkbox_label": "Enabled"
|
||||
},
|
||||
{
|
||||
"col": "dnsmasq_log_queries",
|
||||
"input_type": "checkbox",
|
||||
"checkbox_label": "Record"
|
||||
},
|
||||
{
|
||||
"col": "use_blocklists",
|
||||
"input_type": "checkbox_multi",
|
||||
"options": "%BLOCKLIST_NAME_OPTIONS%"
|
||||
}
|
||||
]
|
||||
"class": "btn-ghost btn-sm"
|
||||
},
|
||||
{
|
||||
"client_requirement": "client_is_administrator+",
|
||||
|
|
@ -163,6 +112,14 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "card",
|
||||
"id": "edit-vlan-form",
|
||||
"label": "Edit VLAN",
|
||||
"hidden": true,
|
||||
"client_requirement": "client_is_administrator+",
|
||||
"items": []
|
||||
},
|
||||
{
|
||||
"type": "card",
|
||||
"id": "add-form",
|
||||
|
|
|
|||
|
|
@ -1854,7 +1854,7 @@ def _render_table(item, tokens, inherited_req=None):
|
|||
action = e(apply_tokens(ra.get('action', '#'), tokens))
|
||||
method = ra.get('method', 'post').lower()
|
||||
if method == 'post':
|
||||
disable_if = ra.get('disable_i')
|
||||
disable_if = ra.get('disable_if')
|
||||
if disable_if and row.get(disable_if.get('field')) == disable_if.get('value'):
|
||||
btns += f'<button type="button" class="btn {cls}" disabled>{text}</button>'
|
||||
continue
|
||||
|
|
@ -2195,10 +2195,16 @@ def _render_nav_item(item, active_view, level, in_dropdown=False, inherited_req=
|
|||
|
||||
def _inline_js():
|
||||
try:
|
||||
with open(f'{DATA_DIR}/app.js') as f:
|
||||
return f.read()
|
||||
with open(f'{DATA_DIR}/validation.js') as f:
|
||||
val_js = f.read()
|
||||
except Exception:
|
||||
return ''
|
||||
val_js = ''
|
||||
try:
|
||||
with open(f'{DATA_DIR}/app.js') as f:
|
||||
app_js = f.read()
|
||||
except Exception:
|
||||
app_js = ''
|
||||
return val_js + '\n' + app_js
|
||||
|
||||
|
||||
# Routes ============================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue