holiday-api/templates/webhooks.gohtml

64 lines
2.8 KiB
Plaintext
Raw Normal View History

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Holiday-api | Admin dashboard</title>
<link rel="stylesheet" href="/assets/style.css">
<script src="/assets/global.js"></script>
</head>
<body>
<div id="dialog-container"></div>
<header>
<section class="container">
<h1><a href="/">Holiday-api | Webhooks</a></h1>
</section>
</header>
<nav>
<section class="container">
<a href="/admin">Search</a>
<a href="/admin/countries">Countries</a>
<a class="selected" href="#">Webhooks</a>
<button data-type="dialog" data-trigger="#create-card" data-url="/admin/dialogs/add-holiday">Add new holiday</button>
</section>
</nav>
<main>
<section style="margin: 1em; flex-grow: 1">
<button data-type="dialog" data-trigger="#create-card" data-url="/admin/dialogs/add-webhook" style="margin-bottom: 1em; float: right">Create webhook</button>
<table style="width: 100%">
<thead>
<tr>
<th>Country</th>
<th>Url</th>
<th>Retry count</th>
<th>On create</th>
<th>On update</th>
<th>On delete</th>
<th></th>
</tr>
</thead>
<tbody>
{{range $entry := .Webhooks}}
<tr>
<td>{{$entry.Country}}</td>
<td>{{$entry.Url}}</td>
<td>{{$entry.RetryCount}}</td>
<td><img class="icon" src="{{if $entry.OnCreated}}/assets/images/done-v.svg{{else}}/assets/images/close-x.svg{{end}}"></td>
<td><img class="icon" src="{{if $entry.OnEdited}}/assets/images/done-v.svg{{else}}/assets/images/close-x.svg{{end}}"></td>
<td><img class="icon" src="{{if $entry.OnDeleted}}/assets/images/done-v.svg{{else}}/assets/images/close-x.svg{{end}}"></td>
<td>
2023-08-06 13:10:36 +00:00
<a style="display: inline-block; font-size: 0.8em" href="/admin/jobs?id={{$entry.Id}}" class="clean icon"><img class="icon" src="/assets/images/invoice.svg"></a>
<button type="button" data-type="dialog" data-trigger="#update-card" data-url="/admin/dialogs/edit-webhook?id={{$entry.Id}}" class="clean icon"><img class="icon" src="/assets/images/edit.svg"></button>
<button type="button" data-type="dialog" data-trigger="#delete-card" data-url="/admin/dialogs/delete-webhook?id={{$entry.Id}}" class="clean icon"><img class="icon" src="/assets/images/trash-delete.svg"></button>
</td>
</tr>
{{end}}
</tbody>
</table>
</section>
</main>
</body>
</html>