hook_history.tmpl 2.7 KB

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