Commit 5cb93492 by Tobias Munk Committed by Alexander Makarov

Fixes #6113: Improved debugger configuration and request UI

- Responsive tables. - Route is displayed by default, action is available as tooltip. - Better config table display. - PHP extensions are sorted alphabetically.
parent ec9d33db
......@@ -7,6 +7,7 @@ Yii Framework 2 debug extension Change Log
- Bug #5402: Debugger was not loading when there were closures in asset classes (samdark)
- Bug #5745: Gii and debug modules may cause 404 exception when the route contains dashes (qiangxue)
- Enh #5600: Allow configuring debug panels in `yii\debug\Module::panels` as panel class name strings (qiangxue)
- Enh #6113: Improved configuration and request UI (schmunk42)
- Enh: Made `DefaultController::getManifest()` more robust against corrupt files (cebe)
......
......@@ -56,6 +56,7 @@ class ConfigPanel extends Panel
foreach ($this->data['extensions'] as $extension) {
$data[$extension['name']] = $extension['version'];
}
ksort($data);
return $data;
}
......@@ -72,8 +73,8 @@ class ConfigPanel extends Panel
$pinfo = ob_get_contents();
ob_end_clean();
$phpinfo = preg_replace('%^.*<body>(.*)</body>.*$%ms', '$1', $pinfo);
$phpinfo = str_replace('<table ', '<table class="table table-condensed table-bordered table-striped table-hover config-php-info-table"', $phpinfo);
$phpinfo = str_replace('<table ', '<div class="table-responsive"><table class="table table-condensed table-bordered table-striped table-hover config-php-info-table"', $phpinfo);
$phpinfo = str_replace('</table>', '</table></div>', $phpinfo);
return $phpinfo;
}
......
......@@ -10,59 +10,61 @@ use yii\helpers\Inflector;
echo '<p>No asset bundle was used.</p>';
return;
} ?>
<table class="table table-striped table-bordered">
<caption>
<p>Total <b><?= count($panel->data) ?></b> asset bundles were loaded.</p>
</caption>
<?php
foreach ($panel->data as $name => $bundle) {
?>
<thead>
<tr>
<td colspan="2"><h3 id="<?= Inflector::camel2id($name) ?>"><?= $name ?></h3></td>
</tr>
</thead>
<tbody>
<tr>
<th>sourcePath</th>
<td><?= Html::encode($bundle['sourcePath'] !== null ? $bundle['sourcePath'] : $bundle['basePath']) ?></td>
</tr>
<?php if ($bundle['basePath'] !== null): ?>
<div class="table-responsive">
<table class="table table-striped table-bordered">
<caption>
<p>Total <b><?= count($panel->data) ?></b> asset bundles were loaded.</p>
</caption>
<?php
foreach ($panel->data as $name => $bundle) {
?>
<thead>
<tr>
<th>basePath</th>
<td><?= Html::encode($bundle['basePath']) ?></td>
<td colspan="2"><h3 id="<?= Inflector::camel2id($name) ?>"><?= $name ?></h3></td>
</tr>
<?php endif; ?>
<?php if ($bundle['baseUrl'] !== null): ?>
</thead>
<tbody>
<tr>
<th>baseUrl</th>
<td><?= Html::encode($bundle['baseUrl']) ?></td>
<th>sourcePath</th>
<td><?= Html::encode($bundle['sourcePath'] !== null ? $bundle['sourcePath'] : $bundle['basePath']) ?></td>
</tr>
<?php endif; ?>
<?php if (!empty($bundle['css'])): ?>
<tr>
<th>css</th>
<td><?= Html::ul($bundle['css'], ['class' => 'assets']) ?></td>
</tr>
<?php endif; ?>
<?php if (!empty($bundle['js'])): ?>
<tr>
<th>js</th>
<td><?= Html::ul($bundle['js'], ['class' => 'assets']) ?></td>
</tr>
<?php endif; ?>
<?php if (!empty($bundle['depends'])): ?>
<tr>
<th>depends</th>
<td><ul class="assets">
<?php foreach ($bundle['depends'] as $depend): ?>
<li><?= Html::a($depend, '#' . Inflector::camel2id($depend)) ?></li>
<?php endforeach; ?>
</ul></td>
</tr>
<?php endif; ?>
</tbody>
<?php
}
?>
</table>
<?php if ($bundle['basePath'] !== null): ?>
<tr>
<th>basePath</th>
<td><?= Html::encode($bundle['basePath']) ?></td>
</tr>
<?php endif; ?>
<?php if ($bundle['baseUrl'] !== null): ?>
<tr>
<th>baseUrl</th>
<td><?= Html::encode($bundle['baseUrl']) ?></td>
</tr>
<?php endif; ?>
<?php if (!empty($bundle['css'])): ?>
<tr>
<th>css</th>
<td><?= Html::ul($bundle['css'], ['class' => 'assets']) ?></td>
</tr>
<?php endif; ?>
<?php if (!empty($bundle['js'])): ?>
<tr>
<th>js</th>
<td><?= Html::ul($bundle['js'], ['class' => 'assets']) ?></td>
</tr>
<?php endif; ?>
<?php if (!empty($bundle['depends'])): ?>
<tr>
<th>depends</th>
<td><ul class="assets">
<?php foreach ($bundle['depends'] as $depend): ?>
<li><?= Html::a($depend, '#' . Inflector::camel2id($depend)) ?></li>
<?php endforeach; ?>
</ul></td>
</tr>
<?php endif; ?>
</tbody>
<?php
}
?>
</table>
</div>
......@@ -12,22 +12,22 @@ use yii\helpers\Html;
<p>Empty.</p>
<?php else: ?>
<table class="table table-condensed table-bordered table-striped table-hover" style="table-layout: fixed;">
<thead>
<div class="table-responsive">
<table class="table table-condensed table-bordered table-striped table-hover" style="table-layout: fixed;">
<thead>
<tr>
<th style="width: 200px;">Name</th>
<th style="nowrap">Name</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<?php foreach ($values as $name => $value): ?>
<tr>
<th style="width: 200px;"><?= Html::encode($name) ?></th>
<td style="overflow:auto"><?= Html::encode($value) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</thead>
<tbody>
<?php foreach ($values as $name => $value): ?>
<tr>
<th style="white-space: normal"><?= Html::encode($name) ?></th>
<td style="overflow:auto"><?= Html::encode($value) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif; ?>
......@@ -14,7 +14,7 @@ use yii\grid\GridView;
echo GridView::widget([
'dataProvider' => $dataProvider,
'id' => 'db-panel-detailed-grid',
'options' => ['class' => 'detail-grid-view'],
'options' => ['class' => 'detail-grid-view table-responsive'],
'filterModel' => $searchModel,
'filterUrl' => $panel->getUrl(),
'columns' => [
......
......@@ -15,7 +15,7 @@ use yii\log\Logger;
echo GridView::widget([
'dataProvider' => $dataProvider,
'id' => 'log-panel-detailed-grid',
'options' => ['class' => 'detail-grid-view'],
'options' => ['class' => 'detail-grid-view table-responsive'],
'filterModel' => $searchModel,
'filterUrl' => $panel->getUrl(),
'rowOptions' => function ($model, $key, $index, $grid) {
......
......@@ -15,7 +15,7 @@ use yii\helpers\Html;
echo GridView::widget([
'dataProvider' => $dataProvider,
'id' => 'profile-panel-detailed-grid',
'options' => ['class' => 'detail-grid-view'],
'options' => ['class' => 'detail-grid-view table-responsive'],
'filterModel' => $searchModel,
'filterUrl' => $panel->getUrl(),
'columns' => [
......
......@@ -19,5 +19,5 @@ $statusText = Html::encode(isset(Response::$httpStatuses[$statusCode]) ? Respons
?>
<div class="yii-debug-toolbar-block">
<a href="<?= $panel->getUrl() ?>" title="Status code: <?= $statusCode ?> <?= $statusText ?>">Status <span class="label <?= $class ?>"><?= $statusCode ?></span></a>
<a href="<?= $panel->getUrl() ?>">Action <span class="label"><?= $panel->data['action'] ?></span></a>
</div>
<a href="<?= $panel->getUrl() ?>" title="Action: <?= $panel->data['action'] ?>">Route <span class="label"><?= $panel->data['route'] ?></span></a>
</div>
\ No newline at end of file
......@@ -13,21 +13,23 @@ use yii\helpers\VarDumper;
<?php else: ?>
<table class="table table-condensed table-bordered table-striped table-hover request-table" style="table-layout: fixed;">
<thead>
<tr>
<th style="width: 200px;">Name</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<?php foreach ($values as $name => $value): ?>
<tr>
<th style="width: 200px;"><?= Html::encode($name) ?></th>
<td><?= htmlspecialchars(VarDumper::dumpAsString($value), ENT_QUOTES|ENT_SUBSTITUTE, \Yii::$app->charset, true) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div class="table-responsive">
<table class="table table-condensed table-bordered table-striped table-hover request-table" style="table-layout: fixed;">
<thead>
<tr>
<th>Name</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<?php foreach ($values as $name => $value): ?>
<tr>
<th><?= Html::encode($name) ?></th>
<td><?= htmlspecialchars(VarDumper::dumpAsString($value), ENT_QUOTES|ENT_SUBSTITUTE, \Yii::$app->charset, true) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif; ?>
......@@ -50,6 +50,7 @@ Yii Framework 2 Change Log
- Enh #5806: Allow `Html::encode()` to be used when the application is not started (qiangxue)
- Enh #5954: `yii message` command now shows user friendly error if it's not able to parse source file (samdark)
- Enh #5983: Added `Inflector::sentence()` (pana1990, qiangxue)
- Enh #6113: Improved debugger configuration and request UI (schmunk42)
- Enh: `Console::confirm()` now uses `Console::stdout()` instead of `echo` to be consistent with all other functions (cebe)
- Enh: `yii\rbac\DbManager` migration now uses database component specified in component settings instead of always using default `db` (samdark)
- Enh: Added `yii\base\Controller::renderContent()` (qiangxue)
......
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