aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/apt-panopticon-report-email-web.lua
diff options
context:
space:
mode:
authoronefang2019-12-12 13:53:47 +1000
committeronefang2019-12-12 13:53:47 +1000
commitbeef318bc3f330bb45541e59672f349a6cb5233b (patch)
treeb272b6a0cd311b9987e227c8f7d9c28c7d050527 /apt-panopticon-report-email-web.lua
parentRe-arrange the RRD data a little. (diff)
downloadapt-panopticon-beef318bc3f330bb45541e59672f349a6cb5233b.zip
apt-panopticon-beef318bc3f330bb45541e59672f349a6cb5233b.tar.gz
apt-panopticon-beef318bc3f330bb45541e59672f349a6cb5233b.tar.bz2
apt-panopticon-beef318bc3f330bb45541e59672f349a6cb5233b.tar.xz
Some refactoring of the results data handling.
Diffstat (limited to 'apt-panopticon-report-email-web.lua')
-rwxr-xr-xapt-panopticon-report-email-web.lua24
1 files changed, 2 insertions, 22 deletions
diff --git a/apt-panopticon-report-email-web.lua b/apt-panopticon-report-email-web.lua
index 6319d1e..c19d211 100755
--- a/apt-panopticon-report-email-web.lua
+++ b/apt-panopticon-report-email-web.lua
@@ -160,18 +160,8 @@ if nil == email then C("opening mirrors file - " .. e) else
160 "==== package mirror status " .. os.date("!%Y-%m-%d %H:%M") .. " GMT ====\n" .. 160 "==== package mirror status " .. os.date("!%Y-%m-%d %H:%M") .. " GMT ====\n" ..
161 "[skip] means that the test hasn't been written yet.\n\n") 161 "[skip] means that the test hasn't been written yet.\n\n")
162 for k, v in APT.orderedPairs(APT.mirrors) do 162 for k, v in APT.orderedPairs(APT.mirrors) do
163 local results = loadfile("results/" .. k .. ".lua")()
164 email:write(k .. "....\n") 163 email:write(k .. "....\n")
165 local IPs = v.IPs 164 local results = APT.collateAll('results', k)
166 for i, u in pairs(IPs) do
167 if "table" == type(u) then
168 for h, t in pairs(u) do
169 results = APT.collate(k, h, results)
170 end
171 else
172 results = APT.collate(k, i, results)
173 end
174 end
175 local ftp = "[skip]" 165 local ftp = "[skip]"
176 local http = status(k, results, "http") 166 local http = status(k, results, "http")
177 local https = status(k, results, "https") 167 local https = status(k, results, "https")
@@ -325,7 +315,7 @@ if nil == web then C("opening mirrors file - " .. e) else
325 "<th>Protocol</th><th>URL sanity</th><th>Integrity</th><th>Updated</th><th colspan='2'>Speed range</th></tr>\n" 315 "<th>Protocol</th><th>URL sanity</th><th>Integrity</th><th>Updated</th><th colspan='2'>Speed range</th></tr>\n"
326 ) 316 )
327 for k, v in APT.orderedPairs(APT.mirrors) do 317 for k, v in APT.orderedPairs(APT.mirrors) do
328 local results = loadfile("results/" .. k .. ".lua")() 318 local results = APT.collateAll('results', k)
329 local active = "" 319 local active = ""
330 if "yes" == v.Active then 320 if "yes" == v.Active then
331 web:write(" <tr><th>" .. k .. "</th> ") 321 web:write(" <tr><th>" .. k .. "</th> ")
@@ -333,16 +323,6 @@ if nil == web then C("opening mirrors file - " .. e) else
333 if nil == v.Active then active = 'nil' else active = v.Active end 323 if nil == v.Active then active = 'nil' else active = v.Active end
334 web:write(" <tr style='background-color:dimgrey'><th>" .. k .. "</th> ") 324 web:write(" <tr style='background-color:dimgrey'><th>" .. k .. "</th> ")
335 end 325 end
336 local IPs = v.IPs
337 for i, u in pairs(IPs) do
338 if "table" == type(u) then
339 for h, t in pairs(u) do
340 results = APT.collate(k, h, results)
341 end
342 else
343 results = APT.collate(k, i, results)
344 end
345 end
346 local ftp = "[<font color='grey'><b>skip</b></font>]" 326 local ftp = "[<font color='grey'><b>skip</b></font>]"
347 local http = status(k, results, "http") 327 local http = status(k, results, "http")
348 local https = status(k, results, "https") 328 local https = status(k, results, "https")