From b85db3a10df32cb2648607c83d37160ac3ee8691 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 14 May 2019 20:05:45 +0200 Subject: Show web-hook test result immediately after saving it Closes #12 --- templates/webhooks.html.ep | 56 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 17 deletions(-) (limited to 'templates/webhooks.html.ep') diff --git a/templates/webhooks.html.ep b/templates/webhooks.html.ep index 0bf8cc8..b782823 100644 --- a/templates/webhooks.html.ep +++ b/templates/webhooks.html.ep @@ -4,7 +4,29 @@

Web Hooks

- +% if (stash('new_hook') and $hook->{enabled}) { +
+
+ % if ($hook->{errored}) { +
+
+ Web-Hook fehlerhaft +

<%= $hook->{output} %>

+
+
+ % } + % else { +
+
+ Web-Hook erfolgreich getestet +

<%= $hook->{output} %>

+
+
+ % } +
+
+% } +

@@ -31,22 +53,6 @@ %= text_field 'token', id => 'token', class => 'validate', maxlength => 250

-
- % if ($hook->{latest_run}->epoch) { - Zuletzt ausgeführt <%= $hook->{latest_run}->strftime('am %d.%m.%Y um %H:%M:%S') %>
- % if ($hook->{errored}) { - error - Status: <%= $hook->{output} %> - % } - % else { - check - Server-Antwort: <%= $hook->{output} %> - % } - % } - % else { - Noch nicht ausgeführt. - % } -
%= end +
+ % if ($hook->{latest_run}->epoch) { + Zuletzt ausgeführt <%= $hook->{latest_run}->strftime('am %d.%m.%Y um %H:%M:%S') %>
+ % if ($hook->{errored}) { + error + Status: <%= $hook->{output} %> + % } + % else { + check + Server-Antwort: <%= $hook->{output} %> + % } + % } + % else { + Noch nicht ausgeführt. + % } +

Events werden als JSON POST mit folgender Payload übertragen.

-- cgit v1.2.3