Skip to content
Snippets Groups Projects
Unverified Commit 4e0152f7 authored by Mathieu Othacehe's avatar Mathieu Othacehe
Browse files

Add a build restart button.

* src/cuirass/http.scm (url-handler): New route "/admin/build/<id>/restart".
* src/cuirass/template.scm (build-details): Add a "restart" button.
parent 31342ff8
No related branches found
No related tags found
No related merge requests found
......@@ -483,6 +483,14 @@ Hydra format."
"Cuirass [Admin]"
(specifications-table (db-get-specifications) 'admin)
'())))
(('GET "admin" "build" id "restart")
(db-restart-build! (string->number id))
(respond
(build-response
#:code 302
#:headers `((location . ,(string->uri-reference
(string-append "/build/" id "/details")))))
#:body ""))
(('GET "admin")
(respond-html (html-page
"Cuirass [Admin]"
......
......@@ -292,7 +292,22 @@ system whose names start with " (code "guile-") ":" (br)
(td ,(assq-ref build #:nix-name))
(td ,(time->string (assq-ref build #:stoptime)))))
`((p (@ (class "lead")) "Build details")
`((p (@ (class "lead")) "Build details"
,@(if (>= status 0)
`((div (@ (class "dropdown float-right"))
(a (@ (class "btn btn-warning dropdown-toggle")
(href "#")
(data-toggle "dropdown")
(role "button")
(aria-haspopup "true")
(aria-expanded "false"))
"Action")
(div (@ (class "dropdown-menu"))
(a (@ (class "dropdown-item")
(href "/admin/build/"
,(assq-ref build #:id) "/restart"))
"Restart"))))
'()))
(table
(@ (class "table table-sm table-hover"))
(tbody
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment