You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

143 lines
4.7 KiB

  1. <?php $this->layout('layout-loggedin', ['title' => $title, 'accounts' => $accounts, 'user' => $user]); ?>
  2. <div class="ui main text container" style="margin-top: 80px; margin-bottom: 40px;">
  3. <h2>Webmention Request</h2>
  4. <table class="ui table details-table"><tbody>
  5. <tr>
  6. <td class="left"><b>Status</b></td>
  7. <td class="right">
  8. <i class="circular inverted <?= $icon ?> icon"></i>
  9. <?= ucfirst($status) ?>
  10. </td>
  11. </tr>
  12. <tr>
  13. <td class="left"><b>Date</b></td>
  14. <td class="right"><?= date('M j, g:ia', strtotime($webmention->created_at)) ?></td>
  15. </tr>
  16. <tr>
  17. <td class="left"><b>Source</b></td>
  18. <td class="right"><a href="<?= $this->e($webmention->source) ?>"><?= $this->e($webmention->source) ?></a></td>
  19. </tr>
  20. <tr>
  21. <td class="left"><b>Target</b></td>
  22. <td class="right"><a href="<?= $this->e($webmention->target) ?>"><?= $this->e($webmention->target) ?></a></td>
  23. </tr>
  24. <? if($webmention->vouch): ?>
  25. <tr>
  26. <td class="left"><b>Vouch</b></td>
  27. <td class="right"><a href="<?= $this->e($webmention->vouch) ?>"><?= $this->e($webmention->vouch) ?></a></td>
  28. </tr>
  29. <? endif; ?>
  30. <? if($webmention->code): ?>
  31. <tr>
  32. <td class="left"><b>Code</b></td>
  33. <td class="right"><code><?= $this->e($webmention->code) ?></code></td>
  34. </tr>
  35. <? endif; ?>
  36. <? if($webmention->realm): ?>
  37. <tr>
  38. <td class="left"><b>Realm</b></td>
  39. <td class="right"><code><?= $this->e($webmention->realm) ?></code></td>
  40. </tr>
  41. <? endif; ?>
  42. <? if($webmention->callback): ?>
  43. <tr>
  44. <td class="left"><b>Callback URL</b></td>
  45. <td class="right"><?= $this->e($webmention->callback) ?></td>
  46. </tr>
  47. <? endif; ?>
  48. <?php if($role && $status != 'pending'): ?>
  49. <tr>
  50. <td class="left">
  51. </td>
  52. <td class="right">
  53. <form action="/webmention" method="post">
  54. <input type="hidden" name="source" value="<?= $this->e($webmention->source) ?>">
  55. <input type="hidden" name="target" value="<?= $this->e($webmention->target) ?>">
  56. <input type="hidden" name="token" value="<?= $this->e($role->token) ?>">
  57. <input type="hidden" name="_redirect" value="true">
  58. <input type="submit" class="ui tiny button" value="Send Again">
  59. </form>
  60. </td>
  61. </tr>
  62. <?php endif ?>
  63. </tbody></table>
  64. <h2>Details</h2>
  65. <? if(count($statuses) == 0): ?>
  66. <p>The request is queued for processing. Refresh this page for updates.</p>
  67. <? else: ?>
  68. <table class="ui table single line"><tbody>
  69. <? if($webmention->webmention_endpoint): ?>
  70. <tr>
  71. <td><b>Webmention Endpoint</b></td>
  72. <td><a href="<?= $this->e($webmention->webmention_endpoint) ?>"><?= $this->e($webmention->webmention_endpoint) ?></a></td>
  73. </tr>
  74. <? endif; ?>
  75. <? if($webmention->pingback_endpoint): ?>
  76. <tr>
  77. <td><b>Pingback Endpoint</b></td>
  78. <td><a href="<?= $this->e($webmention->pingback_endpoint) ?>"><?= $this->e($webmention->pingback_endpoint) ?></a></td>
  79. </tr>
  80. <? endif; ?>
  81. <? if($webmention->webmention_endpoint == false && $webmention->pingback_endpoint == false): ?>
  82. <tr>
  83. <td><b>Webmention Endpoint</b></td>
  84. <td>No webmention endpoint was discovered for this target</td>
  85. </tr>
  86. <? endif; ?>
  87. <? if($webmention->webmention_endpoint): ?>
  88. <tr>
  89. <td><b>Status URL</b></td>
  90. <td>
  91. <? if($webmention->webmention_status_url): ?>
  92. <a href="<?= $this->e($webmention->webmention_status_url) ?>"><?= $this->e($webmention->webmention_status_url) ?></a>
  93. <? else: ?>
  94. The webmention endpoint did not return a status URL
  95. <? endif; ?>
  96. </td>
  97. </tr>
  98. <? endif; ?>
  99. </tbody></table>
  100. <h2>Logs</h2>
  101. <table class="ui very compact table logs">
  102. <thead>
  103. <tr>
  104. <th>Date</th>
  105. <th>Status</th>
  106. <th>HTTP Code</th>
  107. </tr>
  108. </thead>
  109. <tbody>
  110. <? foreach($statuses as $status): ?>
  111. <tr>
  112. <td><?= date('M j, g:ia', strtotime($status->created_at)) ?></td>
  113. <td><?= $status->status ?></td>
  114. <td><?= $status->http_code ?></td>
  115. </tr>
  116. <tr>
  117. <td colspan="3">
  118. <pre style="font-size: 10px;"><?
  119. $json = @json_decode($status->raw_response);
  120. if($json) {
  121. echo json_encode($json, JSON_UNESCAPED_SLASHES+JSON_PRETTY_PRINT);
  122. } else {
  123. echo $this->e($status->raw_response);
  124. }
  125. ?></pre>
  126. </td>
  127. </tr>
  128. <? endforeach; ?>
  129. </tbody>
  130. </table>
  131. <? endif; ?>
  132. </div>