summaryrefslogtreecommitdiffstats
path: root/templates/repo/settings
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-08-27 23:06:14 +0800
committerUnknwon <u@gogs.io>2015-08-27 23:06:14 +0800
commit23f42d92c917564435a00e8e75633b8056bd7b0d (patch)
tree6fed7f6df4c6b039e4e43eaae2fcd5788ddba3a0 /templates/repo/settings
parentfc2d0e5470fa2fea260adba30866acda1aa945cb (diff)
downloadgitea-23f42d92c917564435a00e8e75633b8056bd7b0d.tar.gz
gitea-23f42d92c917564435a00e8e75633b8056bd7b0d.zip
add webhook recent deliveries
Diffstat (limited to 'templates/repo/settings')
-rw-r--r--templates/repo/settings/hook_history.tmpl63
1 files changed, 61 insertions, 2 deletions
diff --git a/templates/repo/settings/hook_history.tmpl b/templates/repo/settings/hook_history.tmpl
index 5bb4ca6a20..850a38a607 100644
--- a/templates/repo/settings/hook_history.tmpl
+++ b/templates/repo/settings/hook_history.tmpl
@@ -2,7 +2,66 @@
<h4 class="ui top attached header">
{{.i18n.Tr "repo.settings.recent_deliveries"}}
</h4>
-<div class="ui attached segment">
- Coming soon!
+<div class="ui attached table segment">
+ <div class="ui hook history list">
+ {{range .History}}
+ <div class="item">
+ <div class="meta">
+ {{if .IsSucceed}}
+ <span class="text green"><i class="octicon octicon-check"></i></span>
+ {{else}}
+ <span class="text red"><i class="octicon octicon-alert"></i></span>
+ {{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">500</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}}
+<strong>Request method:</strong> POST
+{{ range $key, $val := .RequestInfo.Headers }}<strong>{{$key}}:</strong> {{$val}}
+{{end}}</pre>
+ <h5>{{$.i18n.Tr "repo.settings.webhook.payload"}}</h5>
+ <pre class="raw">{{.PayloadContent}}</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}}
+{{end}}</pre>
+ <h5>{{$.i18n.Tr "repo.settings.webhook.body"}}</h5>
+ <pre class="raw">{{.ResponseInfo.Body}}</pre>
+ {{else}}
+ N/A
+ {{end}}
+ </div>
+ </div>
+ </div>
+ {{end}}
+ </div>
</div>
{{end}} \ No newline at end of file