This commit is contained in:
iFargle
2023-03-25 15:19:03 +09:00
parent 86da72e4d1
commit 5aa10e67df
2 changed files with 5 additions and 3 deletions

View File

@@ -852,8 +852,8 @@ def render_routes():
if exit_available:
# Set up the display code:
enabled = "<a href='#'><i id='"+str(machine_id)+"-exit' onclick='toggle_exit("+node_exit_route_ids[0]+","+node_exit_route_ids[1]+", \""+machine_id+"-exit\", \"True\", \"routes\")' class='material-icons green-text text-lighten-2 tooltipped' data-tooltip='Click to disable'>fiber_manual_record</i></a>"
disabled = "<a href='#'><i id='"+str(machine_id)+"-exit' onclick='toggle_exit("+node_exit_route_ids[0]+","+node_exit_route_ids[1]+", \""+machine_id+"-exit\", \"False\", \"routes\")' class='material-icons red-text text-lighten-2 tooltipped' data-tooltip='Click to enable' >fiber_manual_record</i></a>"
enabled = "<a href='#'><i id='"+str(machine_id)+"-exit' onclick='toggle_exit("+node_exit_route_ids[0]+", "+node_exit_route_ids[1]+", \'"+machine_id+"-exit\', \'True\', \'routes\')' class='material-icons green-text text-lighten-2 tooltipped' data-tooltip='Click to disable'>fiber_manual_record</i></a>"
disabled = "<a href='#'><i id='"+str(machine_id)+"-exit' onclick='toggle_exit("+node_exit_route_ids[0]+", "+node_exit_route_ids[1]+", \'"+machine_id+"-exit\', \'False\', \'routes\')' class='material-icons red-text text-lighten-2 tooltipped' data-tooltip='Click to enable' >fiber_manual_record</i></a>"
# Set the displays:
enabled_display = enabled if exit_enabled else disabled

View File

@@ -790,7 +790,9 @@ function toggle_exit(route1, route2, exit_id, current_state, page) {
url: "api/update_route",
data: JSON.stringify(data2),
contentType: "application/json",
success: function(response) {
success: function(response) {@inlophe Maybe best to make your own thread. This seems like a different issue.
My first question is: are you using Podman or Docker?
Can you paste your docker-compose.yml? new thread
// Response is a JSON object containing the Headscale API response of /v1/api/machines/<id>/route
if (element.className == disabledClass) {
element.className = enabledClass