diff options
Diffstat (limited to 'bffe/view/build.scm')
-rw-r--r-- | bffe/view/build.scm | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/bffe/view/build.scm b/bffe/view/build.scm new file mode 100644 index 0000000..be33467 --- /dev/null +++ b/bffe/view/build.scm @@ -0,0 +1,51 @@ +(define-module (bffe view build) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-19) + #:use-module (ice-9 match) + #:use-module (ice-9 format) + #:use-module (bffe view util) + #:use-module ((guix store) #:select (%store-prefix)) + #:export (build)) + +(define (build title build-details) + (layout + #:title (string-append + "Build " (assoc-ref build-details "uuid") " — " title) + #:body + `((main + (dl + (dt "Derivation") + (dd ,(assoc-ref build-details "derivation-name")) + + (dt "Tags") + (dd (ul + ,@(map (lambda (tag) + `(li ,(assoc-ref tag "key") ": " + ,(assoc-ref tag "value"))) + (vector->list + (assoc-ref build-details "tags"))))) + + (dt "Submitted at") + (dd ,(assoc-ref build-details "created-at")) + + (dt "State") + (dd ,(if (assoc-ref build-details "cancelled") + "Canceled" + (if (assoc-ref build-details "processed") + (if (string=? (assoc-ref + (assoc-ref build-details "result") + "result") + "success") + "Succeeded" + "Failed") + "Pending"))) + + (dt "Priority") + (dd ,(assoc-ref build-details "priority"))) + + ,@(if (assoc-ref build-details "processed") + `((a (@ (href ,(string-append "/build/" + (assoc-ref build-details "uuid") + "/log"))) + "View build log")) + '()))))) |