mirror of
https://github.com/iFargle/headscale-webui.git
synced 2026-03-17 13:02:30 +01:00
Adding route failover info
This commit is contained in:
@@ -32,8 +32,13 @@
|
||||
* Enable / disable routes and exit nodes
|
||||
* Add and delete machine tags
|
||||
7. Basic and OIDC Authentication
|
||||
* OIDC Authentication tested with Authelia
|
||||
* OIDC Authentication tested with Authelia and Keycloak
|
||||
8. Change your color theme! See MaterializeCSS Documentation for Colors for examples.
|
||||
9. Search your machines and users.
|
||||
* Machines have tags you can use to filter search:
|
||||
* `tag:tagname` Searches only for specific tags
|
||||
* `machine:machine-name` Searches only for specific machines
|
||||
* `user:user-name` Searches only for specific users
|
||||
|
||||
|
||||
---
|
||||
|
||||
@@ -255,6 +255,8 @@ def thread_machine_content(machine, machine_content, idx):
|
||||
if len(pulled_routes["routes"]) > 0:
|
||||
advertised_and_enabled = False
|
||||
advertised_route = False
|
||||
failover_route = False
|
||||
|
||||
# First, check if there are any routes that are both enabled and advertised
|
||||
for route in pulled_routes["routes"]:
|
||||
if route ["advertised"] and route["enabled"]:
|
||||
@@ -270,6 +272,7 @@ def thread_machine_content(machine, machine_content, idx):
|
||||
"""
|
||||
for route in pulled_routes["routes"]:
|
||||
app.logger.debug("Route: ["+str(route['machine']['name'])+"] id: "+str(route['id'])+" / prefix: "+str(route['prefix'])+" enabled?: "+str(route['enabled']))
|
||||
app.logger.debug("Route Dump: "+str(route))
|
||||
# Check if the route is enabled:
|
||||
route_enabled = "red"
|
||||
route_tooltip = 'enable'
|
||||
@@ -375,6 +378,7 @@ def thread_machine_content(machine, machine_content, idx):
|
||||
user_badge = "<span class='badge ipinfo " + user_color + " white-text hide-on-small-only' id='"+machine["id"]+"-ns-badge'>"+machine["user"]["name"]+"</span>"
|
||||
exit_node_badge = "" if not exit_node else "<span class='badge grey white-text text-lighten-4 tooltipped' data-position='left' data-tooltip='This machine has an enabled exit route.'>Exit Node</span>"
|
||||
expiration_badge = "" if not expiring_soon else "<span class='badge red white-text text-lighten-4 tooltipped' data-position='left' data-tooltip='This machine expires soon.'>Expiring!</span>"
|
||||
failover_badge = "" if not failover_route else "<span class='badge green white-text text-lighten-3 tooltipped' data-position='left' data-tooltip='This machine has HA failover routes enabled'>HA Route</span>"
|
||||
|
||||
machine_content[idx] = (str(render_template(
|
||||
'machines_card.html',
|
||||
@@ -391,6 +395,7 @@ def thread_machine_content(machine, machine_content, idx):
|
||||
exit_node_badge = Markup(exit_node_badge),
|
||||
status_badge = Markup(status_badge),
|
||||
user_badge = Markup(user_badge),
|
||||
failover_badge = Markup(failover_badge),
|
||||
last_update_time = str(last_update_time),
|
||||
last_seen_time = str(last_seen_time),
|
||||
created_time = str(created_time),
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
{{ user_badge }}
|
||||
{{ exit_node_badge }}
|
||||
{{ expiration_badge }}
|
||||
{{ failover_badge }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapsible-body">
|
||||
|
||||
Reference in New Issue
Block a user