Skip to content

Commit

Permalink
Add worker info in job_next_previous
Browse files Browse the repository at this point in the history
  • Loading branch information
ggardet committed Jul 25, 2023
1 parent b9e03ab commit 9291233
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
10 changes: 8 additions & 2 deletions assets/javascripts/job_next_previous.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function setupJobNextPrevious() {
paging: true,
ordering: false,
deferRender: true,
columns: [{width: '5%'}, {data: 'result'}, {data: 'build'}, {data: 'finished'}],
columns: [{width: '5%'}, {data: 'result'}, {data: 'build'}, {data: 'assigned_worker'}, {data: 'finished'}],
processing: false,
order: false,
columnDefs: [
Expand All @@ -41,7 +41,8 @@ function setupJobNextPrevious() {
render: renderJobResults
},
{targets: 2, render: renderBuild},
{targets: 3, render: renderFinishTime}
{targets: 3, render: renderWorker},
{targets: 4, render: renderFinishTime}
],
initComplete: function (settings, json) {
setPage(json);
Expand Down Expand Up @@ -119,6 +120,11 @@ function renderBuild(data, type, row) {
return "<a href='" + link + "'>" + row.build + '</a>';
}

function renderWorker(data, type, row) {
var link = '/admin/workers/' + data;
return "<a href='" + link + "'>" + data + '</a>';
}

function renderFinishTime(data, type, row) {
var html = '';
if (data != null) {
Expand Down
1 change: 1 addition & 0 deletions lib/OpenQA/WebAPI/Controller/Test.pm
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@ sub job_next_previous_ajax ($self) {
DT_RowId => 'job_result_' . $job_id,
id => $job_id,
name => $job->name,
assigned_worker => $job->assigned_worker->name,
distri => $job->DISTRI,
version => $job->VERSION,
build => $job->BUILD,
Expand Down
1 change: 1 addition & 0 deletions templates/webapi/test/job_next_previous.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<th></th>
<th>Result</th>
<th>Build</th>
<th>Worker</th>
<th>Finished</th>
</tr>
</thead>
Expand Down

0 comments on commit 9291233

Please sign in to comment.