aboutsummaryrefslogtreecommitdiff
path: root/controller
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2022-06-16 22:09:39 +0200
committerGabriel A. Giovanini <mail@gabrielgio.me>2022-06-16 22:09:39 +0200
commitdb7e822dda56d32135eca6d3e3211a50cf93d31a (patch)
treea3cdebdb6befe370b66dafd13340d533940c6467 /controller
parentd06f6e1398c5dedb3359ff929c5aaf7317c73ce1 (diff)
downloadmdir-db7e822dda56d32135eca6d3e3211a50cf93d31a.tar.gz
mdir-db7e822dda56d32135eca6d3e3211a50cf93d31a.tar.bz2
mdir-db7e822dda56d32135eca6d3e3211a50cf93d31a.zip
feat: Add one more state
Add a new state to the worker so it can better report what is happening. Also added a status report in the index page.
Diffstat (limited to 'controller')
-rw-r--r--controller/controller.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/controller/controller.go b/controller/controller.go
index 3e029f0..7cbee6a 100644
--- a/controller/controller.go
+++ b/controller/controller.go
@@ -49,3 +49,8 @@ func (e *Env) DeleteEntry(c *gin.Context) {
e.Entries.Delete(id)
c.HTML(http.StatusOK, "entry", entry)
}
+
+func (e *Env) GetJobs(c *gin.Context) {
+ jobs := e.Worker.GetJobs()
+ c.JSON(http.StatusOK, jobs)
+}