From 9291233a441758209e28b01c74cab9ca8fbeac54 Mon Sep 17 00:00:00 2001 From: Guillaume Gardet Date: Wed, 1 Feb 2023 10:14:14 +0100 Subject: [PATCH] Add worker info in job_next_previous --- assets/javascripts/job_next_previous.js | 10 ++++++++-- lib/OpenQA/WebAPI/Controller/Test.pm | 1 + templates/webapi/test/job_next_previous.html.ep | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/assets/javascripts/job_next_previous.js b/assets/javascripts/job_next_previous.js index 929a18928646..c198413d83e7 100644 --- a/assets/javascripts/job_next_previous.js +++ b/assets/javascripts/job_next_previous.js @@ -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: [ @@ -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); @@ -119,6 +120,11 @@ function renderBuild(data, type, row) { return "" + row.build + ''; } +function renderWorker(data, type, row) { + var link = '/admin/workers/' + data; + return "" + data + ''; +} + function renderFinishTime(data, type, row) { var html = ''; if (data != null) { diff --git a/lib/OpenQA/WebAPI/Controller/Test.pm b/lib/OpenQA/WebAPI/Controller/Test.pm index 8c00c4bf535e..846580214c85 100644 --- a/lib/OpenQA/WebAPI/Controller/Test.pm +++ b/lib/OpenQA/WebAPI/Controller/Test.pm @@ -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, diff --git a/templates/webapi/test/job_next_previous.html.ep b/templates/webapi/test/job_next_previous.html.ep index 6a693f7427d7..1d0751434f3a 100644 --- a/templates/webapi/test/job_next_previous.html.ep +++ b/templates/webapi/test/job_next_previous.html.ep @@ -42,6 +42,7 @@ Result Build + Worker Finished