view.php 2.13 KB
Newer Older
Qiang Xue committed
1 2
<?php

3 4
use yii\bootstrap\ButtonDropdown;
use yii\bootstrap\ButtonGroup;
Qiang Xue committed
5 6 7
use yii\helpers\Html;

/**
Alexander Makarov committed
8
 * @var \yii\web\View $this
Qiang Xue committed
9
 * @var array $summary
Qiang Xue committed
10 11 12 13 14 15 16 17 18
 * @var string $tag
 * @var array $manifest
 * @var \yii\debug\Panel[] $panels
 * @var \yii\debug\Panel $activePanel
 */

$this->title = 'Yii Debugger';
?>
<div class="default-view">
19 20 21
	<div id="yii-debug-toolbar">
		<div class="yii-debug-toolbar-block title">
			Yii Debugger
Qiang Xue committed
22
		</div>
23
		<?php foreach ($panels as $panel): ?>
Alexander Makarov committed
24
			<?= $panel->getSummary() ?>
25
		<?php endforeach; ?>
Qiang Xue committed
26 27
	</div>

28 29 30
	<div class="container">
		<div class="row">
			<div class="col-lg-2">
Qiang Xue committed
31
				<div class="list-group">
Qiang Xue committed
32 33
					<?php
					foreach ($panels as $id => $panel) {
Qiang Xue committed
34
						$label = '<i class="glyphicon glyphicon-chevron-right"></i>' . Html::encode($panel->getName());
Alexander Makarov committed
35
						echo Html::a($label, ['view', 'tag' => $tag, 'panel' => $id], [
Qiang Xue committed
36
							'class' => $panel === $activePanel ? 'list-group-item active' : 'list-group-item',
Alexander Makarov committed
37
						]);
Qiang Xue committed
38 39
					}
					?>
Qiang Xue committed
40 41
				</div>
			</div>
42
			<div class="col-lg-10">
43 44 45
				<div class="callout callout-danger">
					<?php
						$count = 0;
Alexander Makarov committed
46
						$items = [];
47 48 49 50
						foreach ($manifest as $meta) {
							$label = $meta['tag'] . ': ' . $meta['method'] . ' ' . $meta['url'] . ($meta['ajax'] ? ' (AJAX)' : '')
								. ', ' . date('Y-m-d h:i:s a', $meta['time'])
								. ', ' . $meta['ip'];
Alexander Makarov committed
51 52
							$url = ['view', 'tag' => $meta['tag'], 'panel' => $activePanel->id];
							$items[] = [
53 54
								'label' => $label,
								'url' => $url,
Alexander Makarov committed
55
							];
56 57
							if (++$count >= 10) {
								break;
Qiang Xue committed
58
							}
59
						}
Alexander Makarov committed
60 61 62 63
						echo ButtonGroup::widget([
							'buttons' => [
								Html::a('All', ['index'], ['class' => 'btn btn-default']),
								ButtonDropdown::widget([
64
									'label' => 'Last 10',
Alexander Makarov committed
65 66 67 68 69
									'options' => ['class' => 'btn-default'],
									'dropdown' => ['items' => $items],
								]),
							],
						]);
70 71 72
						echo "\n" . $summary['tag'] . ': ' . $summary['method'] . ' ' . Html::a(Html::encode($summary['url']), $summary['url']);
						echo ' at ' . date('Y-m-d h:i:s a', $summary['time']) . ' by ' . $summary['ip'];
					?>
Qiang Xue committed
73
				</div>
Alexander Makarov committed
74
				<?= $activePanel->getDetail() ?>
Qiang Xue committed
75 76 77 78
			</div>
		</div>
	</div>
</div>