From 53be510c0c30828edd9912c0bc630c0bd4bf35d1 Mon Sep 17 00:00:00 2001 From: Tine Date: Fri, 23 Feb 2024 15:16:51 +0100 Subject: [PATCH] fix(worker): history add --- internal/handlers/api.go | 10 +--------- web/static/css/main.css | 4 ++++ web/static/css/tailwind.css | 10 ++++++++++ .../pages/settings_healthchecks_create.tmpl | 13 +++++++++---- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/internal/handlers/api.go b/internal/handlers/api.go index 7b69628..709f732 100644 --- a/internal/handlers/api.go +++ b/internal/handlers/api.go @@ -47,16 +47,8 @@ func (h *BaseHandler) ApiV1HealthchecksHistoryPOST(c echo.Context) error { slug := c.Param("slug") - worker, err := services.GetWorker(ctx, h.query, slug) - if err != nil { - return err - } - if worker == nil { - return echo.NewHTTPError(http.StatusNotFound, "Worker not found") - } - var body api.ApiV1HealthchecksHistoryPOSTBody - err = (&echo.DefaultBinder{}).BindBody(c, &body) + err := (&echo.DefaultBinder{}).BindBody(c, &body) if err != nil { return err } diff --git a/web/static/css/main.css b/web/static/css/main.css index 1a2a4aa..e2bdf74 100644 --- a/web/static/css/main.css +++ b/web/static/css/main.css @@ -17,6 +17,10 @@ p > a { @apply font-medium text-blue-700 hover:underline; } +code { + @apply font-mono text-sm bg-gray-100 rounded-lg p-1; +} + .navbar { @apply justify-center flex flex-wrap space-x-2 gap-2 mt-10; } diff --git a/web/static/css/tailwind.css b/web/static/css/tailwind.css index 716c3b8..63eee69 100644 --- a/web/static/css/tailwind.css +++ b/web/static/css/tailwind.css @@ -1157,6 +1157,16 @@ p > a:hover { text-decoration-line: underline; } +code { + border-radius: 0.5rem; + --tw-bg-opacity: 1; + background-color: rgb(243 244 246 / var(--tw-bg-opacity)); + padding: 0.25rem; + font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; + font-size: 0.875rem; + line-height: 1.25rem; +} + .navbar { margin-top: 2.5rem; display: flex; diff --git a/web/templates/pages/settings_healthchecks_create.tmpl b/web/templates/pages/settings_healthchecks_create.tmpl index 2ab0833..dae4dbe 100644 --- a/web/templates/pages/settings_healthchecks_create.tmpl +++ b/web/templates/pages/settings_healthchecks_create.tmpl @@ -3,13 +3,18 @@
-

Name of the healthcheck can be anything.

+

Name of the healthcheck can be anything.

-

Worker groups are used to distribute the healthcheck to specific workers.

+

Worker groups are used to distribute the healthcheck to specific workers.

- -

Schedule is a cron expression that defines when the healthcheck should be executed.

+ +

+ Schedule is a cron expression that defines when the healthcheck should be executed. +
+ You can also use @every [interval] where interval is a duration like 5m, 1h, 60s. + Or use @hourly, @daily, @weekly, @monthly, @yearly. +