diff options
author | onefang | 2019-12-27 01:04:31 +1000 |
---|---|---|
committer | onefang | 2019-12-27 01:04:31 +1000 |
commit | a8b5b0b91895bae0dae7a90ecfdadc2705e7a601 (patch) | |
tree | 7d1f837ffcaa53bb60d7aae3187c2724c01ee95f | |
parent | Explain the time notation for Updated. (diff) | |
download | apt-panopticon-a8b5b0b91895bae0dae7a90ecfdadc2705e7a601.zip apt-panopticon-a8b5b0b91895bae0dae7a90ecfdadc2705e7a601.tar.gz apt-panopticon-a8b5b0b91895bae0dae7a90ecfdadc2705e7a601.tar.bz2 apt-panopticon-a8b5b0b91895bae0dae7a90ecfdadc2705e7a601.tar.xz |
Make the web page look better, and the tables take up less space.
-rw-r--r-- | apt-panopticommon.lua | 2 | ||||
-rwxr-xr-x | 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) | |||
487 | end | 487 | end |
488 | if ("" ~= result) and APT.html then result = "<font color='blue'><b>" .. result .. "</b></font>" end | 488 | if ("" ~= result) and APT.html then result = "<font color='blue'><b>" .. result .. "</b></font>" end |
489 | end | 489 | end |
490 | if "" ~= result then result = " (" .. result .. ")" end | 490 | if "" ~= result then result = " " .. result end |
491 | return result | 491 | return result |
492 | end | 492 | end |
493 | 493 | ||
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) | |||
81 | end | 81 | end |
82 | 82 | ||
83 | if to then | 83 | if to then |
84 | result = "[TIMEOUT" | 84 | result = "TIMEOUT" |
85 | if not s then result = result .. "*" end | 85 | if not s then result = result .. "*" end |
86 | if APT.html then | 86 | if APT.html then |
87 | if s then | 87 | if s then |
88 | result = "[<font color='blue'><b>TIMEOUT</b></font>" | 88 | result = "<font color='blue'><b>TIMEOUT</b></font>" |
89 | else | 89 | else |
90 | result = "[<font color='darkblue'><b>TIMEOUT*</b></font>" | 90 | result = "<font color='darkblue'><b>TIMEOUT*</b></font>" |
91 | end | 91 | end |
92 | end | 92 | end |
93 | if APT.html then | 93 | if APT.html then |
@@ -96,13 +96,13 @@ local status = function(hosts, host, results, typ) | |||
96 | faulty = faulty .. host .. " (" .. typ .. ")\n" | 96 | faulty = faulty .. host .. " (" .. typ .. ")\n" |
97 | end | 97 | end |
98 | elseif 0 < e then | 98 | elseif 0 < e then |
99 | result = "[FAILED" | 99 | result = "FAILED" |
100 | if not s then result = result .. "*" end | 100 | if not s then result = result .. "*" end |
101 | if APT.html then | 101 | if APT.html then |
102 | if s then | 102 | if s then |
103 | result = "[<font color='red'><b>FAILED</b></font>" | 103 | result = "<font color='red'><b>FAILED</b></font>" |
104 | else | 104 | else |
105 | result = "[<font color='darkred'><b>FAILED*</b></font>" | 105 | result = "<font color='darkred'><b>FAILED*</b></font>" |
106 | end | 106 | end |
107 | end | 107 | end |
108 | if APT.html then | 108 | if APT.html then |
@@ -111,17 +111,17 @@ local status = function(hosts, host, results, typ) | |||
111 | faulty = faulty .. host .. " (" .. typ .. ")\n" | 111 | faulty = faulty .. host .. " (" .. typ .. ")\n" |
112 | end | 112 | end |
113 | else | 113 | else |
114 | result = "[OK" | 114 | result = "OK" |
115 | if not s then result = result .. "*" end | 115 | if not s then result = result .. "*" end |
116 | if APT.html then | 116 | if APT.html then |
117 | if s then | 117 | if s then |
118 | result = "[<font color='lime'><b>OK</b></font>" | 118 | result = "<font color='lime'><b>OK</b></font>" |
119 | else | 119 | else |
120 | result = "[<font color='darkgreen'><b>OK*</b></font>" | 120 | result = "<font color='darkgreen'><b>OK*</b></font>" |
121 | end | 121 | end |
122 | end | 122 | end |
123 | end | 123 | end |
124 | return result .. APT.plurals(e, w, t) .. "]" | 124 | return result .. APT.plurals(e, w, t) |
125 | end | 125 | end |
126 | 126 | ||
127 | local m = {} | 127 | local m = {} |
@@ -345,38 +345,41 @@ if nil == web then C("opening mirrors file - " .. e) else | |||
345 | "The links in the table and DNS list go to the detailed testing logs.</p>\n\n" .. | 345 | "The links in the table and DNS list go to the detailed testing logs.</p>\n\n" .. |
346 | "<hr>\n<h2>==== package mirror status " .. os.date("!%F %H:%M") .. " GMT ====</h2>\n" .. | 346 | "<hr>\n<h2>==== package mirror status " .. os.date("!%F %H:%M") .. " GMT ====</h2>\n" .. |
347 | 347 | ||
348 | "<p>[<font color='red'><b>FAILED</b></font>] or [<font color='lime'><b>OK</b></font>]" .. | 348 | "<p><font color='red'><b>FAILED</b></font> or <font color='lime'><b>OK</b></font>" .. |
349 | " means the tested thing is supported for that mirror.</p>\n" .. | 349 | " means the tested thing is supported for that mirror.</p>\n" .. |
350 | "<p>[<font color='darkred'><b>FAILED*</b></font>] or [<font color='darkgreen'><b>OK*</b></font>]" .. | 350 | "<p><font color='darkred'><b>FAILED*</b></font> or <font color='darkgreen'><b>OK*</b></font>" .. |
351 | " means the tested thing is unsupported for that mirror, but might have been tested anyway.</p>\n" .. | 351 | " means the tested thing is unsupported for that mirror, but might have been tested anyway.</p>\n" .. |
352 | "<p>[<font color='blue'><b>timeout</b></font>] or [<font color='darkblue'><b>timeout</b></font>]" .. | 352 | "<p><font color='blue'><b>timeout</b></font> or <font color='darkblue'><b>timeout</b></font>" .. |
353 | " means the mirror had some timeouts, and tests where not yet aborted. The darker colour means unsupported by the mirror, but tested anyway.</p>" .. | 353 | " means the mirror had some timeouts, and tests where not yet aborted. The darker colour means unsupported by the mirror, but tested anyway.</p>" .. |
354 | "<p>[<font color='blue'><b>TIMEOUT</b></font>] or [<font color='darkblue'><b>TIMEOUT</b></font>]" .. | 354 | "<p><font color='blue'><b>TIMEOUT</b></font> or <font color='darkblue'><b>TIMEOUT</b></font>" .. |
355 | " means the mirror had too many timeouts, and tests where aborted, so there is no result for this test.</p>" .. | 355 | " means the mirror had too many timeouts, and tests where aborted, so there is no result for this test.</p>" .. |
356 | "<p>NOTE: timeouts may be due to a problem on the testing computer.</p>" .. | 356 | "<p>NOTE: timeouts may be due to a problem on the testing computer.</p>" .. |
357 | "<p>The DNS round robin (DNS-RR) column shows the IPs for that mirror, or [<font color='grey'><b>no</b></font>] if it isn't part of the DNS-RR. " .. | 357 | "<p>The DNS round robin (DNS-RR) column shows the IPs for that mirror, or <font color='grey'><b>no</b></font> if it isn't part of the DNS-RR. " .. |
358 | "The IPs link to the testing log for that IP accessed via the DNS-RR. " .. | 358 | "The IPs link to the testing log for that IP accessed via the DNS-RR. " .. |
359 | "deb.devuan.org is the DNS-RR itself, so it doesn't get tested directly.</p>\n" .. | 359 | "deb.devuan.org is the DNS-RR itself, so it doesn't get tested directly.</p>\n" .. |
360 | "<p>The time in the Updated column is how often the mirror updates itself.</p>" .. | 360 | "<p>The time in the Updated column is how often the mirror updates itself.</p>" .. |
361 | "<p>Mirrors with a <font style='background-color:dimgrey'>grey background</font> are not active (though may be usable as part of the DNS-RR).</p>\n" .. | 361 | "<p>Mirrors with a <font style='background-color:dimgrey'>grey background</font> are not active (though may be usable as part of the DNS-RR).</p>\n" .. |
362 | "<p>[<font color='grey'><b>skip</b></font>] means that the test hasn't been written yet.</p>\n" .. | 362 | "<p><font color='grey'><b>skip</b></font> means that the test hasn't been written yet.</p>\n" .. |
363 | "<table>\n<tr><th></th><th>" .. lnk('FTP') .. "</th><th>" .. lnk('HTTP') .. "</th><th>" .. lnk('HTTPS') .. "</th><th>" .. lnk('RSYNC') .. "</th>" .. | 363 | "<table>\n<tr><th></th><th>" .. lnk('FTP') .. "</th><th>" .. lnk('HTTP') .. "</th><th>" .. lnk('HTTPS') .. "</th><th>" .. lnk('RSYNC') .. "</th>" .. |
364 | "<th>" .. lnk('DNS round robin', 'DNS-RR') .. "</th><th>" .. lnk('Protocol') .. "</th><th>" .. lnk('URL sanity', 'URL-Sanity') .. "</th><th>" .. lnk('Integrity') .. "</th>" .. | 364 | "<th>" .. lnk('DNS round robin', 'DNS-RR') .. "</th><th>" .. lnk('Protocol') .. "</th><th>" .. lnk('URL sanity', 'URL-Sanity') .. "</th><th>" .. lnk('Integrity') .. "</th>" .. |
365 | "<th>" .. lnk('Updated') .. "</th><th colspan='2'>" .. lnk('Speed range', 'Speed') .. "</th></tr>\n" | 365 | "<th>" .. lnk('Updated') .. "</th><th colspan='2'>" .. lnk('Speed range', 'Speed') .. "</th></tr>\n" |
366 | ) | 366 | ) |
367 | |||
368 | local bg = '' | ||
367 | for k, v in APT.orderedPairs(APT.mirrors) do | 369 | for k, v in APT.orderedPairs(APT.mirrors) do |
368 | local results = APT.collateAll(APT.mirrors, 'results', k) | 370 | local results = APT.collateAll(APT.mirrors, 'results', k) |
371 | if '' == bg then bg = " style='background-color:#111111'" else bg = '' end | ||
369 | local active = "" | 372 | local active = "" |
370 | if "yes" == v.Active then | 373 | if "yes" == v.Active then |
371 | web:write(" <tr><th>" .. k .. "</th> ") | 374 | web:write(" <tr" .. bg .. "><th>" .. k .. "</th> ") |
372 | else | 375 | else |
373 | if nil == v.Active then active = 'nil' else active = v.Active end | 376 | if nil == v.Active then active = 'nil' else active = v.Active end |
374 | web:write(" <tr style='background-color:dimgrey'><th>" .. k .. "</th> ") | 377 | web:write(" <tr style='background-color:dimgrey'><th>" .. k .. "</th> ") |
375 | end | 378 | end |
376 | local ftp = "[<font color='grey'><b>skip</b></font>]" | 379 | local ftp = "<font color='grey'><b>skip</b></font>" |
377 | local http = status(APT.mirrors, k, results, "http") | 380 | local http = status(APT.mirrors, k, results, "http") |
378 | local https = status(APT.mirrors, k, results, "https") | 381 | local https = status(APT.mirrors, k, results, "https") |
379 | local rsync = "[<font color='grey'><b>skip</b></font>]" | 382 | local rsync = "<font color='grey'><b>skip</b></font>" |
380 | local dns = "" | 383 | local dns = "" |
381 | local protocol = status(APT.mirrors, k, results, "Protocol") | 384 | local protocol = status(APT.mirrors, k, results, "Protocol") |
382 | local sanity = status(APT.mirrors, k, results, "URLSanity") | 385 | local sanity = status(APT.mirrors, k, results, "URLSanity") |
@@ -386,7 +389,7 @@ if nil == web then C("opening mirrors file - " .. e) else | |||
386 | if nil ~= rate then updated = updated .. ' ' .. rate end | 389 | if nil ~= rate then updated = updated .. ' ' .. rate end |
387 | local min = tonumber(results.speed.min) | 390 | local min = tonumber(results.speed.min) |
388 | local max = tonumber(results.speed.max) | 391 | local max = tonumber(results.speed.max) |
389 | local spd = '' | 392 | local spd = '<td></td><td></td>' |
390 | 393 | ||
391 | -- DNS-RR test. | 394 | -- DNS-RR test. |
392 | if ("deb.devuan.org" ~= k) and (nil ~= APT.mirrors["deb.devuan.org"]) then | 395 | 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 | |||
417 | end | 420 | end |
418 | end | 421 | end |
419 | end | 422 | end |
420 | if "" == dns then dns = "[<font color='grey'><b>no</b></font>]" end | 423 | if "" == dns then dns = "<font color='grey'><b>no</b></font>" end |
421 | 424 | ||
422 | if 0 == max then | 425 | if 0 == max then |
423 | spd = '<td></td><td></td>' | 426 | spd = '<td></td><td></td>' |
424 | else | 427 | else |
425 | spd = string.format('<td align="right">%d -></td><td align="right">%d</td>', min, max) | 428 | spd = string.format('<td align="right">%d -</td><td align="right">%d</td>', min, max) |
426 | end | 429 | end |
427 | end | 430 | end |
428 | 431 | ||
@@ -476,6 +479,7 @@ if nil == web then C("opening mirrors file - " .. e) else | |||
476 | results = {} | 479 | results = {} |
477 | m = {} | 480 | m = {} |
478 | faulty = "" | 481 | faulty = "" |
482 | bg = '' | ||
479 | web:write( "<hr>\n<h2>==== Debian mirror status ====</h2>\n" .. | 483 | web:write( "<hr>\n<h2>==== Debian mirror status ====</h2>\n" .. |
480 | "<p>NOTE - This is not fully probing the Debian mirrors, we just collect some data from any redirects to other servers. " .. | 484 | "<p>NOTE - This is not fully probing the Debian mirrors, we just collect some data from any redirects to other servers. " .. |
481 | "So this isn't a full set of tests.   Basically we don't know the shape of the Debian mirror infrastructure.</p>\n" .. | 485 | "So this isn't a full set of tests.   Basically we don't know the shape of the Debian mirror infrastructure.</p>\n" .. |
@@ -485,18 +489,19 @@ if nil == web then C("opening mirrors file - " .. e) else | |||
485 | "<th>" .. lnk('DNS round robin', 'DNS-RR') .. "</th><th>" .. lnk('Protocol') .. "</th><th>" .. lnk('URL sanity', 'URL-Sanity') .. "</th><th>" .. lnk('Integrity') .. "</th>" .. | 489 | "<th>" .. lnk('DNS round robin', 'DNS-RR') .. "</th><th>" .. lnk('Protocol') .. "</th><th>" .. lnk('URL sanity', 'URL-Sanity') .. "</th><th>" .. lnk('Integrity') .. "</th>" .. |
486 | "<th>" .. lnk('Updated') .. "</th><th colspan='2'>" .. lnk('Speed range', 'Speed') .. "</th></tr>\n") | 490 | "<th>" .. lnk('Updated') .. "</th><th colspan='2'>" .. lnk('Speed range', 'Speed') .. "</th></tr>\n") |
487 | for k, v in APT.orderedPairs(APT.debians) do | 491 | for k, v in APT.orderedPairs(APT.debians) do |
492 | if '' == bg then bg = " style='background-color:#111111'" else bg = '' end | ||
488 | local results = APT.collateAll(APT.debians, 'results', k) | 493 | local results = APT.collateAll(APT.debians, 'results', k) |
489 | local active = "" | 494 | local active = "" |
490 | if "yes" == v.Active then | 495 | if "yes" == v.Active then |
491 | web:write(" <tr><th>" .. k .. "</th> ") | 496 | web:write(" <tr " .. bg .. "><th>" .. k .. "</th> ") |
492 | else | 497 | else |
493 | if nil == v.Active then active = 'nil' else active = v.Active end | 498 | if nil == v.Active then active = 'nil' else active = v.Active end |
494 | web:write(" <tr style='background-color:dimgrey'><th>" .. k .. "</th> ") | 499 | web:write(" <tr style='background-color:dimgrey'><th>" .. k .. "</th> ") |
495 | end | 500 | end |
496 | local ftp = "[<font color='grey'><b>skip</b></font>]" | 501 | local ftp = "<font color='grey'><b>skip</b></font>" |
497 | local http = status(APT.debians, k, results, "http") | 502 | local http = status(APT.debians, k, results, "http") |
498 | local https = status(APT.debians, k, results, "https") | 503 | local https = status(APT.debians, k, results, "https") |
499 | local rsync = "[<font color='grey'><b>skip</b></font>]" | 504 | local rsync = "<font color='grey'><b>skip</b></font>" |
500 | local dns = "" | 505 | local dns = "" |
501 | local protocol = status(APT.debians, k, results, "Protocol") | 506 | local protocol = status(APT.debians, k, results, "Protocol") |
502 | local sanity = status(APT.debians, k, results, "URLSanity") | 507 | local sanity = status(APT.debians, k, results, "URLSanity") |
@@ -506,7 +511,7 @@ if nil == web then C("opening mirrors file - " .. e) else | |||
506 | if nil ~= rate then updated = updated .. ' ' .. rate end | 511 | if nil ~= rate then updated = updated .. ' ' .. rate end |
507 | local min = tonumber(results.speed.min) | 512 | local min = tonumber(results.speed.min) |
508 | local max = tonumber(results.speed.max) | 513 | local max = tonumber(results.speed.max) |
509 | local spd = '' | 514 | local spd = '<td></td><td></td>' |
510 | 515 | ||
511 | -- DNS-RR test. | 516 | -- DNS-RR test. |
512 | if ("deb.devuan.org" ~= k) and (nil ~= APT.debians["deb.devuan.org"]) then | 517 | 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 | |||
537 | end | 542 | end |
538 | end | 543 | end |
539 | end | 544 | end |
540 | if "" == dns then dns = "[<font color='grey'><b>no</b></font>]" end | 545 | if "" == dns then dns = "<font color='grey'><b>no</b></font>" end |
541 | 546 | ||
542 | if 0 == max then | 547 | if 0 == max then |
543 | spd = '<td></td><td></td>' | 548 | spd = '<td></td><td></td>' |
544 | else | 549 | else |
545 | spd = string.format('<td align="right">%d -></td><td align="right">%d</td>', min, max) | 550 | spd = string.format('<td align="right">%d -</td><td align="right">%d</td>', min, max) |
546 | end | 551 | end |
547 | end | 552 | end |
548 | 553 | ||