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-02 13:33:58 +0100
commit8337c05c79ebfd76790f9e5abf884044f063edc8 (patch)
treedaaf6c3171a65da662c81002501338cc2e8e0b37
parent1405509e0332656ed5f9388d67312a4fa7b8fee0 (diff)
downloaddata-service-8337c05c79ebfd76790f9e5abf884044f063edc8.tar
data-service-8337c05c79ebfd76790f9e5abf884044f063edc8.tar.gz
WIP 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"))