blob: e210402e3269e3b70d299eb6604f438bebba745c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
(define-module (bffe view agent)
#: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 (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"))))))))))
|