holiday-api/templates/jobs.gohtml

59 lines
2.2 KiB
Plaintext

<!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 | Jobs</a></h1>
</section>
</header>
<nav>
<section class="container">
<a href="/admin">Search</a>
<a href="/admin/countries">Countries</a>
<a href="/admin/webhooks">Webhooks</a>
<a href="#" class="selected">Jobs</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">
<table style="width: 100%">
<thead>
<tr>
<th>Webhook</th>
<th>Created</th>
<th>Success</th>
<th>Retries remaining</th>
<th></th>
</tr>
</thead>
<tbody>
{{range $entry := .Jobs}}
<tr>
<td>{{$entry.WebhookId}}</td>
<td>{{$entry.Created.Format "2006-01-02 15:04:05"}}</td>
<td>
<img class="icon" src="{{if $entry.Success}}/assets/images/done-v.svg{{else}}/assets/images/close-x.svg{{end}}">
</td>
<td>{{$entry.RetryCount}}</td>
<td>
<button type="button" data-type="dialog" data-trigger="#update-card" data-url="/admin/dialogs/rerun-job?id={{$entry.Id}}" class="clean icon"><img class="icon" src="/assets/images/play.svg"></button>
<button type="button" data-type="dialog" data-trigger="#delete-card" data-url="/admin/dialogs/delete-job?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>