[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: Add an evaluation restart button.
From: |
Mathieu Othacehe |
Subject: |
branch master updated: Add an evaluation restart button. |
Date: |
Thu, 18 Feb 2021 09:23:56 -0500 |
This is an automated email from the git hooks/post-receive script.
mothacehe pushed a commit to branch master
in repository guix-cuirass.
The following commit(s) were added to refs/heads/master by this push:
new 64151ee Add an evaluation restart button.
64151ee is described below
commit 64151eee28f70371a6a90302f74a02645e3cf66a
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Thu Feb 18 15:22:59 2021 +0100
Add an evaluation restart button.
* src/cuirass/http.scm (url-handler): New route
"/admin/evaluation/<id>/restart".
* src/cuirass/templates.scm (evaluation-info-table): Add an evaluation
restart
button.
---
src/cuirass/http.scm | 13 +++++++++++++
src/cuirass/templates.scm | 20 ++++++++++++++++++--
2 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/src/cuirass/http.scm b/src/cuirass/http.scm
index afd5410..73f7151 100644
--- a/src/cuirass/http.scm
+++ b/src/cuirass/http.scm
@@ -491,6 +491,19 @@ Hydra format."
#:headers `((location . ,(string->uri-reference
(string-append "/build/" id "/details")))))
#:body ""))
+
+ (('GET "admin" "evaluation" id "restart")
+ (let* ((eval (db-get-evaluation id))
+ (specification (assq-ref eval #:specification)))
+ (db-restart-evaluation! (string->number id))
+ (respond
+ (build-response
+ #:code 302
+ #:headers `((location
+ . ,(string->uri-reference
+ (string-append "/jobset/" specification)))))
+ #:body "")))
+
(('GET "admin")
(respond-html (html-page
"Cuirass [Admin]"
diff --git a/src/cuirass/templates.scm b/src/cuirass/templates.scm
index c9294e3..a57653b 100644
--- a/src/cuirass/templates.scm
+++ b/src/cuirass/templates.scm
@@ -495,7 +495,8 @@ system whose names start with " (code "guile-") ":" (br)
(tr
(th (@ (scope "col")) "#")
(th (@ (scope "col")) "Input changes")
- (th (@ (scope "col")) Success)))
+ (th (@ (scope "col")) Success)
+ (th (@ (scope "col")) Action)))
(tbody
,@(map
(lambda (row)
@@ -503,7 +504,22 @@ system whose names start with " (code "guile-") ":" (br)
(a (@ (href "/eval/" ,(assq-ref row #:id)))
,(assq-ref row #:id)))
(td ,(input-changes (assq-ref row #:checkouts)))
- (td ,@(evaluation-badges row))))
+ (td ,@(evaluation-badges row))
+ (td
+ (div (@ (class "dropdown"))
+ (a (@ (class "oi oi-menu dropdown-toggle")
+ (href "#")
+ (data-toggle "dropdown")
+ (role "button")
+ (aria-haspopup "true")
+ (aria-expanded "false"))
+ " ")
+ (div (@ (class "dropdown-menu"))
+ (a (@ (class "dropdown-item")
+ (href "/admin/evaluation/"
+ ,(assq-ref row #:id)
+ "/restart"))
+ "Restart"))))))
evaluations)))))
,(if (null? evaluations)
(pagination "" "" "" "")
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: Add an evaluation restart button.,
Mathieu Othacehe <=