From a8b5b0b91895bae0dae7a90ecfdadc2705e7a601 Mon Sep 17 00:00:00 2001 From: onefang Date: Fri, 27 Dec 2019 01:04:31 +1000 Subject: Make the web page look better, and the tables take up less space. --- apt-panopticommon.lua | 2 +- apt-panopticon-report-email-web.lua | 61 ++++++++++++++++++++----------------- 2 files changed, 34 insertions(+), 29 deletions(-) diff --git a/apt-panopticommon.lua b/apt-panopticommon.lua index 24e6d08..71e9a9c 100644 --- a/apt-panopticommon.lua +++ b/apt-panopticommon.lua @@ -487,7 +487,7 @@ APT.plurals = function(e, w, t) end if ("" ~= result) and APT.html then result = "" .. result .. "" end end - if "" ~= result then result = " (" .. result .. ")" end + if "" ~= result then result = " " .. result end return result end diff --git a/apt-panopticon-report-email-web.lua b/apt-panopticon-report-email-web.lua index 60d1b49..079c4cc 100755 --- a/apt-panopticon-report-email-web.lua +++ b/apt-panopticon-report-email-web.lua @@ -81,13 +81,13 @@ local status = function(hosts, host, results, typ) end if to then - result = "[TIMEOUT" + result = "TIMEOUT" if not s then result = result .. "*" end if APT.html then if s then - result = "[TIMEOUT" + result = "TIMEOUT" else - result = "[TIMEOUT*" + result = "TIMEOUT*" end end if APT.html then @@ -96,13 +96,13 @@ local status = function(hosts, host, results, typ) faulty = faulty .. host .. " (" .. typ .. ")\n" end elseif 0 < e then - result = "[FAILED" + result = "FAILED" if not s then result = result .. "*" end if APT.html then if s then - result = "[FAILED" + result = "FAILED" else - result = "[FAILED*" + result = "FAILED*" end end if APT.html then @@ -111,17 +111,17 @@ local status = function(hosts, host, results, typ) faulty = faulty .. host .. " (" .. typ .. ")\n" end else - result = "[OK" + result = "OK" if not s then result = result .. "*" end if APT.html then if s then - result = "[OK" + result = "OK" else - result = "[OK*" + result = "OK*" end end end - return result .. APT.plurals(e, w, t) .. "]" + return result .. APT.plurals(e, w, t) end local m = {} @@ -345,38 +345,41 @@ if nil == web then C("opening mirrors file - " .. e) else "The links in the table and DNS list go to the detailed testing logs.
\n\n" .. "[FAILED] or [OK]" .. + "
FAILED or OK" .. " means the tested thing is supported for that mirror.
\n" .. - "[FAILED*] or [OK*]" .. + "
FAILED* or OK*" .. " means the tested thing is unsupported for that mirror, but might have been tested anyway.
\n" .. - "[timeout] or [timeout]" .. + "
timeout or timeout" .. " means the mirror had some timeouts, and tests where not yet aborted. The darker colour means unsupported by the mirror, but tested anyway.
" .. - "[TIMEOUT] or [TIMEOUT]" .. + "
TIMEOUT or TIMEOUT" .. " means the mirror had too many timeouts, and tests where aborted, so there is no result for this test.
" .. "NOTE: timeouts may be due to a problem on the testing computer.
" .. - "The DNS round robin (DNS-RR) column shows the IPs for that mirror, or [no] if it isn't part of the DNS-RR. " .. + "
The DNS round robin (DNS-RR) column shows the IPs for that mirror, or no if it isn't part of the DNS-RR. " .. "The IPs link to the testing log for that IP accessed via the DNS-RR. " .. "deb.devuan.org is the DNS-RR itself, so it doesn't get tested directly.
\n" .. "The time in the Updated column is how often the mirror updates itself.
" .. "Mirrors with a grey background are not active (though may be usable as part of the DNS-RR).
\n" .. - "[skip] means that the test hasn't been written yet.
\n" .. + "skip means that the test hasn't been written yet.
\n" .. "" .. lnk('FTP') .. " | " .. lnk('HTTP') .. " | " .. lnk('HTTPS') .. " | " .. lnk('RSYNC') .. " | " .. "" .. lnk('DNS round robin', 'DNS-RR') .. " | " .. lnk('Protocol') .. " | " .. lnk('URL sanity', 'URL-Sanity') .. " | " .. lnk('Integrity') .. " | " .. "" .. lnk('Updated') .. " | " .. lnk('Speed range', 'Speed') .. " | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
" .. k .. " | ") + web:write("|||||||||||||||
" .. k .. " | ") else if nil == v.Active then active = 'nil' else active = v.Active end web:write("|||||||||||||||
" .. k .. " | ") end - local ftp = "[skip]" + local ftp = "skip" local http = status(APT.mirrors, k, results, "http") local https = status(APT.mirrors, k, results, "https") - local rsync = "[skip]" + local rsync = "skip" local dns = "" local protocol = status(APT.mirrors, k, results, "Protocol") local sanity = status(APT.mirrors, k, results, "URLSanity") @@ -386,7 +389,7 @@ if nil == web then C("opening mirrors file - " .. e) else if nil ~= rate then updated = updated .. ' ' .. rate end local min = tonumber(results.speed.min) local max = tonumber(results.speed.max) - local spd = '' + local spd = '' -- DNS-RR test. if ("deb.devuan.org" ~= k) and (nil ~= APT.mirrors["deb.devuan.org"]) then @@ -417,12 +420,12 @@ if nil == web then C("opening mirrors file - " .. e) else end end end - if "" == dns then dns = "[no]" end + if "" == dns then dns = "no" end if 0 == max then spd = ' | ' else - spd = string.format(' | %d -> | %d | ', min, max) + spd = string.format('%d - | %d | ', min, max) end end @@ -476,6 +479,7 @@ if nil == web then C("opening mirrors file - " .. e) else results = {} m = {} faulty = "" + bg = '' web:write( "" .. lnk('DNS round robin', 'DNS-RR') .. " | " .. lnk('Protocol') .. " | " .. lnk('URL sanity', 'URL-Sanity') .. " | " .. lnk('Integrity') .. " | " .. "" .. lnk('Updated') .. " | " .. lnk('Speed range', 'Speed') .. " | |||
" .. k .. " | ") + web:write("|||||||||||||||
" .. k .. " | ") else if nil == v.Active then active = 'nil' else active = v.Active end web:write("|||||||||||||||
" .. k .. " | ") end - local ftp = "[skip]" + local ftp = "skip" local http = status(APT.debians, k, results, "http") local https = status(APT.debians, k, results, "https") - local rsync = "[skip]" + local rsync = "skip" local dns = "" local protocol = status(APT.debians, k, results, "Protocol") local sanity = status(APT.debians, k, results, "URLSanity") @@ -506,7 +511,7 @@ if nil == web then C("opening mirrors file - " .. e) else if nil ~= rate then updated = updated .. ' ' .. rate end local min = tonumber(results.speed.min) local max = tonumber(results.speed.max) - local spd = '' + local spd = '' -- DNS-RR test. if ("deb.devuan.org" ~= k) and (nil ~= APT.debians["deb.devuan.org"]) then @@ -537,12 +542,12 @@ if nil == web then C("opening mirrors file - " .. e) else end end end - if "" == dns then dns = "[no]" end + if "" == dns then dns = "no" end if 0 == max then spd = ' | ' else - spd = string.format(' | %d -> | %d | ', min, max) + spd = string.format('%d - | %d | ', min, max) end end -- cgit v1.1