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.

128 lines
4.2 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. </tbody></table>
  49. <h2>Details</h2>
  50. <? if(count($statuses) == 0): ?>
  51. <p>The request is queued for processing. Check for updates again later.</p>
  52. <? else: ?>
  53. <table class="ui table single line"><tbody>
  54. <? if($webmention->webmention_endpoint): ?>
  55. <tr>
  56. <td><b>Webmention Endpoint</b></td>
  57. <td><a href="<?= $this->e($webmention->webmention_endpoint) ?>"><?= $this->e($webmention->webmention_endpoint) ?></a></td>
  58. </tr>
  59. <? endif; ?>
  60. <? if($webmention->pingback_endpoint): ?>
  61. <tr>
  62. <td><b>Pingback Endpoint</b></td>
  63. <td><a href="<?= $this->e($webmention->pingback_endpoint) ?>"><?= $this->e($webmention->pingback_endpoint) ?></a></td>
  64. </tr>
  65. <? endif; ?>
  66. <? if($webmention->webmention_endpoint == false && $webmention->pingback_endpoint == false): ?>
  67. <tr>
  68. <td><b>Webmention Endpoint</b></td>
  69. <td>No webmention endpoint was discovered for this target</td>
  70. </tr>
  71. <? endif; ?>
  72. <? if($webmention->webmention_endpoint): ?>
  73. <tr>
  74. <td><b>Status URL</b></td>
  75. <td>
  76. <? if($webmention->webmention_status_url): ?>
  77. <a href="<?= $this->e($webmention->webmention_status_url) ?>"><?= $this->e($webmention->webmention_status_url) ?></a>
  78. <? else: ?>
  79. The webmention endpoint did not return a status URL
  80. <? endif; ?>
  81. </td>
  82. </tr>
  83. <? endif; ?>
  84. </tbody></table>
  85. <h2>Logs</h2>
  86. <table class="ui very compact table logs">
  87. <thead>
  88. <tr>
  89. <th>Date</th>
  90. <th>Status</th>
  91. <th>HTTP Code</th>
  92. </tr>
  93. </thead>
  94. <tbody>
  95. <? foreach($statuses as $status): ?>
  96. <tr>
  97. <td><?= date('M j, g:ia', strtotime($status->created_at)) ?></td>
  98. <td><?= $status->status ?></td>
  99. <td><?= $status->http_code ?></td>
  100. </tr>
  101. <tr>
  102. <td colspan="3">
  103. <pre style="font-size: 10px;"><?
  104. $json = @json_decode($status->raw_response);
  105. if($json) {
  106. $pretty = new Camspiers\JsonPretty\JsonPretty;
  107. echo $this->e($pretty->prettify($json, null, " "));
  108. } else {
  109. echo $this->e($status->raw_response);
  110. }
  111. ?></pre>
  112. </td>
  113. </tr>
  114. <? endforeach; ?>
  115. </tbody>
  116. </table>
  117. <? endif; ?>
  118. </div>