Indicate number of running jobs in tob nav

Issue: #1069
This commit is contained in:
eikek
2021-11-12 21:56:48 +01:00
parent 9acdb8ef96
commit 7a8527f821
16 changed files with 201 additions and 50 deletions

View File

@ -11,7 +11,8 @@ import Json.Decode as D
type ServerEvent
= ItemProcessed
= JobSubmitted String
| JobDone String
| JobsWaiting Int
@ -30,8 +31,13 @@ decode json =
decodeTag : String -> D.Decoder ServerEvent
decodeTag tag =
case tag of
"item-processed" ->
D.succeed ItemProcessed
"job-done" ->
D.field "content" D.string
|> D.map JobDone
"job-submitted" ->
D.field "content" D.string
|> D.map JobSubmitted
"jobs-waiting" ->
D.field "content" D.int