diff --git a/files/www/cgi-bin/mesh b/files/www/cgi-bin/mesh
index e05b396a..c0217065 100755
--- a/files/www/cgi-bin/mesh
+++ b/files/www/cgi-bin/mesh
@@ -420,11 +420,11 @@ html.print([[
]])
@@ -517,15 +511,13 @@ if not next(localhosts) and not next(links) then
os.exit(0)
end
--- main for page formatting
-html.print("
")
-
--- start main table row 1 left cell
-html.print("
")
-
--- show local hosts table
+-- show local node table
html.print("
")
-html.print("
This Node
LAN Hostname
Service Name
")
+html.print("
")
+html.print("
")
+html.print("
")
+html.print("
")
+html.print("
")
if next(localhosts) then
local rows = {}
@@ -605,91 +597,16 @@ end
-- discard
localhosts = nil
---end row 1 left cell
-html.print("
")
-
--- insert center margin cell
-html.print("
")
-
--- start main table row1 right cell
-html.print("
")
-
--- show OLSR entries row
-html.print("
")
-html.print("
OLSR Entries
")
-html.print("
Nodes: " .. olsr_nodes .. "
Total: " .. olsr_total .. "
")
-if nixio.sysinfo().freeram < lowmemory then
- html.print("
NOTE: Counts are correct but page may be truncated on this low memory node
")
-end
-
--- show previous neighbors
-html.print("
Previous Neighbors
")
-
-local rows = {}
-local uptime = nixio.sysinfo().uptime
-for ip, node in pairs(history)
-do
- if not (links[ip] or links[ipalias[ip]]) then
- local age = uptime - tonumber(node.age)
- local host = node.host
- if host == "" then
- host = ip
- else
- host = host:gsub("^mid%d+%.", ""):gsub("^dtdlink%.", "")
- end
- local row = "
" .. host
- if hosts[ip] and hosts[ip].hosts then
- for _, v in ipairs(hosts[ip].hosts)
- do
- row = row .. " " .. v
- end
- end
- row = row .. "
"
- if age < 3600 then
- local val = math.floor(age / 60)
- if val == 1 then
- row = row .. "1 minute ago"
- else
- row = row .. val .. " minutes ago"
- end
- else
- local val = string.format("%.1f", age / 3600)
- if val == "1.0" then
- row = row .. "1 hour ago"
- else
- row = row .. val .. " hours ago"
- end
- end
- row = row .. "
"
- rows[#rows + 1] = { key = age, row = row }
- end
-end
-if #rows > 0 then
- table.sort(rows, function(a,b) return a.key < b.key end)
- for _, row in ipairs(rows)
- do
- html.print(row.row)
- end
- -- discard
- rows = nil
-else
- html.print("
none
")
-end
-
--- end row 1 right table and cell
-html.print("
", 100 * link.lq, 100 * link.nlq, link.mbps)
if not neighservices[name] then
neighservices[name] = true
+ row = row .. "
"
if services[name] then
for _, v in pairs(services[name])
do
@@ -760,7 +678,7 @@ do
local localpart = dmzhost:match("(.*)%.local%.mesh")
if localpart then
row = row .. "
" .. localpart .. "
"
- row = row .. "
"
+ row = row .. "
"
if services[dmzhost] then
for _, v in pairs(services[dmzhost])
do
@@ -787,17 +705,63 @@ else
html.print("
none
")
end
--- end row 2 table and cell
-html.print("
")
+--add previous neighbors
+local rows = {}
+local uptime = nixio.sysinfo().uptime
+for ip, node in pairs(history)
+do
+ if not (links[ip] or links[ipalias[ip]]) then
+ local age = uptime - tonumber(node.age)
+ local host = node.host
+ if host == "" then
+ host = ip
+ else
+ host = host:gsub("^mid%d+%.", ""):gsub("^dtdlink%.", "")
+ end
+ local row = "
" .. host
+ if hosts[ip] and hosts[ip].hosts then
+ for _, v in ipairs(hosts[ip].hosts)
+ do
+ row = row .. " " .. v
+ end
+ end
+ row = row .. "
"
+ if age < 3600 then
+ local val = math.floor(age / 60)
+ if val == 1 then
+ row = row .. "1 minute ago"
+ else
+ row = row .. val .. " minutes ago"
+ end
+ else
+ local val = string.format("%.1f", age / 3600)
+ if val == "1.0" then
+ row = row .. "1 hour ago"
+ else
+ row = row .. val .. " hours ago"
+ end
+ end
+ row = row .. "