diff --git a/docker/routlin-dash/app/factory.py b/docker/routlin-dash/app/factory.py
index 82e17eb..2db0971 100644
--- a/docker/routlin-dash/app/factory.py
+++ b/docker/routlin-dash/app/factory.py
@@ -647,7 +647,9 @@ def build_field(item, tokens):
return f''
if input_type == 'checkbox':
- checked = 'checked' if value.lower() in ('true', '1', 'yes') else ''
+ checked = 'checked' if value.lower() in ('true', '1', 'yes') else ''
+ disabled_raw = apply_tokens(str(item.get('disabled', '')), tokens)
+ disabled = ' disabled' if disabled_raw and disabled_raw not in ('false', '0') else ''
cb_label = item.get('checkbox_label')
if cb_label:
label_html = f'' if label else ''
@@ -655,14 +657,14 @@ def build_field(item, tokens):
'
'
f'{label_html}'
'{hint_html}
'
)
return (
''
'{hint_html}
'
)
@@ -693,7 +695,7 @@ def build_field(item, tokens):
options = []
current = apply_tokens(item.get('value', ''), tokens)
opts_html = ''.join(
- f''
+ f''
for o in options
)
validate_raw = item.get('validate', '')
diff --git a/docker/routlin-dash/app/pages/networklayout/content.json b/docker/routlin-dash/app/pages/networklayout/content.json
index 1a0531e..7ebbd57 100644
--- a/docker/routlin-dash/app/pages/networklayout/content.json
+++ b/docker/routlin-dash/app/pages/networklayout/content.json
@@ -353,6 +353,7 @@
"label": "%RESTRICTED_VLAN_LABEL%",
"name": "restricted_vlan",
"input_type": "checkbox",
+ "disabled": "%RESTRICTED_VLAN_DISABLED%",
"hint": "Block devices on this VLAN from communicating with the Internet. Block all LAN traffic as well (except where Inter-VLAN-Exception rules allow)."
},
{
diff --git a/docker/routlin-dash/app/pages/networklayout/view.py b/docker/routlin-dash/app/pages/networklayout/view.py
index 5642872..021e0f8 100644
--- a/docker/routlin-dash/app/pages/networklayout/view.py
+++ b/docker/routlin-dash/app/pages/networklayout/view.py
@@ -14,6 +14,7 @@ def collect_tokens(cfg):
tokens['EXISTING_VLAN_NAMES_JSON'] = json.dumps([v.get('name') for v in vlans])
tokens['RADIUS_DEFAULT_VLAN'] = f'"{dv["name"]}" (VLAN {dv["vlan_id"]})' if dv else 'none set'
tokens['RESTRICTED_VLAN_LABEL'] = 'Restricted VLAN' if PRO_LICENSE else 'Restricted VLAN (PRO FEATURE)'
+ tokens['RESTRICTED_VLAN_DISABLED'] = '' if PRO_LICENSE else 'true'
tokens['BLOCKLIST_NAME_OPTIONS'] = json.dumps([
{'value': bl.get('name', ''), 'label': bl.get('description', bl.get('name', ''))}
for bl in cfg.get('dns_blocking', {}).get('blocklists', [])
diff --git a/docker/routlin-dash/app/pages/radius/view.py b/docker/routlin-dash/app/pages/radius/view.py
index a7357af..9c23a92 100644
--- a/docker/routlin-dash/app/pages/radius/view.py
+++ b/docker/routlin-dash/app/pages/radius/view.py
@@ -69,11 +69,12 @@ def collect_tokens(cfg):
fr_gen = fr.get('general', {})
tokens['RADIUS_MAC_FORMAT'] = fr_opts.get('mac_format', 'aabbccddeeff')
tokens['RADIUS_AUTH_MODE'] = fr_opts.get('auth_mode', 'mab')
- pro_suffix = '' if PRO_LICENSE else ' (PRO REQUIRED)'
+ pro_suffix = '' if PRO_LICENSE else ' (PRO REQUIRED)'
+ pro_disabled = not PRO_LICENSE
tokens['RADIUS_AUTH_MODE_OPTIONS'] = json.dumps([
- {'value': 'mab', 'label': 'MAC Authentication Bypass (MAB)'},
- {'value': 'eap_password', 'label': f'802.1X - Client Username/Password{pro_suffix}'},
- {'value': 'eap_credential', 'label': f'802.1X - Client Certificate{pro_suffix}'},
+ {'value': 'mab', 'label': 'MAC Authentication Bypass (MAB)'},
+ {'value': 'eap_password', 'label': f'802.1X - Client Username/Password{pro_suffix}', 'disabled': pro_disabled},
+ {'value': 'eap_credential', 'label': f'802.1X - Client Certificate{pro_suffix}', 'disabled': pro_disabled},
])
tokens['RADIUS_APPLY_TO'] = fr_opts.get('apply_to', 'all')
tokens['RADIUS_AP_IPS'] = json.dumps(fr_opts.get('ap_ips', []))