mirror of https://github.com/aredn/aredn.git
Supernode improvements (#945)
* Supernode tunnels are always "perfect" * Move Super Mesh button onto mesh page
This commit is contained in:
parent
57e0d045e9
commit
da8520e202
|
@ -1,8 +0,0 @@
|
||||||
if nixio.fs.stat("/tmp/dnsmasq.d/supernode.conf") then
|
|
||||||
local ip = read_all("/tmp/dnsmasq.d/supernode.conf"):match("^#(%S+)")
|
|
||||||
if ip then
|
|
||||||
return { href = "http://" .. ip .. "/cgi-bin/mesh", display = "Super Mesh", hint = "See what is on the supernode mesh" }
|
|
||||||
end
|
|
||||||
elseif uci.cursor():get("aredn", "@supernode[0]", "enable") == "1" then
|
|
||||||
return { href = "/cgi-bin/mesh", display = "Super Mesh", hint = "See what is on the supernode mesh" }
|
|
||||||
end
|
|
|
@ -349,7 +349,8 @@ if #tunnels > 0 then
|
||||||
print([[Interface]] .. tuns)
|
print([[Interface]] .. tuns)
|
||||||
print([[{]])
|
print([[{]])
|
||||||
print([[ Ip4Broadcast 255.255.255.255]])
|
print([[ Ip4Broadcast 255.255.255.255]])
|
||||||
if not tun_weight or tun_weight < 1 then
|
local is_supernode = cursor:get("aredn", "@supernode[0]", "enable") == "1"
|
||||||
|
if not tun_weight or tun_weight < 1 or is_supernode then
|
||||||
print([[ Mode "ether"]])
|
print([[ Mode "ether"]])
|
||||||
elseif tun_weight > 1 then
|
elseif tun_weight > 1 then
|
||||||
print([[ LinkQualityMult default ]] .. (1 / tun_weight))
|
print([[ LinkQualityMult default ]] .. (1 / tun_weight))
|
||||||
|
|
|
@ -269,7 +269,8 @@ local settings = {
|
||||||
type = "string",
|
type = "string",
|
||||||
desc = "<b>Tunnel Weight</b> specifies the cost of using a tunnel. The higher the number, the less likely a tunnel is used.<br><br><small>aredn.@tunnel[0].weight</small>",
|
desc = "<b>Tunnel Weight</b> specifies the cost of using a tunnel. The higher the number, the less likely a tunnel is used.<br><br><small>aredn.@tunnel[0].weight</small>",
|
||||||
default = "1",
|
default = "1",
|
||||||
needreboot= true
|
needreboot= true,
|
||||||
|
condition = "not isSupernode()"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
category = "Tunnel Options",
|
category = "Tunnel Options",
|
||||||
|
@ -581,12 +582,8 @@ function supportsVLANChange()
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
function canBeSupernode()
|
function isSupernode()
|
||||||
local board = aredn.hardware.get_board_type()
|
return cursor_get("aredn", "@supernode[0]", "enable") == "1"
|
||||||
if board == "mikrotik,hap-ac2" or board == "qemu-standard-pc-i440fx-piix-1996" then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
return false
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- callbacks
|
-- callbacks
|
||||||
|
|
|
@ -511,7 +511,13 @@ else
|
||||||
html.print(" ")
|
html.print(" ")
|
||||||
html.print("<input type=submit name=auto value=Auto title='Automatic page refresh'>")
|
html.print("<input type=submit name=auto value=Auto title='Automatic page refresh'>")
|
||||||
end
|
end
|
||||||
|
if nixio.fs.stat("/tmp/dnsmasq.d/supernode.conf") then
|
||||||
|
local ip = read_all("/tmp/dnsmasq.d/supernode.conf"):match("^#(%S+)")
|
||||||
|
if ip then
|
||||||
|
html.print(" ")
|
||||||
|
html.print("<a target=_blank href='http://" .. ip .. "/cgi-bin/mesh'><button type=button title='See what is on the whole AREDN mesh'>Super Mesh</button></a>")
|
||||||
|
end
|
||||||
|
end
|
||||||
html.print(" ")
|
html.print(" ")
|
||||||
html.print("<button type=button onClick='window.location=\"status\"' title='Return to the status page'>Quit</button>")
|
html.print("<button type=button onClick='window.location=\"status\"' title='Return to the status page'>Quit</button>")
|
||||||
html.print(" ")
|
html.print(" ")
|
||||||
|
|
Loading…
Reference in New Issue