Commit c0c97507 by Qiang Xue

finished debugger.

parent 20d91bab
......@@ -24,6 +24,7 @@ class DefaultController extends Controller
public function actionIndex()
{
return $this->render('index', array(
'manifest' => $this->getManifest(),
));
}
......
......@@ -4,11 +4,7 @@ use yii\helpers\Html;
/**
* @var \yii\base\View $this
* @var array $meta
* @var string $tag
* @var array $manifest
* @var \yii\debug\Panel[] $panels
* @var \yii\debug\Panel $activePanel
*/
$this->registerAssetBundle('yii/bootstrap/dropdown');
......@@ -24,4 +20,32 @@ $this->title = 'Yii Debugger';
</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>
......@@ -43,25 +43,32 @@ $this->title = 'Yii Debugger';
<div class="span10">
<div class="meta alert alert-info">
<div class="btn-group">
<?php echo Html::a('All', array('index'), array('class' => 'btn')); ?>
<button class="btn dropdown-toggle" data-toggle="dropdown">
View others
Last 10
<span class="caret"></span>
</button>
<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)' : '')
. ', ' . date('Y/m/d h:i:sa', $meta2['time'])
. ', ' . date('Y-m-d h:i:sa', $meta2['time'])
. ', ' . $meta2['ip'] . ', ' . $tag2;
$url = array('view', 'tag' => $tag2);
echo '<li>' . Html::a(Html::encode($label), $url) . '</li>';
} ?>
if (++$count >= 10) {
break;
}
}
?>
</ul>
</div>
Debugging:
<?php echo $meta['method']; ?>
<?php echo Html::a(Html::encode($meta['url']), $meta['url']); ?>
<?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']; ?>
</div>
<?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