/
generated.go
248 lines (209 loc) · 4.03 KB
/
generated.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
package html
const style = `
#topbar {
padding: 5px 10px;
background: #E0EBF5;
}
#topbar a {
color: #375EAB;
text-decoration: none;
}
h1, h2, h3, h4 {
margin: 0;
padding: 0;
color: #375EAB;
font-weight: bold;
}
table {
border: 1px solid #ccc;
margin: 20px 5px;
border-collapse: collapse;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
table caption {
font-weight: bold;
}
table td, table th {
vertical-align: top;
padding: 2px 8px;
text-overflow: ellipsis;
overflow: hidden;
}
.namespace {
font-weight: bold;
font-size: large;
color: #375EAB;
}
.position_table {
border: 0px;
margin: 0px;
width: 100%;
border-collapse: collapse;
}
.position_table td, .position_table tr {
vertical-align: center;
padding: 0px;
}
.position_table .search {
text-align: right;
}
.list_table td, .list_table th {
border-left: 1px solid #ccc;
}
.list_table th {
background: #F4F4F4;
}
.list_table tr:nth-child(2n) {
background: #F4F4F4;
}
.list_table tr:hover {
background: #ffff99;
}
.list_table .namespace {
width: 100pt;
max-width: 100pt;
}
.list_table .title {
width: 350pt;
max-width: 350pt;
}
.list_table .commit_list {
width: 500pt;
max-width: 500pt;
}
.list_table .tag {
font-family: monospace;
font-size: 8pt;
width: 40pt;
max-width: 40pt;
}
.list_table .opts {
width: 40pt;
max-width: 40pt;
}
.list_table .status {
width: 250pt;
max-width: 250pt;
}
.list_table .patched {
width: 60pt;
max-width: 60pt;
text-align: center;
}
.list_table .kernel {
width: 80pt;
max-width: 80pt;
}
.list_table .maintainers {
width: 150pt;
max-width: 150pt;
}
.list_table .result {
width: 60pt;
max-width: 60pt;
}
.list_table .stat {
width: 55pt;
max-width: 55pt;
font-family: monospace;
text-align: right;
}
.list_table .date {
width: 60pt;
max-width: 60pt;
font-family: monospace;
text-align: right;
}
.list_table .stat_name {
width: 150pt;
max-width: 150pt;
font-family: monospace;
}
.list_table .stat_value {
width: 120pt;
max-width: 120pt;
font-family: monospace;
}
.bad {
color: #f00;
font-weight: bold;
}
.inactive {
color: #888;
}
.plain {
text-decoration: none;
}
textarea {
width:100%;
font-family: monospace;
}
.mono {
font-family: monospace;
}
.info_link {
color: #25a7db;
text-decoration: none;
}
`
const js = `
// Copyright 2018 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
function sortTable(item, colName, conv, desc = false) {
table = item.parentNode.parentNode.parentNode.parentNode;
rows = table.rows;
col = findColumnByName(rows[0].getElementsByTagName("th"), colName);
values = [];
for (i = 1; i < rows.length; i++)
values.push([conv(rows[i].getElementsByTagName("td")[col].textContent), rows[i]]);
if (desc)
desc = !isSorted(values.slice().reverse())
else
desc = isSorted(values);
values.sort(function(a, b) {
if (a[0] == b[0]) return 0;
if (desc && a[0] > b[0] || !desc && a[0] < b[0]) return -1;
return 1;
});
for (i = 0; i < values.length; i++)
table.tBodies[0].appendChild(values[i][1]);
return false;
}
function findColumnByName(headers, colName) {
for (i = 0; i < headers.length; i++) {
if (headers[i].textContent == colName)
return i;
}
return 0;
}
function isSorted(values) {
for (i = 0; i < values.length - 1; i++) {
if (values[i][0] > values[i + 1][0])
return false;
}
return true;
}
function textSort(v) { return v.toLowerCase(); }
function numSort(v) { return -parseInt(v); }
function floatSort(v) { return -parseFloat(v); }
function reproSort(v) { return v == "C" ? 0 : v == "syz" ? 1 : 2; }
function patchedSort(v) { return v == "" ? -1 : parseInt(v); }
function timeSort(v) {
if (v == "now")
return 0;
m = v.indexOf('m');
h = v.indexOf('h');
d = v.indexOf('d');
if (m > 0 && h < 0)
return parseInt(v);
if (h > 0 && m > 0)
return parseInt(v) * 60 + parseInt(v.substring(h + 1));
if (d > 0 && h > 0)
return parseInt(v) * 60 * 24 + parseInt(v.substring(d + 1)) * 60;
if (d > 0)
return parseInt(v) * 60 * 24;
return 1000000000;
}
`