mirror of
https://github.com/iFargle/headscale-webui.git
synced 2026-01-04 11:43:41 +01:00
test
This commit is contained in:
10
renderer.py
10
renderer.py
@@ -359,7 +359,7 @@ def thread_machine_content(machine, machine_content, idx, all_routes, failover_p
|
||||
class='waves-effect waves-light btn-small """+route_enabled+""" lighten-2 tooltipped'
|
||||
data-position='top' data-tooltip='Click to """+route_tooltip+"""'
|
||||
id='"""+route['id']+"""'
|
||||
onclick="toggle_route("""+route['id']+""", '"""+str(route['enabled'])+"""')">
|
||||
onclick="toggle_route("""+route['id']+""", '"""+str(route['enabled'])+"""', 'machines')">
|
||||
"""+route['prefix']+"""
|
||||
</p>
|
||||
"""
|
||||
@@ -779,8 +779,8 @@ def render_routes():
|
||||
is_exit = False
|
||||
|
||||
# Set up the display code:
|
||||
enabled = "<i class='material-icons green-text text-lighten-2'>fiber_manual_record</i>"
|
||||
disabled = "<i class='material-icons red-text text-lighten-1'>fiber_manual_record</i>"
|
||||
enabled = "<a href='#'><i class='material-icons green-text text-lighten-2'>fiber_manual_record</i></a>"
|
||||
disabled = "<a href='#'><i class='material-icons red-text text-lighten-1'>fiber_manual_record</i></a>"
|
||||
|
||||
# Set the displays:
|
||||
enabled_display = disabled
|
||||
@@ -836,8 +836,8 @@ def render_routes():
|
||||
is_exit = False
|
||||
|
||||
# Set up the display code:
|
||||
enabled = "<a href=""><i class='material-icons green-text text-lighten-2'>fiber_manual_record</i></a>"
|
||||
disabled = "<a href=""><i class='material-icons red-text text-lighten-1'>fiber_manual_record</i></a>"
|
||||
enabled = "<a href='#'><i class='material-icons green-text text-lighten-2'>fiber_manual_record</i></a>"
|
||||
disabled = "<a href='#'><i class='material-icons red-text text-lighten-1'>fiber_manual_record</i></a>"
|
||||
|
||||
# Set the displays:
|
||||
enabled_display = disabled
|
||||
|
||||
@@ -802,15 +802,17 @@ function toggle_exit(route1, route2, exit_id, current_state) {
|
||||
})
|
||||
}
|
||||
|
||||
function toggle_route(route_id, current_state, page="machines") {
|
||||
function toggle_route(route_id, current_state, page) {
|
||||
var data = {"route_id": route_id, "current_state": current_state}
|
||||
var element = document.getElementById(route_id);
|
||||
console.log("Editing route "+route_id+" for page: "+page+" (enabled? "+current_state+")")
|
||||
|
||||
if (page == "machines") {
|
||||
var disabledClass = "waves-effect waves-light btn-small red-text lighten-2 tooltipped";
|
||||
var disabledClass = "waves-effect waves-light btn-small red-text lighten-2 tooltipped";
|
||||
var enabledClass = "waves-effect waves-light btn-small green-text lighten-2 tooltipped";
|
||||
}
|
||||
if (page == "routes") {
|
||||
var disabledClass = "material-icons red-text text-lighten-2 tooltipped";
|
||||
var disabledClass = "material-icons red-text text-lighten-2 tooltipped";
|
||||
var enabledClass = "material-icons green-text text-lighten-2 tooltipped";
|
||||
}
|
||||
var disabledTooltip = "Click to enable"
|
||||
|
||||
Reference in New Issue
Block a user