From c4bd018a5cb999220a6bf2738c3cd063319daaa6 Mon Sep 17 00:00:00 2001 From: Steve AB7PA <69524416+ab7pa@users.noreply.github.com> Date: Tue, 7 Jun 2022 19:30:27 -0700 Subject: [PATCH] restrict msg banner to nonprotected pages (#384) * restrict aredn messages to non-protected pages * fix typo --- files/usr/lib/lua/aredn/html.lua | 15 ++++++++------- files/www/cgi-bin/mesh | 1 + files/www/cgi-bin/status | 1 + 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/files/usr/lib/lua/aredn/html.lua b/files/usr/lib/lua/aredn/html.lua index 2f6cd1b3..cd4ba882 100644 --- a/files/usr/lib/lua/aredn/html.lua +++ b/files/usr/lib/lua/aredn/html.lua @@ -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("
") html.print("
") - local supported = aredn.hardware.supported() if supported == 0 then html.print("
!!!! UNSUPPORTED DEVICE !!!!
") @@ -81,14 +77,19 @@ function html.alert_banner() elseif supported ~= 1 then html.print("
!!!! UNTESTED HARDWARE !!!!
") end + html.print("
") +end +function html.msg_banner() + html.print("
") + 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("
AREDN Alert(s):
" .. aredn_message .. "
") + html.print("
AREDN Messages:
" .. aredn_message .. "
") end if local_message and #local_message > 0 then - html.print("
Local Alert(s):
" .. local_message .. "
") + html.print("
Local Messages:
" .. local_message .. "
") end - html.print("
") end diff --git a/files/www/cgi-bin/mesh b/files/www/cgi-bin/mesh index 649dc434..52415d38 100755 --- a/files/www/cgi-bin/mesh +++ b/files/www/cgi-bin/mesh @@ -419,6 +419,7 @@ html.print("") html.print("
") html.alert_banner() +html.msg_banner() html.print("

" .. node .. " mesh status

") diff --git a/files/www/cgi-bin/status b/files/www/cgi-bin/status index e07d6beb..bd8df865 100755 --- a/files/www/cgi-bin/status +++ b/files/www/cgi-bin/status @@ -221,6 +221,7 @@ html.print("