Commit c0c97507 by Qiang Xue

finished debugger.

parent 20d91bab
...@@ -24,6 +24,7 @@ class DefaultController extends Controller ...@@ -24,6 +24,7 @@ class DefaultController extends Controller
public function actionIndex() public function actionIndex()
{ {
return $this->render('index', array( return $this->render('index', array(
'manifest' => $this->getManifest(),
)); ));
} }
......
...@@ -4,11 +4,7 @@ use yii\helpers\Html; ...@@ -4,11 +4,7 @@ use yii\helpers\Html;
/** /**
* @var \yii\base\View $this * @var \yii\base\View $this
* @var array $meta
* @var string $tag
* @var array $manifest * @var array $manifest
* @var \yii\debug\Panel[] $panels
* @var \yii\debug\Panel $activePanel
*/ */
$this->registerAssetBundle('yii/bootstrap/dropdown'); $this->registerAssetBundle('yii/bootstrap/dropdown');
...@@ -24,4 +20,32 @@ $this->title = 'Yii Debugger'; ...@@ -24,4 +20,32 @@ $this->title = 'Yii Debugger';
</div> </div>
</div> </div>
</div> </div>
<div class="container-fluid">
<div class="row-fluid">
<h1>Available Debug Data</h1>
<table class="table table-condensed table-bordered table-striped table-hover" style="table-layout: fixed;">
<thead>
<tr>
<th style="width: 120px;">Tag</th>
<th style="width: 160px;">Time</th>
<th style="width: 120px;">IP</th>
<th style="width: 60px;">Method</th>
<th>URL</th>
</tr>
</thead>
<tbody>
<?php foreach ($manifest as $tag => $data): ?>
<tr>
<td><?php echo Html::a($tag, array('view', 'tag' => $tag)); ?></td>
<td><?php echo date('Y-m-d h:i:sa', $data['time']); ?></td>
<td><?php echo $data['ip']; ?></td>
<td><?php echo $data['method']; ?></td>
<td><?php echo $data['url']; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div> </div>
...@@ -43,25 +43,32 @@ $this->title = 'Yii Debugger'; ...@@ -43,25 +43,32 @@ $this->title = 'Yii Debugger';
<div class="span10"> <div class="span10">
<div class="meta alert alert-info"> <div class="meta alert alert-info">
<div class="btn-group"> <div class="btn-group">
<?php echo Html::a('All', array('index'), array('class' => 'btn')); ?>
<button class="btn dropdown-toggle" data-toggle="dropdown"> <button class="btn dropdown-toggle" data-toggle="dropdown">
View others Last 10
<span class="caret"></span> <span class="caret"></span>
</button> </button>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<?php foreach ($manifest as $tag2 => $meta2) { <?php
$count = 0;
foreach ($manifest as $tag2 => $meta2) {
$label = $meta2['method'] . ' ' . $meta2['url'] . ($meta2['ajax'] ? ' (AJAX)' : '') $label = $meta2['method'] . ' ' . $meta2['url'] . ($meta2['ajax'] ? ' (AJAX)' : '')
. ', ' . date('Y/m/d h:i:sa', $meta2['time']) . ', ' . date('Y-m-d h:i:sa', $meta2['time'])
. ', ' . $meta2['ip'] . ', ' . $tag2; . ', ' . $meta2['ip'] . ', ' . $tag2;
$url = array('view', 'tag' => $tag2); $url = array('view', 'tag' => $tag2);
echo '<li>' . Html::a(Html::encode($label), $url) . '</li>'; echo '<li>' . Html::a(Html::encode($label), $url) . '</li>';
} ?> if (++$count >= 10) {
break;
}
}
?>
</ul> </ul>
</div> </div>
Debugging: Debugging:
<?php echo $meta['method']; ?> <?php echo $meta['method']; ?>
<?php echo Html::a(Html::encode($meta['url']), $meta['url']); ?> <?php echo Html::a(Html::encode($meta['url']), $meta['url']); ?>
<?php echo $meta['ajax'] ? ' (AJAX)' : ''; ?> <?php echo $meta['ajax'] ? ' (AJAX)' : ''; ?>
at <?php echo date('Y/m/d h:i:sa', $meta['time']); ?> at <?php echo date('Y-m-d h:i:sa', $meta['time']); ?>
by <?php echo $meta['ip']; ?> by <?php echo $meta['ip']; ?>
</div> </div>
<?php echo $activePanel->getDetail(); ?> <?php echo $activePanel->getDetail(); ?>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment