Add support for query parameters to the View JSON button of Jobs

Signed-off-by: Christopher Baines <mail@cbaines.net>
This commit is contained in:
Danjela Lura 2020-04-24 08:31:24 +02:00 committed by Christopher Baines
parent 5af213a165
commit 0ec2673493

View file

@ -20,6 +20,7 @@
#:use-module (ice-9 match) #:use-module (ice-9 match)
#:use-module (guix-data-service web html-utils) #:use-module (guix-data-service web html-utils)
#:use-module (guix-data-service web view html) #:use-module (guix-data-service web view html)
#:use-module (guix-data-service web query-parameters)
#:export (view-jobs #:export (view-jobs
view-job-events view-job-events
view-job-queue view-job-queue
@ -112,8 +113,13 @@
(@ (class "btn-group pull-right") (@ (class "btn-group pull-right")
(role "group")) (role "group"))
(a (@ (class "btn btn-lg btn-default") (a (@ (class "btn btn-lg btn-default")
(href ,(string-append (href ,(let ((query-params
"/jobs.json")) (query-parameters->string query-parameters)))
(string-append
"/jobs.json"
(if (string-null? query-params)
""
(string-append "?" query-params)))))
(role "button")) (role "button"))
"View JSON")) "View JSON"))