diff options
Diffstat (limited to '')
-rwxr-xr-x | apt-panopticon-report-email-web.lua | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/apt-panopticon-report-email-web.lua b/apt-panopticon-report-email-web.lua index a9852c1..b21ba8a 100755 --- a/apt-panopticon-report-email-web.lua +++ b/apt-panopticon-report-email-web.lua | |||
@@ -51,15 +51,18 @@ local status = function(hosts, host, results, typ) | |||
51 | local e = 0 | 51 | local e = 0 |
52 | local w = 0 | 52 | local w = 0 |
53 | local t = 0 | 53 | local t = 0 |
54 | local d = 0 | ||
54 | local s = nil ~= hosts[host].Protocols[typ] | 55 | local s = nil ~= hosts[host].Protocols[typ] |
55 | local to = results.timeout | 56 | local to = results.timeout |
56 | if not APT.search(APT.protocols, typ) then s = true end | 57 | if not APT.search(APT.protocols, typ) then s = true end |
57 | if nil ~= results[typ] then | 58 | if nil ~= results[typ] then |
59 | d = results[typ].tested | ||
58 | e = results[typ].errors | 60 | e = results[typ].errors |
59 | w = results[typ].warnings | 61 | w = results[typ].warnings |
60 | t = results[typ].timeouts | 62 | t = results[typ].timeouts |
61 | for k, v in pairs(results[typ]) do | 63 | for k, v in pairs(results[typ]) do |
62 | if ("table" == type(v)) and ('redirects' ~= k) then | 64 | if ("table" == type(v)) and ('redirects' ~= k) then |
65 | if 0 <= v.tested then d = d + v.tested else to = true end | ||
63 | if 0 <= v.errors then e = e + v.errors else to = true end | 66 | if 0 <= v.errors then e = e + v.errors else to = true end |
64 | if 0 <= v.warnings then w = w + v.warnings else to = true end | 67 | if 0 <= v.warnings then w = w + v.warnings else to = true end |
65 | if 0 <= v.timeouts then t = t + v.timeouts else to = true end | 68 | if 0 <= v.timeouts then t = t + v.timeouts else to = true end |
@@ -71,6 +74,7 @@ local status = function(hosts, host, results, typ) | |||
71 | for i, u in pairs(v) do | 74 | for i, u in pairs(v) do |
72 | if "table" == type(u) then | 75 | if "table" == type(u) then |
73 | if typ == i then | 76 | if typ == i then |
77 | if 0 <= u.tested then d = d + u.tested end | ||
74 | if 0 <= u.errors then e = e + u.errors end | 78 | if 0 <= u.errors then e = e + u.errors end |
75 | if 0 <= u.warnings then w = w + u.warnings end | 79 | if 0 <= u.warnings then w = w + u.warnings end |
76 | if 0 <= u.timeouts then t = t + u.timeouts end | 80 | if 0 <= u.timeouts then t = t + u.timeouts end |
@@ -111,7 +115,7 @@ local status = function(hosts, host, results, typ) | |||
111 | else | 115 | else |
112 | faulty = faulty .. host .. " (" .. typ .. ")\n" | 116 | faulty = faulty .. host .. " (" .. typ .. ")\n" |
113 | end | 117 | end |
114 | else | 118 | elseif 0 < d then |
115 | result = "OK" | 119 | result = "OK" |
116 | if not s then result = result .. "*" end | 120 | if not s then result = result .. "*" end |
117 | if APT.html then | 121 | if APT.html then |
@@ -121,6 +125,16 @@ local status = function(hosts, host, results, typ) | |||
121 | result = "<font color='darkgreen'><b>OK*</b></font>" | 125 | result = "<font color='darkgreen'><b>OK*</b></font>" |
122 | end | 126 | end |
123 | end | 127 | end |
128 | else | ||
129 | result = "untested" | ||
130 | if not s then result = result .. "*" end | ||
131 | if APT.html then | ||
132 | if s then | ||
133 | result = "<font color='grey'><b>untested</b></font>" | ||
134 | else | ||
135 | result = "<font color='dimgrey'><b>untested*</b></font>" | ||
136 | end | ||
137 | end | ||
124 | end | 138 | end |
125 | return result .. APT.plurals(e, w, t) | 139 | return result .. APT.plurals(e, w, t) |
126 | end | 140 | end |