diff --git a/renderer.py b/renderer.py
index 45ecc5d..4308dba 100644
--- a/renderer.py
+++ b/renderer.py
@@ -449,7 +449,7 @@ def thread_machine_content(machine, machine_content, idx, all_routes, failover_p
status_badge = "fiber_manual_record"
user_badge = ""+machine["user"]["name"]+""
exit_node_badge = "" if not exit_route_enabled else "Exit"
- ha_route_badge = "" if not ha_enabled else "HA"
+ ha_route_badge = "" if not ha_enabled else "HA"
expiration_badge = "" if not expiring_soon else "Expiring!"
machine_content[idx] = (str(render_template(
@@ -685,9 +685,9 @@ def render_routes():
failover_content = ""
exit_content = ""
- route_title='Routes
'
- failover_title='Failover Routes
'
- exit_title='Exit Routes
'
+ route_title='Routes'
+ failover_title='Failover Routes'
+ exit_title='Exit Routes'
markup_pre = """
@@ -822,19 +822,27 @@ def render_routes():
is_primary = all_routes["routes"][idx]["isPrimary"]
is_enabled = all_routes["routes"][idx]["enabled"]
+ # route_id_list contains all routes associated with that prefix.
+ # To toggle which is primary, we need to transfer all routes
+ # and which route ID to make primary. We then toggle each route
+ # in order, with the primary route being toggled last
+ # Step 1: Create an array of all route_id's that JavaScript likes:
+ json_route_ids = {}
+ for route in route_id_list:
+ json_route_ids.append(int(route))
+
app.logger.debug("[%s] Machine: [%s] %s : %s / %s", str(route_id), str(machine_id), str(machine), str(is_enabled), str(is_primary))
app.logger.debug(str(all_routes["routes"][idx]))
# Set up the display code:
- enabled = "fiber_manual_record"
- disabled = "fiber_manual_record"
-
- # Set the displays:
- enabled_display = disabled
- primary_display = disabled
-
- if is_enabled: enabled_display = enabled
- if is_primary: primary_display = enabled
+ enabled_display_enabled = "fiber_manual_record"
+ enabled_display_disabled = "fiber_manual_record"
+ primary_display_enabled = "fiber_manual_record"
+ primary_display_disabled = "fiber_manual_record"
+
+ # Set displays:
+ enabled_display = enabled_display_enabled if is_enabled else enabled_display_disabled
+ primary_display = primary_display_enabled if is_primary else primary_display_disabled
# Build a simple table for all non-exit routes:
failover_content += """