Skip to content

Commit eecf03f

Browse files
olichtnejpirko
authored andcommitted
result_xslt: updated with new information from result xml
This patch updates the XSLT transformation schme to reflect the new information available in result xmls. This means that the HTML files now also contain the information about the match number and what pool match was used. In addition to that the formatting and functionality was updated. To make it easier to look at each command (command description and result data) now has a border, the start of a new Task is highlighted. There is now a button to show/hide result data of commands. Commands that don't have any result data don't have this button and instead show a note saying that no result data was returned. In case of background commands that return their result data in a corresponding wait/intr/kill command I added a highlight button that highlights this command, to make it easier to find. This patch breaks backwards compatibility and result html files generated before this patch will now be displayed correctly. To fix this you can download the old .css and .js files and fix the html file to reference those instead. Signed-off-by: Ondrej Lichtner <[email protected]> Signed-off-by: Jiri Pirko <[email protected]>
1 parent c761acc commit eecf03f

File tree

3 files changed

+313
-214
lines changed

3 files changed

+313
-214
lines changed

Diff for: result_xslt/xml_to_html.css

+42
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
table{
2+
border-collapse: collapse;
3+
}
4+
5+
table.lnst_results {
6+
border: 1px solid black;
7+
}
8+
19
table.lnst_results td {
210
padding: 0px 10px 0px 10px;
311
}
@@ -14,10 +22,44 @@ table.result_data td{
1422
vertical-align: top;
1523
}
1624

25+
tr.tr_top{
26+
border-top: 1px solid black;
27+
border-left: 1px solid black;
28+
border-right: 1px solid black;
29+
}
30+
31+
tr.tr_bottom{
32+
border-bottom: 1px solid black;
33+
border-left: 1px solid black;
34+
border-right: 1px solid black;
35+
}
36+
1737
td.result_pass{
1838
background-color: lime;
1939
}
2040

2141
td.result_fail{
2242
background-color: red;
2343
}
44+
45+
tr.task_header{
46+
background-color: gray;
47+
}
48+
49+
td.button{
50+
vertical-align: top;
51+
}
52+
53+
.match_description, .match_description th, .match_description td{
54+
border: 1px solid black;
55+
text-align: center;
56+
border-collapse: collapse;
57+
padding: 5px 10px 5px 10px;
58+
}
59+
60+
.if_match_description{
61+
border: 1px solid black;
62+
text-align: center;
63+
border-collapse: collapse;
64+
padding: 0px 10px 0px 10px;
65+
}

Diff for: result_xslt/xml_to_html.js

+34-9
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,46 @@
11
window.toggleResultData = function (event, task_id, bg_id) {
22
switch_display = function(elem){
3-
if (elem.style.display == 'none')
3+
if (elem.style.display == 'none'){
44
elem.style.display = '';
5-
else
5+
}else{
66
elem.style.display = 'none';
7+
}
8+
}
9+
10+
cell = event.target.parentNode;
11+
row = cell.parentNode;
12+
result_cell_i = cell.cellIndex + 2;
13+
result_cell = row.cells[result_cell_i];
14+
switch_display(result_cell);
15+
16+
if (task_id !== undefined && bg_id !== undefined){
17+
rows = row.parentNode.rows;
18+
for (i = 0; i < rows.length; ++i){
19+
if (rows[i].name == ("task_id="+task_id+"bg_id="+bg_id)){
20+
switch_display(rows[i].cells[2]);
21+
}
22+
}
23+
}
24+
}
25+
26+
window.highlightResultData = function (event, task_id, bg_id) {
27+
switch_background = function(elem){
28+
if (elem.style.background == ''){
29+
elem.style.background = 'lightblue';
30+
}else{
31+
elem.style.background = '';
32+
}
733
}
834

9-
row = event.target.parentNode;
10-
result_row_i = row.rowIndex + 1;
11-
result_row = row.parentNode.rows[result_row_i];
12-
switch_display(result_row);
35+
cell = event.target.parentNode;
36+
row = cell.parentNode;
1337

1438
if (task_id !== undefined && bg_id !== undefined){
15-
rows = row.parentNode.childNodes;
39+
rows = row.parentNode.rows;
1640
for (i = 0; i < rows.length; ++i){
17-
if (rows[i].id == ("task_id="+task_id+"bg_id="+bg_id))
18-
rows[i].style.display = result_row.style.display;
41+
if (rows[i].getAttribute("name") == ("task_id="+task_id+"bg_id="+bg_id)){
42+
switch_background(rows[i]);
43+
}
1944
}
2045
}
2146
}

0 commit comments

Comments
 (0)