Simplify the derivations page display

Displaing the outputs didn't add much, so focus on neatly displaying the
builds.
This commit is contained in:
Christopher Baines 2019-12-16 20:18:34 +00:00
parent 3305d85ef0
commit dc82112bf8
2 changed files with 36 additions and 50 deletions

View file

@ -639,6 +639,12 @@
#:minimum-builds (assq-ref query-parameters 'minimum_builds)
#:limit-results limit-results
#:after-name (assq-ref query-parameters 'after_name)))
(build-server-urls
(group-to-alist
(match-lambda
((id url lookup-all-derivations)
(cons id url)))
(select-build-servers conn)))
(show-next-page?
(if all-results
#f
@ -656,6 +662,7 @@
query-parameters
(valid-systems conn)
derivations
build-server-urls
show-next-page?
#:path-base path-base
#:header-text header-text

View file

@ -862,6 +862,7 @@ figure {
query-parameters
valid-systems
derivations
build-server-urls
show-next-page?
#:key (path-base "/revision/")
header-text
@ -941,22 +942,6 @@ figure {
,@(map
(match-lambda
((file-name system target builds outputs)
(let ((build-server-ids
(sort
(delete-duplicates
(append
(map (lambda (build)
(assoc-ref build "build_server_id"))
(vector->list builds))
(append-map
(lambda (output)
(map (lambda (nar)
(assoc-ref nar "build_server_id"))
(vector->list
(or (assoc-ref output "nars")
#()))))
(vector->list outputs))))
<)))
`(tr
(td (a (@ (href ,file-name))
,(display-store-item-short file-name)))
@ -964,33 +949,27 @@ figure {
,system)
(td (@ (style "font-family: monospace;"))
,target)
(td ,@(map
(lambda (build-server-id)
`(div
,@(map build-status-alist->build-icon
(filter
(td
(dl
,@(append-map
(lambda (build)
(eq? build-server-id
(let ((build-server-id
(assoc-ref build "build_server_id")))
(vector->list builds)))
,@(map (lambda (output)
`(div
"Output: " ,(assoc-ref output "output_name")
,@(map (lambda (nar)
`(div
`((dt
(@ (style "font-weight: unset;"))
(a (@ (href
,(assoc-ref output "output_path")))
"Build server "
,(assoc-ref nar "build_server_id"))))
(filter
(lambda (nar)
(eq? build-server-id
(assoc-ref nar "build_server_id")))
(vector->list
(or (assoc-ref output "nars")
#()))))))
(vector->list outputs))))
build-server-ids))))))
,(assq-ref build-server-urls
build-server-id)))
,(assq-ref build-server-urls
build-server-id)))
(dd
(a (@ (href
,(simple-format
#f "/build-server/~A/build?derivation_file_name=~A"
build-server-id
file-name)))
,(build-status-alist->build-icon build))))))
(vector->list builds)))))))
derivations)))
,@(if show-next-page?
`((div