Implement the JSON response for the package derivations page
This commit is contained in:
parent
68420b1085
commit
7a7dedfa1b
2 changed files with 33 additions and 1 deletions
|
|
@ -767,7 +767,26 @@
|
||||||
mime-types)
|
mime-types)
|
||||||
((application/json)
|
((application/json)
|
||||||
(render-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
|
(else
|
||||||
(render-html
|
(render-html
|
||||||
#:sxml (view-revision-package-derivations
|
#:sxml (view-revision-package-derivations
|
||||||
|
|
|
||||||
|
|
@ -1127,6 +1127,19 @@ figure {
|
||||||
(button (@ (type "submit")
|
(button (@ (type "submit")
|
||||||
(class "btn btn-lg btn-primary"))
|
(class "btn btn-lg btn-primary"))
|
||||||
"Update results")))))))
|
"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
|
(div
|
||||||
(@ (class "row"))
|
(@ (class "row"))
|
||||||
(div
|
(div
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue