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.

view.php 3.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. /* @var $this \yii\web\View */
  3. /* @var $summary array */
  4. /* @var $tag string */
  5. /* @var $manifest array */
  6. /* @var $panels \yii\debug\Panel[] */
  7. /* @var $activePanel \yii\debug\Panel */
  8. use yii\bootstrap\ButtonDropdown;
  9. use yii\bootstrap\ButtonGroup;
  10. use yii\helpers\Url;
  11. use yii\helpers\Html;
  12. $this->title = 'Yii Debugger';
  13. ?>
  14. <div class="default-view">
  15. <div id="yii-debug-toolbar" class="yii-debug-toolbar-top">
  16. <div class="yii-debug-toolbar-block title">
  17. <a href="<?= Url::to(['index']) ?>">
  18. <img width="29" height="30" alt="" src="<?= \yii\debug\Module::getYiiLogo() ?>">
  19. Yii Debugger
  20. </a>
  21. </div>
  22. <?php foreach ($panels as $panel): ?>
  23. <?= $panel->getSummary() ?>
  24. <?php endforeach; ?>
  25. </div>
  26. <div class="container">
  27. <div class="row">
  28. <div class="col-lg-2 col-md-2">
  29. <div class="list-group">
  30. <?php
  31. foreach ($panels as $id => $panel) {
  32. $label = '<i class="glyphicon glyphicon-chevron-right"></i>' . Html::encode($panel->getName());
  33. echo Html::a($label, ['view', 'tag' => $tag, 'panel' => $id], [
  34. 'class' => $panel === $activePanel ? 'list-group-item active' : 'list-group-item',
  35. ]);
  36. }
  37. ?>
  38. </div>
  39. </div>
  40. <div class="col-lg-10 col-md-10">
  41. <div class="callout callout-danger">
  42. <?php
  43. $count = 0;
  44. $items = [];
  45. foreach ($manifest as $meta) {
  46. $label = $meta['tag'] . ': ' . $meta['method'] . ' ' . $meta['url'] . ($meta['ajax'] ? ' (AJAX)' : '')
  47. . ', ' . date('Y-m-d h:i:s a', $meta['time'])
  48. . ', ' . $meta['ip'];
  49. $url = ['view', 'tag' => $meta['tag'], 'panel' => $activePanel->id];
  50. $items[] = [
  51. 'label' => $label,
  52. 'url' => $url,
  53. ];
  54. if (++$count >= 10) {
  55. break;
  56. }
  57. }
  58. echo ButtonGroup::widget([
  59. 'buttons' => [
  60. Html::a('All', ['index'], ['class' => 'btn btn-default']),
  61. Html::a('Latest', ['view', 'panel' => $activePanel->id], ['class' => 'btn btn-default']),
  62. ButtonDropdown::widget([
  63. 'label' => 'Last 10',
  64. 'options' => ['class' => 'btn-default'],
  65. 'dropdown' => ['items' => $items],
  66. ]),
  67. ],
  68. ]);
  69. echo "\n" . $summary['tag'] . ': ' . $summary['method'] . ' ' . Html::a(Html::encode($summary['url']), $summary['url']);
  70. echo ' at ' . date('Y-m-d h:i:s a', $summary['time']) . ' by ' . $summary['ip'];
  71. ?>
  72. </div>
  73. <?= $activePanel->getDetail() ?>
  74. </div>
  75. </div>
  76. </div>
  77. </div>