aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-12-02 13:33:28 +0100
committerChristopher Baines <mail@cbaines.net>2019-12-12 20:07:22 +0000
commite078b9611daabe6fd939a39e6549c0c75fffd1b7 (patch)
tree1c73e3b58bb4c26a7ef6a99cb443264ab8895d51
parent8e5f8e4170dcb011d94d64316431ae44cb46769f (diff)
downloaddata-service-e078b9611daabe6fd939a39e6549c0c75fffd1b7.tar
data-service-e078b9611daabe6fd939a39e6549c0c75fffd1b7.tar.gz
Include nars on the output page
-rw-r--r--guix-data-service/web/controller.scm4
-rw-r--r--guix-data-service/web/view/html.scm50
2 files changed, 52 insertions, 2 deletions
diff --git a/guix-data-service/web/controller.scm b/guix-data-service/web/controller.scm
index 433e34c..a4c5dfb 100644
--- a/guix-data-service/web/controller.scm
+++ b/guix-data-service/web/controller.scm
@@ -187,7 +187,9 @@
((file-name output-id rest ...)
(select-derivations-using-output
conn output-id))))
- derivations)))))))
+ derivations)
+ (select-nars-for-output conn
+ filename)))))))
(define handle-static-assets
(if assets-dir-in-store?
diff --git a/guix-data-service/web/view/html.scm b/guix-data-service/web/view/html.scm
index 84c35b8..753cb24 100644
--- a/guix-data-service/web/view/html.scm
+++ b/guix-data-service/web/view/html.scm
@@ -435,7 +435,10 @@
,(string-append
"/" (string-join fileparts "/"))))))
-(define (view-store-item filename derivations derivations-using-store-item-list)
+(define (view-store-item filename
+ derivations
+ derivations-using-store-item-list
+ nars)
(layout
#:body
`(,(header)
@@ -446,6 +449,51 @@
(div
(@ (class "col-sm-12"))
,(display-store-item-title filename)))
+ (div
+ (@ (class "row"))
+ (div
+ (@ (class "col-sm-12"))
+ (h2 "Nars")
+ (a (@ (class "btn btn-default btn-lg pull-right")
+ (href ,(string-append filename "/narinfos")))
+ "View narinfo details")
+ ,@(map
+ (match-lambda
+ ((hash-algorithm hash size urls signatures)
+ `(div
+ (h4 (@ (style "font-family: monospace;"))
+ ,hash)
+ (table
+ (@ (class "table")
+ (style "table-layout: fixed;"))
+ (thead
+ (tr
+ (th (@ (class "col-sm-1")) "Size")
+ (th (@ (class "col-sm-4")) "Urls")))
+ (tbody
+ (td ,size)
+ (td
+ (ul
+ ,@(map
+ (lambda (url-details)
+ `(li
+ "Size: " ,(assoc-ref url-details "size")
+ " Compression: " ,(assoc-ref url-details "compression")
+ " "
+ (a (@ (href ,(assoc-ref url-details "url")))
+ ,(assoc-ref url-details "url"))))
+ urls)))
+ (td
+ ,@(map
+ (lambda (signature)
+ `(dl
+ (@ (class "dl-horizontal"))
+ (dt "Version")
+ (dd ,(assoc-ref signature "version"))
+ (dt "Host name")
+ (dd ,(assoc-ref signature "host_name"))))
+ signatures)))))))
+ nars)))
,@(map (lambda (derivation derivations-using-store-item)
`((div
(@ (class "row"))