From 08226ca8d0cd1a52f98e39dbb04a71b08545feb6 Mon Sep 17 00:00:00 2001 From: Tim Wilkinson Date: Mon, 25 Mar 2024 19:52:16 -0700 Subject: [PATCH] Make auto mesh reloading per browser rather then per node (#1122) --- files/www/cgi-bin/mesh | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/files/www/cgi-bin/mesh b/files/www/cgi-bin/mesh index 3ae41395..d0252d93 100755 --- a/files/www/cgi-bin/mesh +++ b/files/www/cgi-bin/mesh @@ -88,27 +88,6 @@ if not nixio.fs.stat("/tmp/web") then nixio.fs.mkdir("/tmp/web") end --- post data - -if os.getenv("REQUEST_METHOD") == "POST" then - require('luci.http') - local request = luci.http.Request(nixio.getenv(), - function() - local v = io.read(1024) - if not v then - io.close() - end - return v - end - ) - if request:formvalue("auto") then - io.open("/tmp/web/automesh", "w"):close() - end - if request:formvalue("stop") then - os.remove("/tmp/web/automesh") - end -end - local cursor = uci.cursor() local node_desc = cursor:get("system", "@system[0]", "description") local lat_lon = "Location Not Available" @@ -375,9 +354,9 @@ end ------------------ http_header() html.header(node .. " mesh status", false) -local automesh = nixio.fs.stat("/tmp/web/automesh"); +local automesh = string.find((nixio.getenv("QUERY_STRING") or ""):lower(),"automesh=1") if automesh then - html.print("") + html.print("") end html.print([[