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) #:minimum-builds (assq-ref query-parameters 'minimum_builds)
#:limit-results limit-results #:limit-results limit-results
#:after-name (assq-ref query-parameters 'after_name))) #: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? (show-next-page?
(if all-results (if all-results
#f #f
@ -656,6 +662,7 @@
query-parameters query-parameters
(valid-systems conn) (valid-systems conn)
derivations derivations
build-server-urls
show-next-page? show-next-page?
#:path-base path-base #:path-base path-base
#:header-text header-text #:header-text header-text

View file

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