Add a "plain" view for derivations

This commit is contained in:
Christopher Baines 2019-12-26 09:04:53 +00:00
parent 16879a8182
commit 43013fc16b
2 changed files with 20 additions and 2 deletions

View File

@ -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" _ ...)

View File

@ -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