[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Ludovic Courtès |
Date: |
Mon, 12 Jun 2023 17:29:43 -0400 (EDT) |
branch: master
commit c7db7f88a2e722d7e9f4cd20519dafdd4c8d86f6
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon Jun 12 23:16:54 2023 +0200
templates: Evaluation dashboard shows completion time and commits.
* src/cuirass/templates.scm (evaluation-dashboard): Rename 'evaluation'
to 'evaluation-id'. Add #:channels. Add 'details' block showing
completion time and checkouts.
---
src/cuirass/http.scm | 7 +++++--
src/cuirass/templates.scm | 23 ++++++++++++++++++-----
2 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/src/cuirass/http.scm b/src/cuirass/http.scm
index 750c6dc..2c5a5c1 100644
--- a/src/cuirass/http.scm
+++ b/src/cuirass/http.scm
@@ -1,7 +1,7 @@
;;;; http.scm -- HTTP API
;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
;;; Copyright © 2017, 2020, 2021 Mathieu Othacehe <othacehe@gnu.org>
-;;; Copyright © 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2018, 2019, 2020, 2023 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
;;; Copyright © 2018 Tatiana Sholokhova <tanja201396@gmail.com>
;;; Copyright © 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
@@ -443,6 +443,7 @@ is passed, only display jobs registered for this
DASHBOARD-ID. If SYSTEM is
passed, only display JOBS targeting this SYSTEM."
(let* ((spec-name (db-get-evaluation-specification evaluation-id))
(spec (db-get-specification spec-name))
+ (channels (specification-channels spec))
(systems (specification-systems spec))
(default-system
(if (member "x86_64-linux" systems)
@@ -455,7 +456,9 @@ passed, only display JOBS targeting this SYSTEM."
(next (db-get-next-eval evaluation-id)))
(html-page
"Dashboard"
- (evaluation-dashboard evaluation-id systems
+ (evaluation-dashboard (db-get-evaluation evaluation-id)
+ systems
+ #:channels channels
#:current-system
(or system default-system)
#:dashboard-id dashboard-id
diff --git a/src/cuirass/templates.scm b/src/cuirass/templates.scm
index c4b2db6..5335879 100644
--- a/src/cuirass/templates.scm
+++ b/src/cuirass/templates.scm
@@ -1870,17 +1870,25 @@ text-dark d-flex position-absolute w-100"))
(define* (evaluation-dashboard evaluation systems
#:key
+ channels
current-system
dashboard-id
names
prev-eval
next-eval)
+ (define evaluation-id
+ (assq-ref evaluation #:id))
+ (define time
+ (assq-ref evaluation #:evaltime))
+ (define checkouts
+ (assq-ref evaluation #:checkouts))
+
(let ((jobs
(if names
(format #f "/api/jobs?evaluation=~a&names=~a"
- evaluation names)
+ evaluation-id names)
(format #f "/api/jobs?evaluation=~a&system=~a"
- evaluation current-system))))
+ evaluation-id current-system))))
`((nav
(@ (aria-label "Evaluation navigation")
(class "eval-nav"))
@@ -1889,8 +1897,8 @@ text-dark d-flex position-absolute w-100"))
(p (@ (class "lead mb-0 mr-3"))
"Dashboard for "
(a (@ (href ,(string-append "/eval/"
- (number->string evaluation))))
- "evaluation #" ,(number->string evaluation))))
+ (number->string evaluation-id))))
+ "evaluation #" ,(number->string evaluation-id))))
(li (@ (class
,(string-append "page-item "
(if prev-eval
@@ -1931,13 +1939,18 @@ text-dark d-flex position-absolute w-100"))
""))
"#")))
"»")))))
+ (details
+ (summary ,(format #f "Evaluation completed ~a."
+ (time->string time)))
+ ,(checkout-table checkouts channels))
+
(form (@ (id "get-dashboard")
(class
,(string-append "row g-3 mb-3 "
(if names
"d-none"
"")))
- (action "/eval/" ,evaluation "/dashboard")
+ (action "/eval/" ,evaluation-id "/dashboard")
(method "GET"))
(div (@ (class "col-auto"))
(select (@ (id "system")