From bf8c6ee0939b42b471be072d9d03e21636f2aeb6 Mon Sep 17 00:00:00 2001 From: Steve AB7PA <69524416+ab7pa@users.noreply.github.com> Date: Sat, 4 Jun 2022 20:45:00 -0700 Subject: [PATCH] add hardware type to Status page (#382) --- files/www/cgi-bin/status | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/files/www/cgi-bin/status b/files/www/cgi-bin/status index cd0feed9..e07d6beb 100755 --- a/files/www/cgi-bin/status +++ b/files/www/cgi-bin/status @@ -354,13 +354,12 @@ if config == "mesh" and not wifi_disabled then if s == "N/A" then col2[#col2] = col2[#col2] .. "N/A" else - col2[#col2] = col2[#col2] .. "" .. s .. " / " .. n .. " / " .. (s - n) .. " dB" + col2[#col2] = col2[#col2] .. "" .. s .. " / " .. n .. " / " .. math.abs(s - n) .. " dB" end col2[#col2] = col2[#col2] .. "   " end -col2[#col2 + 1] = "firmware version" .. read_all("/etc/mesh-release") .. ""; -col2[#col2 + 1] = "system time" .. os.date("%a %b %e %Y") .. "
" .. os.date("%T %Z") .. ""; +col2[#col2 + 1] = "firmware version
hardware type" .. read_all("/etc/mesh-release") .. "
" .. aredn.hardware.get_type() .. ""; local sysinfo = nixio.sysinfo() local uptime = string.format("%d:%02d", math.floor(sysinfo.uptime / 3600) % 24, math.floor(sysinfo.uptime / 60) % 60) @@ -369,8 +368,8 @@ if sysinfo.uptime >= 172800 then elseif sysinfo.uptime >= 86400 then uptime = "1 day, " .. uptime end +col2[#col2 + 1] = "system time
uptime" .. os.date("%a %b %e %Y") .. " " .. os.date("%T %Z") .. "
" .. uptime .. ""; -col2[#col2 + 1] = "uptime
load average" .. uptime .. "
" .. string.format("%.2f, %.2f, %.2f", sysinfo.loads[1], sysinfo.loads[2], sysinfo.loads[3]) .. ""; local vfs = nixio.fs.statvfs("/overlay") local fspace = vfs.bfree * vfs.bsize / 1024 if fspace < 100 then @@ -391,8 +390,9 @@ if rspace < 500 then else rspace = rspace .. " KB" end -col2[#col2 + 1] = "free spaceflash = " .. fspace .. "
/tmp = " .. tspace .. "
memory = " .. rspace .. "" -col2[#col2 + 1] = "OLSR EntriesTotal = " .. olsr_total .. "
Nodes = " .. olsr_nodes .. "" + +col2[#col2 + 1] = "load average
free space" .. string.format("%.2f, %.2f, %.2f", sysinfo.loads[1], sysinfo.loads[2], sysinfo.loads[3]) .. "
flash = " .. fspace .. "
/tmp = " .. tspace .. "
memory = " .. rspace .. ""; +col2[#col2 + 1] = "OLSR EntriesTotal = " .. olsr_total .. "
Nodes = " .. olsr_nodes .. "" -- now print the tables