Show cancelled jobs in queue page

This commit is contained in:
Eike Kettner 2021-04-11 01:01:32 +02:00
parent c07fd1e61d
commit 5f001b59e5
3 changed files with 22 additions and 0 deletions

View File

@ -10,11 +10,13 @@ type alias Texts =
, waiting : String , waiting : String
, errored : String , errored : String
, success : String , success : String
, cancelled : String
, noJobsRunning : String , noJobsRunning : String
, noJobsDisplay : String , noJobsDisplay : String
, noJobsWaiting : String , noJobsWaiting : String
, noJobsFailed : String , noJobsFailed : String
, noJobsSuccess : String , noJobsSuccess : String
, noJobsCancelled : String
, deleteThisJob : String , deleteThisJob : String
, showLog : String , showLog : String
, remove : String , remove : String
@ -32,11 +34,13 @@ gb =
, waiting = "Waiting" , waiting = "Waiting"
, errored = "Errored" , errored = "Errored"
, success = "Success" , success = "Success"
, cancelled = "Cancelled"
, noJobsRunning = "No jobs currently running." , noJobsRunning = "No jobs currently running."
, noJobsDisplay = "No jobs to display." , noJobsDisplay = "No jobs to display."
, noJobsWaiting = "No waiting jobs." , noJobsWaiting = "No waiting jobs."
, noJobsFailed = "No failed jobs to display." , noJobsFailed = "No failed jobs to display."
, noJobsSuccess = "No succesfull jobs to display." , noJobsSuccess = "No succesfull jobs to display."
, noJobsCancelled = "No cancelled jobs to display."
, deleteThisJob = "Cancel/Delete this job?" , deleteThisJob = "Cancel/Delete this job?"
, showLog = "Show log" , showLog = "Show log"
, remove = "Remove" , remove = "Remove"

View File

@ -38,6 +38,7 @@ type QueueView
| QueueWaiting | QueueWaiting
| QueueError | QueueError
| QueueSuccess | QueueSuccess
| QueueCancelled
emptyModel : Model emptyModel : Model

View File

@ -39,6 +39,10 @@ viewSidebar texts visible _ _ model =
filterJobDetails model.state.completed "failed" filterJobDetails model.state.completed "failed"
|> List.length |> List.length
QueueCancelled ->
filterJobDetails model.state.completed "cancelled"
|> List.length
tabLink cls v icon label = tabLink cls v icon label =
a a
[ href "#" [ href "#"
@ -74,6 +78,7 @@ viewSidebar texts visible _ _ model =
, tabLink "ml-8" QueueWaiting "fa fa-clock" texts.waiting , tabLink "ml-8" QueueWaiting "fa fa-clock" texts.waiting
, tabLink "ml-8" QueueError "fa fa-bolt" texts.errored , tabLink "ml-8" QueueError "fa fa-bolt" texts.errored
, tabLink "ml-8" QueueSuccess "fa fa-check" texts.success , tabLink "ml-8" QueueSuccess "fa fa-check" texts.success
, tabLink "ml-8" QueueCancelled "fa fa-times-circle" texts.cancelled
] ]
] ]
@ -151,6 +156,18 @@ viewContent texts _ _ model =
else else
div [ class gridStyle ] div [ class gridStyle ]
(List.map (renderInfoCard texts model) items) (List.map (renderInfoCard texts model) items)
QueueCancelled ->
let
items =
filterJobDetails model.state.completed "cancelled"
in
if List.isEmpty items then
message texts.noJobsCancelled
else
div [ class gridStyle ]
(List.map (renderInfoCard texts model) items)
] ]