summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-05-14 20:05:45 +0200
committerDaniel Friesel <derf@finalrewind.org>2019-05-14 20:05:45 +0200
commitb85db3a10df32cb2648607c83d37160ac3ee8691 (patch)
tree3b20a35c32695270ba5bbbc0c2e1fb041184eb96 /templates
parent5c3a0a562a2169986f3f91034b10a5e177c7dff5 (diff)
Show web-hook test result immediately after saving it1.3.3
Closes #12
Diffstat (limited to 'templates')
-rw-r--r--templates/webhooks.html.ep56
1 files changed, 39 insertions, 17 deletions
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 @@
<h1>Web Hooks</h1>
-<!-- -H "Authorization: Bearer ${TOKEN}" -->
+% if (stash('new_hook') and $hook->{enabled}) {
+ <div class="row">
+ <div class="col s12">
+ % if ($hook->{errored}) {
+ <div class="card red darken-4">
+ <div class="card-content white-text">
+ <span class="card-title">Web-Hook fehlerhaft</span>
+ <p><%= $hook->{output} %></p>
+ </div>
+ </div>
+ % }
+ % else {
+ <div class="card green darken-4">
+ <div class="card-content white-text">
+ <span class="card-title">Web-Hook erfolgreich getestet</span>
+ <p><%= $hook->{output} %></p>
+ </div>
+ </div>
+ % }
+ </div>
+ </div>
+% }
+
<div class="row">
<div class="col s12">
<p>
@@ -31,22 +53,6 @@
%= text_field 'token', id => 'token', class => 'validate', maxlength => 250
<label for="token">Token</label>
</div>
- <div class="col s12">
- % if ($hook->{latest_run}->epoch) {
- Zuletzt ausgeführt <%= $hook->{latest_run}->strftime('am %d.%m.%Y um %H:%M:%S') %><br/>
- % if ($hook->{errored}) {
- <i class="material-icons left">error</i>
- Status: <%= $hook->{output} %>
- % }
- % else {
- <i class="material-icons left">check</i>
- Server-Antwort: <%= $hook->{output} %>
- % }
- % }
- % else {
- Noch nicht ausgeführt.
- % }
- </div>
<div class="col s12 center-align">
<button class="btn waves-effect waves-light" type="submit" name="action" value="save">
Speichern
@@ -54,6 +60,22 @@
</button>
</div>
%= end
+ <div class="col s12" style="margin-top: 1em; margin-bottom: 2em;">
+ % if ($hook->{latest_run}->epoch) {
+ Zuletzt ausgeführt <%= $hook->{latest_run}->strftime('am %d.%m.%Y um %H:%M:%S') %><br/>
+ % if ($hook->{errored}) {
+ <i class="material-icons left">error</i>
+ Status: <%= $hook->{output} %>
+ % }
+ % else {
+ <i class="material-icons left">check</i>
+ Server-Antwort: <%= $hook->{output} %>
+ % }
+ % }
+ % else {
+ Noch nicht ausgeführt.
+ % }
+ </div>
<div class="col s12">
<p>Events werden als JSON POST mit folgender Payload übertragen.</p>
<p style="font-family: Monospace;">