Added webhook support and webhook display
This commit is contained in:
1 parent
89d246f3f6
commit
88d9188055
13 files changed
+551
-26
No files matched your search
@@ -0,0 +1,35 @@
|
||||
<dialog class="card" id="create-card">
|
||||
<h3 class="card-title">Create webhook</h3>
|
||||
<form method="post" action="/admin/webhooks">
|
||||
<section>
|
||||
<label for="url">Url:</label>
|
||||
<input required id="url" name="url" type="url">
|
||||
</section>
|
||||
<section>
|
||||
<label for="country">Country:</label>
|
||||
<select id="country" required name="country">
|
||||
{{range $entry := .Countries}}
|
||||
<option value="{{$entry.IsoName}}">{{$entry.Name}}</option>
|
||||
{{end}}
|
||||
</select>
|
||||
</section>
|
||||
<section>
|
||||
<label for="retry_count">Retry count:</label>
|
||||
<input required id="retry_count" name="retry_count" type="number" min="0" max="10">
|
||||
</section>
|
||||
<section>
|
||||
<label class="checkbox"><span>On created</span><input id="on_created" value="true" name="on_created" type="checkbox"></label>
|
||||
</section>
|
||||
<section>
|
||||
<label class="checkbox"><span>On edited</span><input id="on_edited" value="true" name="on_edited" type="checkbox"></label>
|
||||
</section>
|
||||
<section>
|
||||
<label class="checkbox"><span>On deleted</span><input id="on_deleted" value="true" name="on_deleted" type="checkbox"></label>
|
||||
</section>
|
||||
|
||||
<section class="actions">
|
||||
<button type="submit">Create</button>
|
||||
<button type="button" onclick="closeDialog('#create-card')">Cancel</button>
|
||||
</section>
|
||||
</form>
|
||||
</dialog>
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
<dialog class="card" id="delete-card">
|
||||
<h3 class="card-title">Delete webhook</h3>
|
||||
<p>Are you sure you want to delete webhook to <br><b>{{.Webhook.Url}}?</b><br>All jobs for given webhook will be deleted!</p>
|
||||
<form method="post" action="/admin/webhooks/{{.Webhook.Id}}/delete">
|
||||
<section class="actions">
|
||||
<button type="submit">Delete</button>
|
||||
<button type="button" onclick="closeDialog('#delete-card')">Cancel</button>
|
||||
</section>
|
||||
</form>
|
||||
</dialog>
|
||||
@@ -0,0 +1,36 @@
|
||||
<dialog class="card" id="update-card">
|
||||
<h3 class="card-title">Edit webhook</h3>
|
||||
<form method="post" action="/admin/webhooks">
|
||||
<input type="hidden" id="id" name="id" value="{{.Webhook.Id}}">
|
||||
<section>
|
||||
<label for="url">Url:</label>
|
||||
<input required id="url" name="url" type="url" value="{{.Webhook.Url}}">
|
||||
</section>
|
||||
<section>
|
||||
<label for="country">Country:</label>
|
||||
<select id="country" required name="country">
|
||||
{{range $entry := .Countries}}
|
||||
<option {{if eq $.Webhook.Country $entry.IsoName}}selected{{end}} value="{{$entry.IsoName}}">{{$entry.Name}}</option>
|
||||
{{end}}
|
||||
</select>
|
||||
</section>
|
||||
<section>
|
||||
<label for="retry_count">Retry count:</label>
|
||||
<input required id="retry_count" name="retry_count" type="number" min="0" max="10" value="{{.Webhook.RetryCount}}">
|
||||
</section>
|
||||
<section>
|
||||
<label class="checkbox"><span>On created</span><input id="on_created" value="true" name="on_created" type="checkbox" {{if .Webhook.OnCreated}}checked{{end}}></label>
|
||||
</section>
|
||||
<section>
|
||||
<label class="checkbox"><span>On edited</span><input id="on_edited" value="true" name="on_edited" type="checkbox" {{if .Webhook.OnEdited}}checked{{end}}></label>
|
||||
</section>
|
||||
<section>
|
||||
<label class="checkbox"><span>On deleted</span><input id="on_deleted" value="true" name="on_deleted" type="checkbox" {{if .Webhook.OnDeleted}}checked{{end}}></label>
|
||||
</section>
|
||||
|
||||
<section class="actions">
|
||||
<button type="submit">Update</button>
|
||||
<button type="button" onclick="closeDialog('#update-card')">Cancel</button>
|
||||
</section>
|
||||
</form>
|
||||
</dialog>
|
||||
Reference in new issue
Block a user