Files: e9d9dec1d00ff365112ca0f981bbda15e3682528 / test / test-79-npm / checklist.htm
1544 bytesRaw
1 | <!DOCTYPE html> |
2 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us"> |
3 | <head> |
4 | <script src="checklist.js"></script> |
5 | </head><body> |
6 | </body> |
7 | <script> |
8 | |
9 | var add = "<table>"; |
10 | var columns = []; |
11 | add = add + "<tr>"; |
12 | add = add + "<td></td>"; |
13 | |
14 | Object.keys(table).forEach(function(row_key) { |
15 | var row = table[row_key]; |
16 | Object.keys(row).forEach(function(cell_key) { |
17 | if (columns.indexOf(cell_key) < 0) { |
18 | var narrow = cell_key.replace(/\//g, "<br>") |
19 | .replace(/win32/g, "win") |
20 | .replace(/linux/g, "lnx") |
21 | .replace(/darwin/g, "dwn"); |
22 | add = add + "<td>" + narrow + "</td>"; |
23 | columns.push(cell_key); |
24 | } |
25 | }); |
26 | }); |
27 | |
28 | add = add + "</tr>"; |
29 | |
30 | Object.keys(table).forEach(function(row_key) { |
31 | var row = table[row_key]; |
32 | add = add + "<tr>"; |
33 | add = add + "<td>" + row_key + "</td>"; |
34 | columns.forEach(function(column) { |
35 | var cell = row[column]; |
36 | if (typeof cell === "undefined") cell = "n/a"; |
37 | cell = cell.split(",")[0]; |
38 | cell = cell.replace(/error/g, "err"); |
39 | var bcolor = "red"; var fcolor = "white"; |
40 | if (cell === "ok") bcolor = "green"; |
41 | if (cell === "nop") bcolor = "blue"; |
42 | if (cell === "n/a") { cell = "n/a"; bcolor = "white"; fcolor = "black"; } |
43 | var style = "background-color:" + bcolor; |
44 | style = style + ";color:" + fcolor; |
45 | add = add + "<td style='" + style + "'>" + cell + "</td>"; |
46 | }); |
47 | add = add + "</tr>"; |
48 | }); |
49 | |
50 | add = add + "</table>"; |
51 | document.body.innerHTML = add; |
52 | |
53 | </script> |
54 |
Built with git-ssb-web