2
0
Fork 0
mirror of git://git.savannah.gnu.org/guix/data-service.git synced 2023-12-14 03:23:03 +01:00

Add a job page

Which shows the output for that job.
This commit is contained in:
Christopher Baines 2019-06-22 01:14:57 +02:00
parent d96add30a0
commit e2c9709c7d
2 changed files with 36 additions and 3 deletions

View file

@ -529,6 +529,12 @@
#:sxml (view-jobs
(select-jobs-and-events conn))))
(define (render-job mime-types conn job-id)
(render-html
#:sxml (view-job
job-id
(log-for-job conn job-id))))
(define (parse-commit conn)
(lambda (s)
(if (guix-commit-exists? conn s)
@ -816,5 +822,9 @@
((GET "jobs")
(render-jobs mime-types
conn))
((GET "job" job-id)
(render-job mime-types
conn
job-id))
((GET path ...)
(not-found (request-uri request)))))

View file

@ -41,6 +41,7 @@
view-derivation
view-store-item
view-jobs
view-job
compare
compare/derivations
compare/packages
@ -930,11 +931,12 @@
(tr
(th "Commit")
(th "Source")
(th "Events")))
(th "Events")
(th "")))
(tdata
,@(map (match-lambda
((id commit source git-repository-id created-at succeeded-at
events)
events log-exists?)
`(tr
(@ (class
,(let ((event-names
@ -965,9 +967,30 @@
(cons
`(("event" . "created")
("occurred_at" . ,created-at))
(vector->list events))))))))
(vector->list events)))))
(td
,@(if log-exists?
`((a (@ (href ,(string-append "/job/" id)))
"View log"))
'())))))
jobs-and-events)))))))))
(define (view-job job-id log)
(layout
#:body
`(,(header)
(div
(@ (class "container"))
(div
(@ (class "row"))
(div
(@ (class "col-sm-12"))
(h1 "Job " ,job-id)))
(div
(@ (class "row"))
(div
(pre ,log)))))))
(define (view-derivation derivation derivation-inputs derivation-outputs
builds)
(layout