2015-08-26 19:30:06 +03:00
|
|
|
{{if .PageIsSettingsHooksEdit}}
|
2015-12-08 01:30:52 +03:00
|
|
|
<h4 class="ui top attached header">
|
2022-06-27 23:58:46 +03:00
|
|
|
{{.locale.Tr "repo.settings.recent_deliveries"}}
|
2018-11-28 14:26:14 +03:00
|
|
|
{{if .Permission.IsAdmin}}
|
2015-12-08 01:30:52 +03:00
|
|
|
<div class="ui right">
|
2023-06-14 21:17:58 +03:00
|
|
|
<button class="ui teal tiny button" id="test-delivery" data-tooltip-content="{{.locale.Tr "repo.settings.webhook.test_delivery_desc"}}" data-link="{{.Link}}/test" data-redirect="{{.Link}}">{{.locale.Tr "repo.settings.webhook.test_delivery"}}</button>
|
2015-08-27 18:06:14 +03:00
|
|
|
</div>
|
2015-12-08 01:30:52 +03:00
|
|
|
{{end}}
|
|
|
|
</h4>
|
2017-04-07 17:50:40 +03:00
|
|
|
<div class="ui attached segment">
|
|
|
|
<div class="ui list">
|
2015-12-08 01:30:52 +03:00
|
|
|
{{range .History}}
|
|
|
|
<div class="item">
|
|
|
|
<div class="meta">
|
|
|
|
{{if .IsSucceed}}
|
2020-09-11 23:19:00 +03:00
|
|
|
<span class="text green">{{svg "octicon-check"}}</span>
|
2015-12-08 01:30:52 +03:00
|
|
|
{{else}}
|
2020-09-11 23:19:00 +03:00
|
|
|
<span class="text red">{{svg "octicon-alert"}}</span>
|
2015-12-08 01:30:52 +03:00
|
|
|
{{end}}
|
2023-03-26 15:06:11 +03:00
|
|
|
<a class="ui primary sha label toggle button show-panel" data-panel="#info-{{.ID}}">{{.UUID}}</a>
|
2015-12-08 01:30:52 +03:00
|
|
|
<div class="ui right">
|
|
|
|
<span class="text grey time">
|
2023-05-04 02:53:43 +03:00
|
|
|
{{TimeSince .Delivered.AsTime $.locale}}
|
2015-12-08 01:30:52 +03:00
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-02-19 07:06:14 +03:00
|
|
|
<div class="info gt-hidden" id="info-{{.ID}}">
|
2015-12-08 01:30:52 +03:00
|
|
|
<div class="ui top attached tabular menu">
|
2022-06-27 23:58:46 +03:00
|
|
|
<a class="item active" data-tab="request-{{.ID}}">{{$.locale.Tr "repo.settings.webhook.request"}}</a>
|
2015-12-08 01:30:52 +03:00
|
|
|
<a class="item" data-tab="response-{{.ID}}">
|
2022-06-27 23:58:46 +03:00
|
|
|
{{$.locale.Tr "repo.settings.webhook.response"}}
|
2015-12-08 01:30:52 +03:00
|
|
|
{{if .ResponseInfo}}
|
|
|
|
{{if .IsSucceed}}
|
|
|
|
<span class="ui green label">{{.ResponseInfo.Status}}</span>
|
|
|
|
{{else}}
|
|
|
|
<span class="ui red label">{{.ResponseInfo.Status}}</span>
|
|
|
|
{{end}}
|
|
|
|
{{else}}
|
2023-05-02 12:54:29 +03:00
|
|
|
<span class="ui label">-</span>
|
2015-12-08 01:30:52 +03:00
|
|
|
{{end}}
|
|
|
|
</a>
|
2023-03-10 17:28:32 +03:00
|
|
|
{{if or $.Permission.IsAdmin $.IsOrganizationOwner $.PageIsAdmin $.PageIsUserSettings}}
|
2022-01-06 00:00:20 +03:00
|
|
|
<div class="right menu">
|
|
|
|
<form class="item" action="{{$.Link}}/replay/{{.UUID}}" method="post">
|
|
|
|
{{$.CsrfTokenHtml}}
|
2023-03-24 13:35:38 +03:00
|
|
|
<button class="ui tiny button" data-tooltip-content="{{$.locale.Tr "repo.settings.webhook.replay.description"}}">{{svg "octicon-sync"}}</button>
|
2022-01-06 00:00:20 +03:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
2015-12-08 01:30:52 +03:00
|
|
|
</div>
|
|
|
|
<div class="ui bottom attached tab segment active" data-tab="request-{{.ID}}">
|
|
|
|
{{if .RequestInfo}}
|
2022-06-27 23:58:46 +03:00
|
|
|
<h5>{{$.locale.Tr "repo.settings.webhook.headers"}}</h5>
|
2021-06-27 22:21:09 +03:00
|
|
|
<pre class="webhook-info"><strong>Request URL:</strong> {{.RequestInfo.URL}}
|
|
|
|
<strong>Request method:</strong> {{if .RequestInfo.HTTPMethod}}{{.RequestInfo.HTTPMethod}}{{else}}POST{{end}}
|
2022-08-31 18:58:54 +03:00
|
|
|
{{range $key, $val := .RequestInfo.Headers}}<strong>{{$key}}:</strong> {{$val}}
|
2015-08-27 18:06:14 +03:00
|
|
|
{{end}}</pre>
|
2022-06-27 23:58:46 +03:00
|
|
|
<h5>{{$.locale.Tr "repo.settings.webhook.payload"}}</h5>
|
2020-11-04 10:14:07 +03:00
|
|
|
<pre class="webhook-info"><code class="json">{{.PayloadContent}}</code></pre>
|
2015-12-08 01:30:52 +03:00
|
|
|
{{else}}
|
2023-05-02 12:54:29 +03:00
|
|
|
-
|
2015-12-08 01:30:52 +03:00
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
<div class="ui bottom attached tab segment" data-tab="response-{{.ID}}">
|
|
|
|
{{if .ResponseInfo}}
|
2022-06-27 23:58:46 +03:00
|
|
|
<h5>{{$.locale.Tr "repo.settings.webhook.headers"}}</h5>
|
2022-08-31 18:58:54 +03:00
|
|
|
<pre class="webhook-info">{{range $key, $val := .ResponseInfo.Headers}}<strong>{{$key}}:</strong> {{$val}}
|
2015-08-27 18:06:14 +03:00
|
|
|
{{end}}</pre>
|
2022-06-27 23:58:46 +03:00
|
|
|
<h5>{{$.locale.Tr "repo.settings.webhook.body"}}</h5>
|
2020-11-04 10:14:07 +03:00
|
|
|
<pre class="webhook-info"><code>{{.ResponseInfo.Body}}</code></pre>
|
2015-12-08 01:30:52 +03:00
|
|
|
{{else}}
|
2023-05-02 12:54:29 +03:00
|
|
|
-
|
2015-12-08 01:30:52 +03:00
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
2015-08-27 18:06:14 +03:00
|
|
|
</div>
|
2015-12-08 01:30:52 +03:00
|
|
|
{{end}}
|
2015-08-27 18:06:14 +03:00
|
|
|
</div>
|
|
|
|
</div>
|
2015-12-08 01:30:52 +03:00
|
|
|
{{end}}
|