2015-08-26 22:00:06 +05:30
|
|
|
{{if .PageIsSettingsHooksEdit}}
|
2015-12-08 04:00:52 +05:30
|
|
|
<h4 class="ui top attached header">
|
|
|
|
{{.i18n.Tr "repo.settings.recent_deliveries"}}
|
2018-11-28 16:56:14 +05:30
|
|
|
{{if .Permission.IsAdmin}}
|
2015-12-08 04:00:52 +05:30
|
|
|
<div class="ui right">
|
2021-11-18 08:56:50 +05:30
|
|
|
<button class="ui teal tiny button tooltip" id="test-delivery" data-content=
|
|
|
|
"{{.i18n.Tr "repo.settings.webhook.test_delivery_desc"}}" data-link="{{.Link}}/test" data-redirect="{{.Link}}">{{.i18n.Tr "repo.settings.webhook.test_delivery"}}</button>
|
2015-08-27 20:36:14 +05:30
|
|
|
</div>
|
2015-12-08 04:00:52 +05:30
|
|
|
{{end}}
|
|
|
|
</h4>
|
2017-04-07 20:20:40 +05:30
|
|
|
<div class="ui attached segment">
|
|
|
|
<div class="ui list">
|
2015-12-08 04:00:52 +05:30
|
|
|
{{range .History}}
|
|
|
|
<div class="item">
|
|
|
|
<div class="meta">
|
|
|
|
{{if .IsSucceed}}
|
2020-09-12 01:49:00 +05:30
|
|
|
<span class="text green">{{svg "octicon-check"}}</span>
|
2015-12-08 04:00:52 +05:30
|
|
|
{{else}}
|
2020-09-12 01:49:00 +05:30
|
|
|
<span class="text red">{{svg "octicon-alert"}}</span>
|
2015-12-08 04:00:52 +05:30
|
|
|
{{end}}
|
2022-05-20 03:38:08 +05:30
|
|
|
<a class="ui primary sha label toggle button" data-target="#info-{{.ID}}">{{.UUID}}</a>
|
2015-12-08 04:00:52 +05:30
|
|
|
<div class="ui right">
|
|
|
|
<span class="text grey time">
|
|
|
|
{{.DeliveredString}}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="info hide" id="info-{{.ID}}">
|
|
|
|
<div class="ui top attached tabular menu">
|
|
|
|
<a class="item active" data-tab="request-{{.ID}}">{{$.i18n.Tr "repo.settings.webhook.request"}}</a>
|
|
|
|
<a class="item" data-tab="response-{{.ID}}">
|
|
|
|
{{$.i18n.Tr "repo.settings.webhook.response"}}
|
|
|
|
{{if .ResponseInfo}}
|
|
|
|
{{if .IsSucceed}}
|
|
|
|
<span class="ui green label">{{.ResponseInfo.Status}}</span>
|
|
|
|
{{else}}
|
|
|
|
<span class="ui red label">{{.ResponseInfo.Status}}</span>
|
|
|
|
{{end}}
|
|
|
|
{{else}}
|
|
|
|
<span class="ui label">N/A</span>
|
|
|
|
{{end}}
|
|
|
|
</a>
|
2022-01-06 02:30:20 +05:30
|
|
|
{{if or $.Permission.IsAdmin $.IsOrganizationOwner $.PageIsAdmin}}
|
|
|
|
<div class="right menu">
|
|
|
|
<form class="item" action="{{$.Link}}/replay/{{.UUID}}" method="post">
|
|
|
|
{{$.CsrfTokenHtml}}
|
|
|
|
<button class="ui tiny button tooltip" data-content="{{$.i18n.Tr "repo.settings.webhook.replay.description"}}" data-variation="inverted tiny">{{svg "octicon-sync"}}</button>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
2015-12-08 04:00:52 +05:30
|
|
|
</div>
|
|
|
|
<div class="ui bottom attached tab segment active" data-tab="request-{{.ID}}">
|
|
|
|
{{if .RequestInfo}}
|
|
|
|
<h5>{{$.i18n.Tr "repo.settings.webhook.headers"}}</h5>
|
2021-06-28 00:51:09 +05:30
|
|
|
<pre class="webhook-info"><strong>Request URL:</strong> {{.RequestInfo.URL}}
|
|
|
|
<strong>Request method:</strong> {{if .RequestInfo.HTTPMethod}}{{.RequestInfo.HTTPMethod}}{{else}}POST{{end}}
|
2015-08-27 20:36:14 +05:30
|
|
|
{{ range $key, $val := .RequestInfo.Headers }}<strong>{{$key}}:</strong> {{$val}}
|
|
|
|
{{end}}</pre>
|
2015-12-08 04:00:52 +05:30
|
|
|
<h5>{{$.i18n.Tr "repo.settings.webhook.payload"}}</h5>
|
2020-11-04 12:44:07 +05:30
|
|
|
<pre class="webhook-info"><code class="json">{{.PayloadContent}}</code></pre>
|
2015-12-08 04:00:52 +05:30
|
|
|
{{else}}
|
|
|
|
N/A
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
<div class="ui bottom attached tab segment" data-tab="response-{{.ID}}">
|
|
|
|
{{if .ResponseInfo}}
|
|
|
|
<h5>{{$.i18n.Tr "repo.settings.webhook.headers"}}</h5>
|
2020-11-04 12:44:07 +05:30
|
|
|
<pre class="webhook-info">{{ range $key, $val := .ResponseInfo.Headers }}<strong>{{$key}}:</strong> {{$val}}
|
2015-08-27 20:36:14 +05:30
|
|
|
{{end}}</pre>
|
2015-12-08 04:00:52 +05:30
|
|
|
<h5>{{$.i18n.Tr "repo.settings.webhook.body"}}</h5>
|
2020-11-04 12:44:07 +05:30
|
|
|
<pre class="webhook-info"><code>{{.ResponseInfo.Body}}</code></pre>
|
2015-12-08 04:00:52 +05:30
|
|
|
{{else}}
|
|
|
|
N/A
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
2015-08-27 20:36:14 +05:30
|
|
|
</div>
|
2015-12-08 04:00:52 +05:30
|
|
|
{{end}}
|
2015-08-27 20:36:14 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
2015-12-08 04:00:52 +05:30
|
|
|
{{end}}
|