|
11 | 11 | * @since DebugKit 1.1 |
12 | 12 | * @license http://www.opensource.org/licenses/mit-license.php MIT License |
13 | 13 | */ |
14 | | - |
15 | 14 | /** |
16 | 15 | * @var \DebugKit\View\AjaxView $this |
17 | 16 | * @var \DebugKit\Model\Entity\Panel $panel |
|
20 | 19 | ?> |
21 | 20 | <div id="request-history"> |
22 | 21 | <?php if (empty($requests)): ?> |
23 | | - <p class="warning"><?= __d('debug_kit', 'No previous requests logged.') ?></p> |
| 22 | + <p class="warning"> |
| 23 | + <?= __d('debug_kit', 'No requests logged.') ?> |
| 24 | + <button type="button" onclick="toolbar.loadPanel('latest-history')"><?= __d('debug_kit', 'Reload') ?></button> |
| 25 | + </p> |
24 | 26 | <?php else: ?> |
25 | | - <p><?= count($requests) ?> <?= __d('debug_kit', 'previous requests available') ?></p> |
| 27 | + <p> |
| 28 | + <?= count($requests) ?> <?= __d('debug_kit', 'requests available') ?> |
| 29 | + <button type="button" onclick="toolbar.loadPanel('latest-history')"><?= __d('debug_kit', 'Reload') ?></button> |
| 30 | + </p> |
26 | 31 | <ul class="history-list"> |
27 | 32 | <li> |
28 | | - <?= $this->Html->link( |
29 | | - __d('debug_kit', 'Back to current request'), |
30 | | - ['plugin' => 'DebugKit', 'controller' => 'Panels', 'action' => 'index', $panel->request_id], |
31 | | - ['class' => 'history-link', 'data-request' => $panel->request_id] |
32 | | - ) ?> |
| 33 | + <?php $url = ['plugin' => 'DebugKit', 'controller' => 'Panels', 'action' => 'index', $panel->request_id] ?> |
| 34 | + <a class="history-link" data-request="<?= $panel->request_id ?>" href="<?= $this->Url->build($url) ?>"> |
| 35 | + <span class="history-time"><?= h($panel->request->requested_at) ?></span> |
| 36 | + <span class="history-bubble"><?= h($panel->request->method) ?></span> |
| 37 | + <span class="history-bubble"><?= h($panel->request->status_code) ?></span> |
| 38 | + <span class="history-bubble"><?= h($panel->request->content_type) ?></span> |
| 39 | + <span class="history-url"><?= h($panel->request->url) ?></span> |
| 40 | + </a> |
33 | 41 | </li> |
34 | 42 | <?php foreach ($requests as $request): ?> |
35 | 43 | <?php $url = ['plugin' => 'DebugKit', 'controller' => 'Panels', 'action' => 'index', $request->id] ?> |
|
47 | 55 | <?php endif; ?> |
48 | 56 | </div> |
49 | 57 | <script type="text/html" id="list-template"> |
| 58 | + <p> |
| 59 | + <button type="button" onclick="toolbar.loadPanel('latest-history')"><?= __d('debug_kit', 'Reload') ?></button> |
| 60 | + </p> |
50 | 61 | <ul class="history-list"> |
51 | 62 | <li> |
52 | | - <?= $this->Html->link( |
53 | | - __d('debug_kit', 'Back to current request'), |
54 | | - ['plugin' => 'DebugKit', 'controller' => 'Panels', 'action' => 'index', $panel->request_id], |
55 | | - ['class' => 'history-link', 'data-request' => $panel->request_id] |
56 | | - ) ?> |
| 63 | + <?php $url = ['plugin' => 'DebugKit', 'controller' => 'Panels', 'action' => 'index', $panel->request_id] ?> |
| 64 | + <a class="history-link" data-request="<?= $panel->request_id ?>" href="<?= $this->Url->build($url) ?>"> |
| 65 | + <span class="history-time"><?= h($panel->request->requested_at) ?></span> |
| 66 | + <span class="history-bubble"><?= h($panel->request->method) ?></span> |
| 67 | + <span class="history-bubble"><?= h($panel->request->status_code) ?></span> |
| 68 | + <span class="history-bubble"><?= h($panel->request->content_type) ?></span> |
| 69 | + <span class="history-url"><?= h($panel->request->url) ?></span> |
| 70 | + </a> |
57 | 71 | </li> |
58 | 72 | </ul> |
59 | 73 | </script> |
|
0 commit comments