mirror of https://github.com/aredn/aredn.git
restrict msg banner to nonprotected pages (#384)
* restrict aredn messages to non-protected pages * fix typo
This commit is contained in:
parent
bf8c6ee093
commit
c4bd018a5c
|
@ -67,12 +67,8 @@ function html.footer()
|
|||
end
|
||||
|
||||
function html.alert_banner()
|
||||
local aredn_message = read_all("/tmp/aredn_message")
|
||||
local local_message = read_all("/tmp/local_message")
|
||||
|
||||
html.print("<div class=\"TopBanner\">")
|
||||
html.print("<div class=\"LogoDiv\"><a href=\"http://localnode.local.mesh:8080\" title=\"Go to localnode\"><img src=\"/AREDN.png\" class=\"AREDNLogo\"></img></a></div>")
|
||||
|
||||
local supported = aredn.hardware.supported()
|
||||
if supported == 0 then
|
||||
html.print("<div style=\"padding:5px;background-color:#FF4719;color:black;border:1px solid #ccc;width:600px;\"><a href=\"/cgi-bin/sysinfo\">!!!! UNSUPPORTED DEVICE !!!!</a></div>")
|
||||
|
@ -81,14 +77,19 @@ function html.alert_banner()
|
|||
elseif supported ~= 1 then
|
||||
html.print("<div style=\"padding:5px;background-color:yellow;color:black;border:1px solid #ccc;width:600px;\"><a href=\"/cgi-bin/sysinfo\">!!!! UNTESTED HARDWARE !!!!</a></div>")
|
||||
end
|
||||
html.print("</div>")
|
||||
end
|
||||
|
||||
function html.msg_banner()
|
||||
html.print("<div class=\"TopBanner\">")
|
||||
local aredn_message = read_all("/tmp/aredn_message")
|
||||
local local_message = read_all("/tmp/local_message")
|
||||
if aredn_message and #aredn_message > 0 then
|
||||
html.print("<div style=\"padding:5px;background-color:#fff380;color:black;border:1px solid #ccc;width:600px;\"><strong>AREDN Alert(s):</strong><br /><div style=\"text-align:left;\">" .. aredn_message .. "</div></div>")
|
||||
html.print("<div style=\"padding:5px;background-color:#fff380;color:black;border:1px solid #ccc;width:600px;\"><strong>AREDN Messages:</strong><br /><div style=\"text-align:left;\">" .. aredn_message .. "</div></div>")
|
||||
end
|
||||
if local_message and #local_message > 0 then
|
||||
html.print("<div style=\"padding:5px;background-color:#fff380;color:black;border:1px solid #ccc;width:600px;\"><strong>Local Alert(s):</strong><br /><div style=\"text-align:left;\">" .. local_message .. "</div></div>")
|
||||
html.print("<div style=\"padding:5px;background-color:#fff380;color:black;border:1px solid #ccc;width:600px;\"><strong>Local Messages:</strong><br /><div style=\"text-align:left;\">" .. local_message .. "</div></div>")
|
||||
end
|
||||
|
||||
html.print("</div>")
|
||||
end
|
||||
|
||||
|
|
|
@ -419,6 +419,7 @@ html.print("<input type=hidden name=reload value=1>")
|
|||
html.print("<center>")
|
||||
|
||||
html.alert_banner()
|
||||
html.msg_banner()
|
||||
|
||||
html.print("<h1>" .. node .. " mesh status</h1>")
|
||||
|
||||
|
|
|
@ -221,6 +221,7 @@ html.print("<body><form method='post' action='/cgi-bin/status' enctype='multipar
|
|||
html.print("<center>")
|
||||
|
||||
html.alert_banner()
|
||||
html.msg_banner()
|
||||
|
||||
-- page header
|
||||
html.print("<h1><big>" .. node)
|
||||
|
|
Loading…
Reference in New Issue