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

Qiang Xue committed
3 4
use yii\bootstrap\AffixAsset;
use yii\bootstrap\DropdownAsset;
Qiang Xue committed
5 6 7 8
use yii\helpers\Html;

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

$this->title = 'Yii Debugger';
Qiang Xue committed
17 18
DropdownAsset::register($this);
AffixAsset::register($this);
Qiang Xue committed
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
?>
<div class="default-view">
	<div class="navbar">
		<div class="navbar-inner">
			<div class="container">
				<div class="yii-debug-toolbar-block title">
					Yii Debugger
				</div>
				<?php foreach ($panels as $panel): ?>
					<?php echo $panel->getSummary(); ?>
				<?php endforeach; ?>
			</div>
		</div>
	</div>

	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span2">
Qiang Xue committed
37 38 39 40 41 42 43 44
				<ul class="nav nav-tabs nav-list nav-stacked">
					<?php
					foreach ($panels as $id => $panel) {
						$link = Html::a(Html::encode($panel->getName()), array('view', 'tag' => $tag, 'panel' => $id));
						echo Html::tag('li', $link, array('class' => $panel === $activePanel ? 'active' : null));
					}
					?>
				</ul>
Qiang Xue committed
45 46 47 48
			</div><!--/span-->
			<div class="span10">
				<div class="meta alert alert-info">
					<div class="btn-group">
Qiang Xue committed
49
						<?php echo Html::a('All', array('index'), array('class' => 'btn')); ?>
Qiang Xue committed
50
						<button class="btn dropdown-toggle" data-toggle="dropdown">
Qiang Xue committed
51
							Last 10
Qiang Xue committed
52 53 54
							<span class="caret"></span>
						</button>
						<ul class="dropdown-menu">
Qiang Xue committed
55 56
							<?php
							$count = 0;
Qiang Xue committed
57 58 59 60
							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'];
61
								$url = array('view', 'tag' => $meta['tag'], 'panel' => $activePanel->id);
Qiang Xue committed
62
								echo '<li>' . Html::a(Html::encode($label), $url) . '</li>';
Qiang Xue committed
63 64 65 66 67
								if (++$count >= 10) {
									break;
								}
							}
							?>
Qiang Xue committed
68 69
						</ul>
					</div>
Qiang Xue committed
70 71 72 73 74 75
					<?php echo $summary['tag']; ?>:
					<?php echo $summary['method']; ?>
					<?php echo Html::a(Html::encode($summary['url']), $summary['url'], array('class' => 'label')); ?>
					<?php echo $summary['ajax'] ? ' (AJAX)' : ''; ?>
					at <?php echo date('Y-m-d h:i:s a', $summary['time']); ?>
					by <?php echo $summary['ip']; ?>
Qiang Xue committed
76 77 78 79 80 81
				</div>
				<?php echo $activePanel->getDetail(); ?>
			</div>
		</div>
	</div>
</div>