history.tmpl 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. {{if .PageIsSettingsHooksEdit}}
  2. <h4 class="ui top attached header">
  3. {{.i18n.Tr "repo.settings.recent_deliveries"}}
  4. {{if .PageIsRepositoryContext}}
  5. <div class="ui right">
  6. <button class="ui teal tiny delivery button poping up" 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. {{if $.PageIsRepositoryContext}}
  44. <div class="right menu">
  45. <div class="ui basic redelivery button" data-link="{{$.Link}}/redelivery?uuid={{.UUID}}" data-redirect="{{$.Link}}"><i class="octicon octicon-sync"></i> <span>{{$.i18n.Tr "repo.settings.webhook.redelivery"}}</span></div>
  46. </div>
  47. {{end}}
  48. </div>
  49. <div class="ui bottom attached tab segment active" data-tab="request-{{.ID}}">
  50. {{if .RequestInfo}}
  51. <h5>{{$.i18n.Tr "repo.settings.webhook.headers"}}</h5>
  52. <pre class="raw"><strong>Request URL:</strong> {{.URL}}
  53. <strong>Request method:</strong> POST
  54. {{ range $key, $val := .RequestInfo.Headers }}<strong>{{$key}}:</strong> {{$val}}
  55. {{end}}</pre>
  56. <h5>{{$.i18n.Tr "repo.settings.webhook.payload"}}</h5>
  57. <pre class="raw"><code class="json">{{.PayloadContent}}</code></pre>
  58. {{else}}
  59. N/A
  60. {{end}}
  61. </div>
  62. <div class="ui bottom attached tab segment" data-tab="response-{{.ID}}">
  63. {{if .ResponseInfo}}
  64. <h5>{{$.i18n.Tr "repo.settings.webhook.headers"}}</h5>
  65. <pre class="raw">{{ range $key, $val := .ResponseInfo.Headers }}<strong>{{$key}}:</strong> {{$val}}
  66. {{end}}</pre>
  67. <h5>{{$.i18n.Tr "repo.settings.webhook.body"}}</h5>
  68. <pre class="raw"><code class="nohighlight">{{.ResponseInfo.Body}}</code></pre>
  69. {{else}}
  70. N/A
  71. {{end}}
  72. </div>
  73. </div>
  74. </div>
  75. {{end}}
  76. </div>
  77. </div>
  78. {{end}}