diff options
author | Christopher Baines <mail@cbaines.net> | 2019-12-15 15:52:11 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2019-12-16 15:19:02 +0000 |
commit | 34b3585b4851f2bf7c3f2ecdc01bc2ea597d0efc (patch) | |
tree | b30ed679ad01c6e786acdddfd5eb9a51c8ce72b8 /guix-data-service/web/revision/html.scm | |
parent | bdcba528fc6c6ba2db6489958229ad94e8ef9ca5 (diff) | |
download | data-service-34b3585b4851f2bf7c3f2ecdc01bc2ea597d0efc.tar data-service-34b3585b4851f2bf7c3f2ecdc01bc2ea597d0efc.tar.gz |
Improve the revision derivation-outputs page
Neaten up the display of the hashes, and add a reproducibility status column.
Diffstat (limited to 'guix-data-service/web/revision/html.scm')
-rw-r--r-- | guix-data-service/web/revision/html.scm | 67 |
1 files changed, 54 insertions, 13 deletions
diff --git a/guix-data-service/web/revision/html.scm b/guix-data-service/web/revision/html.scm index 546538e..ce79f52 100644 --- a/guix-data-service/web/revision/html.scm +++ b/guix-data-service/web/revision/html.scm @@ -21,6 +21,7 @@ #:use-module (texinfo) #:use-module (texinfo html) #:use-module (json) + #:use-module (guix-data-service model utils) #:use-module (guix-data-service web util) #:use-module (guix-data-service web html-utils) #:use-module (guix-data-service web query-parameters) @@ -769,6 +770,7 @@ (define* (view-revision-derivation-outputs commit-hash query-parameters derivation-outputs + build-server-urls show-next-page? #:key (path-base "/revision/") header-text @@ -834,9 +836,9 @@ (@ (class "table")) (thead (tr - (th "Path") - (th "Hash") - (th "Nars"))) + (th (@ (class "col-sm-5")) "Path") + (th (@ (class "col-sm-5")) "Data") + (th (@ (class "col-sm-2")) "Reproducibility Status"))) (tbody ,@(map (match-lambda @@ -845,17 +847,56 @@ (td (a (@ (href ,path)) ,(display-store-item-short path))) (td - ,@(if - (null? hash-algorithm) - '() - `(,hash))) + (dl + ,@(if + (null? hash-algorithm) + (append-map + (match-lambda + ((hash . nars) + `((dt + (a (@ (style "font-family: monospace;") + (href ,(string-append + path "/narinfos"))) + ,hash)) + (dd + (ul + (@ (class "list-inline")) + ,@(map (lambda (nar) + `(li + ,(assq-ref build-server-urls + (assoc-ref nar "build_server_id")))) + nars)))))) + (group-to-alist + (lambda (nar) + (cons (assoc-ref nar "hash") + nar)) + (vector->list nars))) + `(,hash)))) (td - ,@(map (lambda (nar) - `(div - ,(assoc-ref nar "build_server_id") - " " - ,(assoc-ref nar "hash"))) - (vector->list nars)))))) + ,(let* ((hashes + (delete-duplicates + (map (lambda (nar) + (assoc-ref nar "hash")) + (vector->list nars)))) + (build-servers + (delete-duplicates + (map (lambda (nar) + (assoc-ref nar "build_server_id")) + (vector->list nars)))) + (hash-count + (length hashes)) + (build-server-count + (length build-servers))) + (cond + ((or (eq? hash-count 0) + (eq? build-server-count 1)) + "Unknown") + ((eq? hash-count 1) + '(span (@ (class "text-success")) + "Reproducible")) + ((> hash-count 1) + '(span (@ (class "text-danger")) + "Unreproducible")))))))) derivation-outputs))) ,@(if show-next-page? `((div |