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:
parent
d96add30a0
commit
e2c9709c7d
|
@ -529,6 +529,12 @@
|
||||||
#:sxml (view-jobs
|
#:sxml (view-jobs
|
||||||
(select-jobs-and-events conn))))
|
(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)
|
(define (parse-commit conn)
|
||||||
(lambda (s)
|
(lambda (s)
|
||||||
(if (guix-commit-exists? conn s)
|
(if (guix-commit-exists? conn s)
|
||||||
|
@ -816,5 +822,9 @@
|
||||||
((GET "jobs")
|
((GET "jobs")
|
||||||
(render-jobs mime-types
|
(render-jobs mime-types
|
||||||
conn))
|
conn))
|
||||||
|
((GET "job" job-id)
|
||||||
|
(render-job mime-types
|
||||||
|
conn
|
||||||
|
job-id))
|
||||||
((GET path ...)
|
((GET path ...)
|
||||||
(not-found (request-uri request)))))
|
(not-found (request-uri request)))))
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
view-derivation
|
view-derivation
|
||||||
view-store-item
|
view-store-item
|
||||||
view-jobs
|
view-jobs
|
||||||
|
view-job
|
||||||
compare
|
compare
|
||||||
compare/derivations
|
compare/derivations
|
||||||
compare/packages
|
compare/packages
|
||||||
|
@ -930,11 +931,12 @@
|
||||||
(tr
|
(tr
|
||||||
(th "Commit")
|
(th "Commit")
|
||||||
(th "Source")
|
(th "Source")
|
||||||
(th "Events")))
|
(th "Events")
|
||||||
|
(th "")))
|
||||||
(tdata
|
(tdata
|
||||||
,@(map (match-lambda
|
,@(map (match-lambda
|
||||||
((id commit source git-repository-id created-at succeeded-at
|
((id commit source git-repository-id created-at succeeded-at
|
||||||
events)
|
events log-exists?)
|
||||||
`(tr
|
`(tr
|
||||||
(@ (class
|
(@ (class
|
||||||
,(let ((event-names
|
,(let ((event-names
|
||||||
|
@ -965,9 +967,30 @@
|
||||||
(cons
|
(cons
|
||||||
`(("event" . "created")
|
`(("event" . "created")
|
||||||
("occurred_at" . ,created-at))
|
("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)))))))))
|
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
|
(define (view-derivation derivation derivation-inputs derivation-outputs
|
||||||
builds)
|
builds)
|
||||||
(layout
|
(layout
|
||||||
|
|
Loading…
Reference in a new issue