Skip to content

Commit

Permalink
RunID is now linked if available in Status
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneTR committed Oct 30, 2023
1 parent 226e6f5 commit da20d95
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,9 +540,10 @@ async def get_timeline_projects():
async def get_jobs():
# Do not get the email jobs as they do not need to be display in the frontend atm
query = """
SELECT j.id, j.name, j.url, j.filename, j.branch, m.description, j.state, j.updated_at, j.created_at
SELECT j.id, r.id as run_id, j.name, j.url, j.filename, j.branch, m.description, j.state, j.updated_at, j.created_at
FROM jobs as j
LEFT JOIN machines as m on m.id = j.machine_id
LEFT JOIN runs as r on r.job_id = j.id
ORDER BY j.updated_at DESC, j.created_at ASC
"""
data = DB().fetch_all(query)
Expand Down
16 changes: 8 additions & 8 deletions frontend/js/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ $(document).ready(function () {
ajax: `${API_URL}/v1/jobs`,
columns: [
{ data: 0, title: 'ID'},
{ data: 1, title: 'Name'},
{ data: 2, title: 'Url'},
{ data: 3, title: 'Filename'},
{ data: 4, title: 'Branch'},
{ data: 5, title: 'Machine'},
{ data: 6, title: 'State'},
{ data: 7, title: 'Last Update', render: (data) => data == null ? '-' : dateToYMD(new Date(data)) },
{ data: 8, title: 'Created at', render: (data) => data == null ? '-' : dateToYMD(new Date(data)) },
{ data: 2, title: 'Name', render: (name, type, row) => row[1] == null ? name : `<a href="/stats.html?id=${row[1]}">${name}</a>` },
{ data: 3, title: 'Url'},
{ data: 4, title: 'Filename'},
{ data: 5, title: 'Branch'},
{ data: 6, title: 'Machine'},
{ data: 7, title: 'State'},
{ data: 8, title: 'Last Update', render: (el) => el == null ? '-' : dateToYMD(new Date(el)) },
{ data: 9, title: 'Created at', render: (el) => el == null ? '-' : dateToYMD(new Date(el)) },
],
deferRender: true,
order: [[7, 'desc']] // API also orders, but we need to indicate order for the user
Expand Down

0 comments on commit da20d95

Please sign in to comment.