(define-module (bffe view agent) #:use-module (srfi srfi-1) #:use-module (bffe view util) #:export (agent)) (define (agent title agent-details) (layout #:title (string-append "Agent " (assoc-ref agent-details "id") " — " title) #:body `((main (dl (dt "Description") (dd ,(assoc-ref agent-details "description")) (dt "Tags") (dd (ul ,@(map (lambda (tag) `(li ,(assoc-ref tag "key") ": " ,(assoc-ref tag "value"))) (vector->list (assoc-ref agent-details "tags"))))) (dt "Allocated builds") (dl (ul ,@(map (lambda (build) `(li (a (@ (href ,(string-append "/build/" (assoc-ref build "uuid")))) ,(assoc-ref build "derivation_name") " (derived priority: " ,(assoc-ref build "derived_priority") ")"))) (vector->list (assoc-ref agent-details "allocated_builds"))))))))))