aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service/web/jobs/controller.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix-data-service/web/jobs/controller.scm')
-rw-r--r--guix-data-service/web/jobs/controller.scm25
1 files changed, 25 insertions, 0 deletions
diff --git a/guix-data-service/web/jobs/controller.scm b/guix-data-service/web/jobs/controller.scm
index 733fb35..a589204 100644
--- a/guix-data-service/web/jobs/controller.scm
+++ b/guix-data-service/web/jobs/controller.scm
@@ -43,6 +43,19 @@
(render-jobs mime-types
conn
parsed-query-parameters)))
+ (('GET "jobs" "events")
+ (let ((parsed-query-parameters
+ (guard-against-mutually-exclusive-query-parameters
+ (parse-query-parameters
+ request
+ `((limit_results ,parse-result-limit
+ #:no-default-when (all_results)
+ #:default 50)
+ (all_results ,parse-checkbox-value)))
+ '((limit_results all_results)))))
+ (render-job-events mime-types
+ conn
+ parsed-query-parameters)))
(('GET "jobs" "queue")
(render-job-queue mime-types
conn))
@@ -75,6 +88,18 @@
(>= (length jobs)
limit-results))))))
+(define (render-job-events mime-types conn query-parameters)
+ (let* ((limit-results
+ (assq-ref query-parameters 'limit_results))
+ (recent-events (select-recent-job-events
+ conn
+ ;; TODO Ideally there wouldn't be a limit
+ #:limit (or limit-results 1000000))))
+ (render-html
+ #:sxml (view-job-events
+ query-parameters
+ recent-events))))
+
(define (render-job-queue mime-types conn)
(render-html
#:sxml (view-job-queue