Skip to content

Commit

Permalink
contest: ui: switch to real results
Browse files Browse the repository at this point in the history
Switch away from the results generated by faker to the real ones.

Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
kuba-moo committed Jan 7, 2024
1 parent 4acff62 commit 16923ce
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
20 changes: 12 additions & 8 deletions contest/contest.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@ function load_result_table(data_raw)
{
var table = document.getElementById("results");

$.each(data_raw, function(i, v) {
v.start = new Date(v.start);
v.end = new Date(v.end);
});

data_raw.sort(function(a, b){return b.end - a.end;});

$.each(data_raw, function(i, v) {
$.each(v.results, function(j, r) {
var row = table.insertRow();

var date = row.insertCell(0);
Expand All @@ -26,15 +32,13 @@ function load_result_table(data_raw)
var test = row.insertCell(5);
var res = row.insertCell(6);

dt = new Date(v.end);
date.innerHTML = dt.toLocaleString();
date.innerHTML = v.end.toLocaleString();
branch.innerHTML = v.branch;
remote.innerHTML = v.remote;
exe.innerHTML = v.executor;
group.innerHTML = r.group;
test.innerHTML = r.test;
res.innerHTML = colorify_str(r.result);
});
group.innerHTML = v.group;
test.innerHTML = "<a href=\"" + v.link + "\">" + v.test + "</a>";
res.innerHTML = colorify_str(v.result);
});
}

Expand All @@ -46,6 +50,6 @@ function results_doit(data_raw)
function do_it()
{
$(document).ready(function() {
$.get("static/nipa/results.json", results_doit)
$.get("contest/all-results.json", results_doit)
});
}
1 change: 1 addition & 0 deletions contest/results-fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def build_combined(config, remote_db):
row = {}
for k in ['executor', 'branch', 'start', 'end']:
row[k] = data[k]
row['remote'] = name
row.update(test)
combined.append(row)
return combined
Expand Down

0 comments on commit 16923ce

Please sign in to comment.