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.

110 lines
3.5 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->callback): ?>
  31. <tr>
  32. <td class="left"><b>Callback URL</b></td>
  33. <td class="right"><?= $this->e($webmention->callback) ?></td>
  34. </tr>
  35. <? endif; ?>
  36. </tbody></table>
  37. <h2>Details</h2>
  38. <? if(count($statuses) == 0): ?>
  39. <p>The request is queued for processing. Check for updates again later.</p>
  40. <? else: ?>
  41. <table class="ui table single line"><tbody>
  42. <? if($webmention->webmention_endpoint): ?>
  43. <tr>
  44. <td><b>Webmention Endpoint</b></td>
  45. <td><?= $this->e($webmention->webmention_endpoint) ?></td>
  46. </tr>
  47. <? endif; ?>
  48. <? if($webmention->pingback_endpoint): ?>
  49. <tr>
  50. <td><b>Pingback Endpoint</b></td>
  51. <td><?= $this->e($webmention->pingback_endpoint) ?></td>
  52. </tr>
  53. <? endif; ?>
  54. <? if($webmention->webmention_endpoint == false && $webmention->pingback_endpoint == false): ?>
  55. <tr>
  56. <td><b>Webmention Endpoint</b></td>
  57. <td>No webmention endpoint was discovered for this target</td>
  58. </tr>
  59. <? endif; ?>
  60. <? if($webmention->webmention_endpoint): ?>
  61. <tr>
  62. <td><b>Status URL</b></td>
  63. <td><?= $webmention->webmention_status_url ? $this->e($webmention->webmention_status_url) : 'The webmention endpoint did not return a status URL' ?></td>
  64. </tr>
  65. <? endif; ?>
  66. </tbody></table>
  67. <h2>Logs</h2>
  68. <table class="ui very compact table">
  69. <thead>
  70. <tr>
  71. <th>Date</th>
  72. <th>Status</th>
  73. <th>HTTP Code</th>
  74. </tr>
  75. </thead>
  76. <tbody>
  77. <? foreach($statuses as $status): ?>
  78. <tr>
  79. <td><?= date('M j, g:ia', strtotime($status->created_at)) ?></td>
  80. <td><?= $status->status ?></td>
  81. <td><?= $status->http_code ?></td>
  82. </tr>
  83. <tr>
  84. <td colspan="3">
  85. <pre style="font-size: 10px;"><?
  86. $json = @json_decode($status->raw_response);
  87. if($json) {
  88. $pretty = new Camspiers\JsonPretty\JsonPretty;
  89. echo $this->e($pretty->prettify($json, null, " "));
  90. } else {
  91. echo $this->e($status->raw_response);
  92. }
  93. ?></pre>
  94. </td>
  95. </tr>
  96. <? endforeach; ?>
  97. </tbody>
  98. </table>
  99. <? endif; ?>
  100. </div>