mirror of
git://git.savannah.gnu.org/guix/data-service.git
synced 2023-12-14 03:23:03 +01:00
Implement the JSON response for the package derivations page
This commit is contained in:
parent
68420b1085
commit
7a7dedfa1b
|
@ -767,7 +767,26 @@
|
|||
mime-types)
|
||||
((application/json)
|
||||
(render-json
|
||||
`()))
|
||||
`((derivations . ,(list->vector
|
||||
(map (match-lambda
|
||||
((derivation system target)
|
||||
`((derivation . ,derivation)
|
||||
,@(if (member "system" fields)
|
||||
`((system . ,system))
|
||||
'())
|
||||
,@(if (member "target" fields)
|
||||
`((target . ,target))
|
||||
'())))
|
||||
((derivation system target builds)
|
||||
`((derivation . ,derivation)
|
||||
,@(if (member "system" fields)
|
||||
`((system . ,system))
|
||||
'())
|
||||
,@(if (member "target" fields)
|
||||
`((target . ,target))
|
||||
'())
|
||||
(builds . ,builds))))
|
||||
derivations))))))
|
||||
(else
|
||||
(render-html
|
||||
#:sxml (view-revision-package-derivations
|
||||
|
|
|
@ -1127,6 +1127,19 @@ figure {
|
|||
(button (@ (type "submit")
|
||||
(class "btn btn-lg btn-primary"))
|
||||
"Update results")))))))
|
||||
(div
|
||||
(@ (class "row"))
|
||||
(div
|
||||
(@ (class "col-sm-12"))
|
||||
(a (@ (class "btn btn-default btn-lg pull-right")
|
||||
(href ,(let ((query-parameter-string
|
||||
(query-parameters->string query-parameters)))
|
||||
(string-append
|
||||
path-base ".json"
|
||||
(if (string-null? query-parameter-string)
|
||||
""
|
||||
(string-append "?" query-parameter-string))))))
|
||||
"View JSON")))
|
||||
(div
|
||||
(@ (class "row"))
|
||||
(div
|
||||
|
|
Loading…
Reference in a new issue