aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-12-26 09:04:53 +0000
committerChristopher Baines <mail@cbaines.net>2019-12-26 09:04:53 +0000
commit43013fc16b76beb5d7c4a0e527fab4b201324850 (patch)
treef4030d6ef39c0ed34d0082bee25d8437e8c14a77
parent16879a81829a563d1bf0e0529d47f665b0ed9ada (diff)
downloaddata-service-43013fc16b76beb5d7c4a0e527fab4b201324850.tar
data-service-43013fc16b76beb5d7c4a0e527fab4b201324850.tar.gz
Add a "plain" view for derivations
-rw-r--r--guix-data-service/web/controller.scm10
-rw-r--r--guix-data-service/web/view/html.scm12
2 files changed, 20 insertions, 2 deletions
diff --git a/guix-data-service/web/controller.scm b/guix-data-service/web/controller.scm
index a4c5dfb..3f35304 100644
--- a/guix-data-service/web/controller.scm
+++ b/guix-data-service/web/controller.scm
@@ -307,6 +307,16 @@
(render-formatted-derivation conn
(string-append "/gnu/store/" filename))
(not-found (request-uri request))))
+ (('GET "gnu" "store" filename "plain")
+ (if (string-suffix? ".drv" filename)
+ (let ((raw-drv
+ (select-serialized-derivation-by-file-name
+ conn
+ (string-append "/gnu/store/" filename))))
+ (if raw-drv
+ (render-text raw-drv)
+ (not-found (request-uri request))))
+ (not-found (request-uri request))))
(('GET "gnu" "store" filename "narinfos")
(render-narinfos conn filename))
(((or 'GET 'POST) "build-server" _ ...)
diff --git a/guix-data-service/web/view/html.scm b/guix-data-service/web/view/html.scm
index 8375d0b..c0df5cb 100644
--- a/guix-data-service/web/view/html.scm
+++ b/guix-data-service/web/view/html.scm
@@ -536,7 +536,11 @@
(a (@ (class "btn btn-lg btn-default")
(href ,(string-append file-name "/formatted"))
(role "button"))
- "Formatted view"))))))
+ "Formatted view")
+ (a (@ (class "btn btn-lg btn-default")
+ (href ,(string-append file-name "/plain"))
+ (role "button"))
+ "Plain view"))))))
(div
(@ (class "row"))
(div
@@ -640,7 +644,11 @@
(a (@ (class "btn btn-lg btn-default disabled")
(href ,(string-append file-name "/formatted"))
(role "button"))
- "Formatted view"))))))
+ "Formatted view")
+ (a (@ (class "btn btn-lg btn-default")
+ (href ,(string-append file-name "/plain"))
+ (role "button"))
+ "Plain view"))))))
(div
(@ (class "row"))
(div