Skip to content

Commit 4974eae

Browse files
committed
ui: device: render basic device info and stability
Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 60e60d7 commit 4974eae

File tree

2 files changed

+123
-2
lines changed

2 files changed

+123
-2
lines changed

ui/devices.html

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,22 @@
1919
<div>
2020
<h2>Device test results</h2>
2121
<div>
22-
<p>Starting with Linux v6.12 (October 2024) all officially <i>supported</i> NIC drivers in Linux will be required to be continuously tested.</p>
22+
<p>Starting with Linux v6.12 (October 2024) all officially <i>supported</i> NIC drivers in Linux are required to be continuously tested.</p>
2323
<p>See the <a href="https://lore.kernel.org/all/[email protected]/">announcement</a> on the mailing list.</p>
24-
<p style="font-weight: bold;">No results have been reported so far.</p>
24+
</div>
25+
</div>
26+
<div class="row">
27+
<div class="column">
28+
<h3>Latest device info</h3>
29+
<table id="device_info">
30+
</table>
31+
</div>
32+
</div>
33+
<div class="row">
34+
<div class="column">
35+
<h3>Test case status</h3>
36+
<table id="stability">
37+
</table>
2538
</div>
2639
</div>
2740
</body>

ui/devices.js

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,111 @@
1+
let xfr_todo = 2;
2+
let dev_info = null;
3+
let stability = null;
4+
5+
function load_tables()
6+
{
7+
// Turn stability into matrix by executor
8+
let rn_seen = new Set();
9+
let tn_db = [];
10+
let sta_db = {};
11+
12+
for (ste of stability) {
13+
let tn = ste.grp + ':' + ste.test + ':' + ste.subtest;
14+
if (ste.subtest == null)
15+
tn = ste.grp + ':' + ste.test + ':';
16+
let rn = ste.remote + ste.executor;
17+
18+
if (!(tn in sta_db)) {
19+
sta_db[tn] = {};
20+
tn_db.push(tn);
21+
}
22+
23+
sta_db[tn][rn] = ste;
24+
rn_seen.add(rn);
25+
}
26+
27+
// Simple sort by name
28+
tn_db.sort();
29+
30+
// Render device info
31+
let display_names = {};
32+
let dev_table = document.getElementById("device_info");
33+
34+
for (dev of dev_info) {
35+
let rn = dev.remote + dev.executor;
36+
if (!rn_seen.has(rn))
37+
continue;
38+
39+
let row = dev_table.insertRow();
40+
41+
row.insertCell(0).innerText = dev.remote;
42+
row.insertCell(1).innerText = dev.executor;
43+
44+
const info = JSON.parse(dev.info);
45+
const driver = info.driver;
46+
row.insertCell(2).innerText = driver;
47+
48+
delete info.driver;
49+
const versions = JSON.stringify(info);
50+
row.insertCell(3).innerText = versions;
51+
52+
display_names[dev.remote + dev.executor] =
53+
dev.remote + '<br />' + dev.executor + '<br />' + driver;
54+
}
55+
56+
// Create headers
57+
let sta_tb = document.getElementById("stability");
58+
59+
const hdr = sta_tb.createTHead().insertRow();
60+
hdr.insertCell().innerText = 'Group';
61+
hdr.insertCell().innerText = 'Test';
62+
hdr.insertCell().innerText = 'Subtest';
63+
for (rn of Object.keys(display_names)) {
64+
let cell = hdr.insertCell();
65+
66+
cell.innerHTML = display_names[rn];
67+
cell.setAttribute("style", "writing-mode: tb-rl;");
68+
}
69+
70+
// Display
71+
for (tn of tn_db) {
72+
let row = sta_tb.insertRow();
73+
74+
row.insertCell(0).innerText = tn.split(':')[0];
75+
row.insertCell(1).innerText = tn.split(':')[1];
76+
let cell = row.insertCell(2);
77+
if (tn.split(':').length == 3)
78+
cell.innerText = tn.split(':')[2];
79+
80+
let i = 3;
81+
for (rn of Object.keys(display_names)) {
82+
cell = row.insertCell(i++);
83+
if (rn in sta_db[tn]) {
84+
let ste = sta_db[tn][rn];
85+
86+
if (ste.passing)
87+
cell.setAttribute("class", "box-pass");
88+
else
89+
cell.setAttribute("class", "box-skip");
90+
}
91+
}
92+
}
93+
}
94+
195
function do_it()
296
{
97+
$(document).ready(function() {
98+
$.get("query/device-info", function(data_raw) {
99+
dev_info = data_raw;
100+
if (!--xfr_todo)
101+
load_tables();
102+
})
103+
});
104+
$(document).ready(function() {
105+
$.get("query/stability?auto=1", function(data_raw) {
106+
stability = data_raw;
107+
if (!--xfr_todo)
108+
load_tables();
109+
})
110+
});
3111
}

0 commit comments

Comments
 (0)