hook_history.tmpl 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. {{if .PageIsSettingsHooksEdit}}
  2. <h4 class="ui top attached header">
  3. {{.i18n.Tr "repo.settings.recent_deliveries"}}
  4. </h4>
  5. <div class="ui attached table segment">
  6. <div class="ui hook history list">
  7. {{range .History}}
  8. <div class="item">
  9. <div class="meta">
  10. {{if .IsSucceed}}
  11. <span class="text green"><i class="octicon octicon-check"></i></span>
  12. {{else}}
  13. <span class="text red"><i class="octicon octicon-alert"></i></span>
  14. {{end}}
  15. <a class="ui blue sha label toggle button" data-target="#info-{{.ID}}">{{.UUID}}</a>
  16. <div class="ui right">
  17. <span class="text grey time">
  18. {{.DeliveredString}}
  19. </span>
  20. </div>
  21. </div>
  22. <div class="info hide" id="info-{{.ID}}">
  23. <div class="ui top attached tabular menu">
  24. <a class="item active" data-tab="request-{{.ID}}">{{$.i18n.Tr "repo.settings.webhook.request"}}</a>
  25. <a class="item" data-tab="response-{{.ID}}">
  26. {{$.i18n.Tr "repo.settings.webhook.response"}}
  27. {{if .ResponseInfo}}
  28. {{if .IsSucceed}}
  29. <span class="ui green label">{{.ResponseInfo.Status}}</span>
  30. {{else}}
  31. <span class="ui red label">{{.ResponseInfo.Status}}</span>
  32. {{end}}
  33. {{else}}
  34. <span class="ui label">N/A</span>
  35. {{end}}
  36. </a>
  37. </div>
  38. <div class="ui bottom attached tab segment active" data-tab="request-{{.ID}}">
  39. {{if .RequestInfo}}
  40. <h5>{{$.i18n.Tr "repo.settings.webhook.headers"}}</h5>
  41. <pre class="raw"><strong>Request URL:</strong> {{.URL}}
  42. <strong>Request method:</strong> POST
  43. {{ range $key, $val := .RequestInfo.Headers }}<strong>{{$key}}:</strong> {{$val}}
  44. {{end}}</pre>
  45. <h5>{{$.i18n.Tr "repo.settings.webhook.payload"}}</h5>
  46. <pre class="raw"><code class="json">{{.PayloadContent}}</code></pre>
  47. {{else}}
  48. N/A
  49. {{end}}
  50. </div>
  51. <div class="ui bottom attached tab segment" data-tab="response-{{.ID}}">
  52. {{if .ResponseInfo}}
  53. <h5>{{$.i18n.Tr "repo.settings.webhook.headers"}}</h5>
  54. <pre class="raw">{{ range $key, $val := .ResponseInfo.Headers }}<strong>{{$key}}:</strong> {{$val}}
  55. {{end}}</pre>
  56. <h5>{{$.i18n.Tr "repo.settings.webhook.body"}}</h5>
  57. <pre class="raw"><code>{{.ResponseInfo.Body}}</code></pre>
  58. {{else}}
  59. N/A
  60. {{end}}
  61. </div>
  62. </div>
  63. </div>
  64. {{end}}
  65. </div>
  66. </div>
  67. {{end}}