diff --git a/assets/images/invoice.svg b/assets/images/invoice.svg new file mode 100644 index 0000000..ed8e5e5 --- /dev/null +++ b/assets/images/invoice.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/assets/images/play.svg b/assets/images/play.svg new file mode 100644 index 0000000..36ec614 --- /dev/null +++ b/assets/images/play.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/main.go b/main.go index 5b62d5f..b830fcc 100644 --- a/main.go +++ b/main.go @@ -128,6 +128,7 @@ func loadTemplates(g *gin.Engine) { "templates/admin_dashboard.gohtml", "templates/countries.gohtml", "templates/webhooks.gohtml", + "templates/jobs.gohtml", "templates/dialogs/add-holiday.gohtml", "templates/dialogs/edit-holiday.gohtml", @@ -267,6 +268,10 @@ func setupAdminDashboard(adminDashboard *gin.RouterGroup, service holiday.Holida webhooks, _ := webhookService.Find() c.HTML(http.StatusOK, "webhooks.gohtml", gin.H{"Webhooks": webhooks}) }) + adminDashboard.GET("/jobs", func(c *gin.Context) { + jobs, _ := webhookService.FindAllJobs() + c.HTML(http.StatusOK, "jobs.gohtml", gin.H{"Jobs": jobs}) + }) adminDashboard.POST("/webhooks", func(c *gin.Context) { request := struct { Id *string `form:"id"` diff --git a/templates/jobs.gohtml b/templates/jobs.gohtml new file mode 100644 index 0000000..8aa2d2c --- /dev/null +++ b/templates/jobs.gohtml @@ -0,0 +1,59 @@ + + + + + + Holiday-api | Admin dashboard + + + + +
+
+
+

Holiday-api | Jobs

+
+
+ +
+
+ + + + + + + + + + + + + {{range $entry := .Jobs}} + + + + + + + + {{end}} + +
WebhookCreatedSuccessRetries remaining
{{$entry.WebhookId}}{{$entry.Created.Format "2006-01-02 15:04:05"}} + + {{$entry.RetryCount}} + + +
+
+
+ + \ No newline at end of file diff --git a/templates/webhooks.gohtml b/templates/webhooks.gohtml index 93abac1..634c8b7 100644 --- a/templates/webhooks.gohtml +++ b/templates/webhooks.gohtml @@ -50,6 +50,7 @@ +