From b36ba45aef6ce3a62079064a900915a9e222acde Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 5 May 2019 18:09:11 +0200 Subject: WiP webhook support --- templates/webhooks.html.ep | 62 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 templates/webhooks.html.ep (limited to 'templates') diff --git a/templates/webhooks.html.ep b/templates/webhooks.html.ep new file mode 100644 index 0000000..fec485d --- /dev/null +++ b/templates/webhooks.html.ep @@ -0,0 +1,62 @@ +% if (my $invalid = stash('invalid')) { + %= include '_invalid_input', invalid => $invalid +% } + +

Web Hooks

+ + +
+
+

+ Die im Web Hook konfigurierte URL wird bei jedem Checkin und Checkout + des ausgewählten Zuges aufgerufen. Falls ein Token eingetragen + ist, wird er als Bearer Token verwendet. +

+

+ Events werden als JSON POST übertragen. Das JSON-Dokument besteht aus + zwei Feldern: „reason“ gibt den Grund des API-Aufrufs an (checkin, + checkout, undo), „status“ den aktuellen Status. +

+
+ %= form_for '/account/hooks' => (method => 'POST') => begin + %= csrf_field +
+ +
+
+ link + %= text_field 'url', id => 'url', class => 'validate', maxlength => 1000 + +
+
+ lock + %= text_field 'token', id => 'token', class => 'validate', maxlength => 250 + +
+
+ % if ($hook->{latest_run}->epoch) { + Zuletzt ausgeführt: <%= $hook->{latest_run} %>
+ % if ($hook->{errored}) { + error + Status: <%= $hook->{output} %> + % } + % else { + check + Server-Antwort: <%= $hook->{output} %> + % } + % } + % else { + Noch nicht ausgeführt. + % } +
+
+ +
+ %= end +
-- cgit v1.2.3