From 5ea420dfe42e244a2d58bf4458714cb4e98f5b2e Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Thu, 14 Nov 2024 09:22:29 -0600 Subject: [PATCH] Added an option to not remove admin executions Signed-off-by: Florent Poinsard --- go/admin/api.go | 9 +++++++-- go/admin/templates/add_new_executions.html | 2 +- go/admin/templates/clear_queue.html | 19 ++++++++++++++----- go/server/api.go | 5 +++-- go/server/cron.go | 5 ++++- 5 files changed, 29 insertions(+), 11 deletions(-) diff --git a/go/admin/api.go b/go/admin/api.go index 03702e0a..92837a8e 100644 --- a/go/admin/api.go +++ b/go/admin/api.go @@ -22,6 +22,7 @@ import ( "bytes" "context" "encoding/json" + "log" "net/http" "strings" "sync" @@ -66,7 +67,8 @@ type ( } clearQueueRequest struct { - Auth string `json:"auth"` + Auth string `json:"auth"` + RemoveAdminExecutions bool `json:"remove_admin_executions"` } ) @@ -332,9 +334,12 @@ func (a *Admin) handleClearQueue(c *gin.Context) { } requestPayload := clearQueueRequest{ - Auth: encryptedToken, + Auth: encryptedToken, + RemoveAdminExecutions: c.PostForm("remove_admin") == "true", } + log.Println(requestPayload) + jsonData, err := json.Marshal(requestPayload) if err != nil { diff --git a/go/admin/templates/add_new_executions.html b/go/admin/templates/add_new_executions.html index 49406e3a..0539c907 100644 --- a/go/admin/templates/add_new_executions.html +++ b/go/admin/templates/add_new_executions.html @@ -2,7 +2,7 @@
- + + +
+
+ +
+
+
-