arche / internal/archesrv/templates/srv_webhook_deliveries.html

commit 154431fd
 1{{ define "title" }}{{.Repo}} — webhook deliveries{{ end }}
 2{{ define "navextra" }}<a href="/{{.Repo}}">{{.Repo}}</a> <a href="/{{.Repo}}/log">log</a> <a href="/{{.Repo}}/tree">tree</a> <a href="/{{.Repo}}/issues">issues</a> <a href="/{{.Repo}}/stacks">stacks</a> <a href="/{{.Repo}}/wiki">wiki</a> <a href="/{{.Repo}}/settings">settings</a>{{ end }}
 3{{ define "srv_webhook_deliveries.html" }}{{ template "head" . }}
 4<div class="container">
 5    <div style="margin-bottom: 8px">
 6        <a href="/{{.Repo}}/settings/webhooks"
 7           style="font-size: 13px;
 8                  color: #666">← webhooks</a>
 9    </div>
10    <h2 style="margin-bottom: 4px">Delivery history</h2>
11    <p style="font-size: 13px;
12              color: #666;
13              margin-bottom: 16px;
14              font-family: monospace">{{.WebhookURL}}</p>
15    {{ if .Deliveries }}
16    <table>
17        <thead>
18            <tr>
19                <th>ID</th>
20                <th>Event</th>
21                <th>Status</th>
22                <th>Delivered at</th>
23                <th>Error</th>
24                <th></th>
25            </tr>
26        </thead>
27        <tbody>
28            {{ range .Deliveries }}
29            <tr>
30                <td style="color: #aaa; font-size: 12px">{{.ID}}</td>
31                <td style="font-size: 12px">{{.Event}}</td>
32                <td>
33                    {{ if .Error }}
34                    <span class="badge badge-private">error</span>
35                    {{ else if ge .ResponseCode 200 }}{{ if lt .ResponseCode 300 }}
36                    <span class="badge badge-public">{{.ResponseCode}}</span>
37                {{ else }}
38                    <span class="badge badge-draft">{{.ResponseCode}}</span>
39                    {{ end }}{{ end }}
40                </td>
41                <td style="font-size: 12px; color: #888">{{.DeliveredAt.Format "2006-01-02 15:04:05"}}</td>
42                <td style="font-size: 12px; color: #c0392b">{{.Error}}</td>
43                <td>
44                    <form method="POST"
45                          action="/{{$.Repo}}/settings/webhooks/{{$.WebhookID}}/deliveries/{{.ID}}/replay"
46                          style="display:inline">
47                        <button type="submit"
48                                style="font-size: 11px;
49                                       padding: 2px 8px;
50                                       cursor: pointer">Replay</button>
51                    </form>
52                </td>
53            </tr>
54            {{ end }}
55        </tbody>
56    </table>
57{{ else }}
58    <p style="color: #888; margin-top: 12px">No deliveries yet.</p>
59    {{ end }}
60</div>
61{{ template "foot" . }}
62{{ end }}