2015-08-26 11:30:06 -05:00
|
|
|
{{if .PageIsSettingsHooksEdit}}
|
2015-12-07 16:30:52 -06:00
|
|
|
<h4 class="ui top attached header">
|
|
|
|
{{.i18n.Tr "repo.settings.recent_deliveries"}}
|
2018-11-28 05:26:14 -06:00
|
|
|
{{if .Permission.IsAdmin}}
|
2015-12-07 16:30:52 -06:00
|
|
|
<div class="ui right">
|
|
|
|
<button class="ui teal tiny button poping up" id="test-delivery" data-content=
|
|
|
|
"{{.i18n.Tr "repo.settings.webhook.test_delivery_desc"}}" data-variation="inverted tiny" data-link="{{.Link}}/test" data-redirect="{{.Link}}">{{.i18n.Tr "repo.settings.webhook.test_delivery"}}</button>
|
2015-08-27 10:06:14 -05:00
|
|
|
</div>
|
2015-12-07 16:30:52 -06:00
|
|
|
{{end}}
|
|
|
|
</h4>
|
2017-04-07 09:50:40 -05:00
|
|
|
<div class="ui attached segment">
|
|
|
|
<div class="ui list">
|
2015-12-07 16:30:52 -06:00
|
|
|
{{range .History}}
|
|
|
|
<div class="item">
|
|
|
|
<div class="meta">
|
|
|
|
{{if .IsSucceed}}
|
2020-02-11 11:02:41 -06:00
|
|
|
<span class="text green">{{svg "octicon-check" 16}}</span>
|
2015-12-07 16:30:52 -06:00
|
|
|
{{else}}
|
2020-02-11 11:02:41 -06:00
|
|
|
<span class="text red">{{svg "octicon-alert" 16}}</span>
|
2015-12-07 16:30:52 -06:00
|
|
|
{{end}}
|
|
|
|
<a class="ui blue sha label toggle button" data-target="#info-{{.ID}}">{{.UUID}}</a>
|
|
|
|
<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>
|
|
|
|
</div>
|
|
|
|
<div class="ui bottom attached tab segment active" data-tab="request-{{.ID}}">
|
|
|
|
{{if .RequestInfo}}
|
|
|
|
<h5>{{$.i18n.Tr "repo.settings.webhook.headers"}}</h5>
|
|
|
|
<pre class="raw"><strong>Request URL:</strong> {{.URL}}
|
2019-05-15 07:01:53 -05:00
|
|
|
<strong>Request method:</strong> {{if .HTTPMethod}}{{.HTTPMethod}}{{else}}POST{{end}}
|
2015-08-27 10:06:14 -05:00
|
|
|
{{ range $key, $val := .RequestInfo.Headers }}<strong>{{$key}}:</strong> {{$val}}
|
|
|
|
{{end}}</pre>
|
2015-12-07 16:30:52 -06:00
|
|
|
<h5>{{$.i18n.Tr "repo.settings.webhook.payload"}}</h5>
|
|
|
|
<pre class="raw"><code class="json">{{.PayloadContent}}</code></pre>
|
|
|
|
{{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>
|
|
|
|
<pre class="raw">{{ range $key, $val := .ResponseInfo.Headers }}<strong>{{$key}}:</strong> {{$val}}
|
2015-08-27 10:06:14 -05:00
|
|
|
{{end}}</pre>
|
2015-12-07 16:30:52 -06:00
|
|
|
<h5>{{$.i18n.Tr "repo.settings.webhook.body"}}</h5>
|
|
|
|
<pre class="raw"><code>{{.ResponseInfo.Body}}</code></pre>
|
|
|
|
{{else}}
|
|
|
|
N/A
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
2015-08-27 10:06:14 -05:00
|
|
|
</div>
|
2015-12-07 16:30:52 -06:00
|
|
|
{{end}}
|
2015-08-27 10:06:14 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
2015-12-07 16:30:52 -06:00
|
|
|
{{end}}
|