From 09beba8889da635143b043c1ae58b763cdbb1aa8 Mon Sep 17 00:00:00 2001 From: Matthew Grotke Date: Fri, 5 Jun 2026 13:11:26 -0400 Subject: [PATCH] Development --- .../app/pages/dhcpreservations/content.json | 5 +++-- docker/routlin-dash/app/pages/radius/content.json | 5 +++++ docker/routlin-dash/app/pages/radius/view.py | 12 +++++++++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/docker/routlin-dash/app/pages/dhcpreservations/content.json b/docker/routlin-dash/app/pages/dhcpreservations/content.json index b89e357..b286c72 100644 --- a/docker/routlin-dash/app/pages/dhcpreservations/content.json +++ b/docker/routlin-dash/app/pages/dhcpreservations/content.json @@ -84,7 +84,7 @@ { "type": "card", "id": "add-form", - "label": "Add Reservation/Authorization", + "label": "Add Reservation/Authorization Rule", "client_requirement": "client_is_administrator+", "items": [ { @@ -158,7 +158,8 @@ "type": "field", "label": "Enabled", "name": "enabled", - "input_type": "checkbox" + "input_type": "checkbox", + "hint": "Enable or disable this reservation/authorization rule." }, { "type": "button_row", diff --git a/docker/routlin-dash/app/pages/radius/content.json b/docker/routlin-dash/app/pages/radius/content.json index c6bd43e..73ca8e3 100644 --- a/docker/routlin-dash/app/pages/radius/content.json +++ b/docker/routlin-dash/app/pages/radius/content.json @@ -14,6 +14,11 @@ } ] }, + { + "type": "info_bar", + "variant": "info", + "text": "%RADIUS_CLIENT_STATUS_TEXT%" + }, { "type": "card", "label": "Shared Secret", diff --git a/docker/routlin-dash/app/pages/radius/view.py b/docker/routlin-dash/app/pages/radius/view.py index 621fe3d..86390e3 100644 --- a/docker/routlin-dash/app/pages/radius/view.py +++ b/docker/routlin-dash/app/pages/radius/view.py @@ -68,10 +68,16 @@ def collect_tokens(cfg): tokens['RADIUS_APPLY_TO'] = fr_opts.get('apply_to', 'all') tokens['RADIUS_AP_IPS'] = json.dumps(fr_opts.get('ap_ips', [])) + all_radius_clients = [r for r in cfg.get('dhcp_reservations', []) if r.get('radius_client') is True] + n = len(all_radius_clients) + if n > 0: + tokens['RADIUS_CLIENT_STATUS_TEXT'] = f"RADIUS will be disabled if there are no RADIUS Clients specified on the DHCP Reservations page. There are currently {n} RADIUS Client{'s' if n != 1 else ''}. RADIUS is enabled." + else: + tokens['RADIUS_CLIENT_STATUS_TEXT'] = "RADIUS will be disabled if there are no RADIUS Clients specified on the DHCP Reservations page. There are currently 0 RADIUS Clients. RADIUS is disabled." + radius_client_reservations = [ - r for r in cfg.get('dhcp_reservations', []) - if r.get('radius_client') is True - and r.get('ip') and r.get('ip') not in ('', 'dynamic') + r for r in all_radius_clients + if r.get('ip') and r.get('ip') not in ('', 'dynamic') ] tokens['RADIUS_AP_IPS_OPTIONS'] = json.dumps([ {'value': r['ip'], 'label': f"{r.get('description', r['ip'])} ({r['ip']})"}