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 ...@@ -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 #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) - 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 #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) - Enh: Made `DefaultController::getManifest()` more robust against corrupt files (cebe)
......
...@@ -56,6 +56,7 @@ class ConfigPanel extends Panel ...@@ -56,6 +56,7 @@ class ConfigPanel extends Panel
foreach ($this->data['extensions'] as $extension) { foreach ($this->data['extensions'] as $extension) {
$data[$extension['name']] = $extension['version']; $data[$extension['name']] = $extension['version'];
} }
ksort($data);
return $data; return $data;
} }
...@@ -72,8 +73,8 @@ class ConfigPanel extends Panel ...@@ -72,8 +73,8 @@ class ConfigPanel extends Panel
$pinfo = ob_get_contents(); $pinfo = ob_get_contents();
ob_end_clean(); ob_end_clean();
$phpinfo = preg_replace('%^.*<body>(.*)</body>.*$%ms', '$1', $pinfo); $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; return $phpinfo;
} }
......
...@@ -10,59 +10,61 @@ use yii\helpers\Inflector; ...@@ -10,59 +10,61 @@ use yii\helpers\Inflector;
echo '<p>No asset bundle was used.</p>'; echo '<p>No asset bundle was used.</p>';
return; return;
} ?> } ?>
<table class="table table-striped table-bordered"> <div class="table-responsive">
<caption> <table class="table table-striped table-bordered">
<p>Total <b><?= count($panel->data) ?></b> asset bundles were loaded.</p> <caption>
</caption> <p>Total <b><?= count($panel->data) ?></b> asset bundles were loaded.</p>
<?php </caption>
foreach ($panel->data as $name => $bundle) { <?php
?> foreach ($panel->data as $name => $bundle) {
<thead> ?>
<tr> <thead>
<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): ?>
<tr> <tr>
<th>basePath</th> <td colspan="2"><h3 id="<?= Inflector::camel2id($name) ?>"><?= $name ?></h3></td>
<td><?= Html::encode($bundle['basePath']) ?></td>
</tr> </tr>
<?php endif; ?> </thead>
<?php if ($bundle['baseUrl'] !== null): ?> <tbody>
<tr> <tr>
<th>baseUrl</th> <th>sourcePath</th>
<td><?= Html::encode($bundle['baseUrl']) ?></td> <td><?= Html::encode($bundle['sourcePath'] !== null ? $bundle['sourcePath'] : $bundle['basePath']) ?></td>
</tr> </tr>
<?php endif; ?> <?php if ($bundle['basePath'] !== null): ?>
<?php if (!empty($bundle['css'])): ?> <tr>
<tr> <th>basePath</th>
<th>css</th> <td><?= Html::encode($bundle['basePath']) ?></td>
<td><?= Html::ul($bundle['css'], ['class' => 'assets']) ?></td> </tr>
</tr> <?php endif; ?>
<?php endif; ?> <?php if ($bundle['baseUrl'] !== null): ?>
<?php if (!empty($bundle['js'])): ?> <tr>
<tr> <th>baseUrl</th>
<th>js</th> <td><?= Html::encode($bundle['baseUrl']) ?></td>
<td><?= Html::ul($bundle['js'], ['class' => 'assets']) ?></td> </tr>
</tr> <?php endif; ?>
<?php endif; ?> <?php if (!empty($bundle['css'])): ?>
<?php if (!empty($bundle['depends'])): ?> <tr>
<tr> <th>css</th>
<th>depends</th> <td><?= Html::ul($bundle['css'], ['class' => 'assets']) ?></td>
<td><ul class="assets"> </tr>
<?php foreach ($bundle['depends'] as $depend): ?> <?php endif; ?>
<li><?= Html::a($depend, '#' . Inflector::camel2id($depend)) ?></li> <?php if (!empty($bundle['js'])): ?>
<?php endforeach; ?> <tr>
</ul></td> <th>js</th>
</tr> <td><?= Html::ul($bundle['js'], ['class' => 'assets']) ?></td>
<?php endif; ?> </tr>
</tbody> <?php endif; ?>
<?php <?php if (!empty($bundle['depends'])): ?>
} <tr>
?> <th>depends</th>
</table> <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; ...@@ -12,22 +12,22 @@ use yii\helpers\Html;
<p>Empty.</p> <p>Empty.</p>
<?php else: ?> <?php else: ?>
<div class="table-responsive">
<table class="table table-condensed table-bordered table-striped table-hover" style="table-layout: fixed;"> <table class="table table-condensed table-bordered table-striped table-hover" style="table-layout: fixed;">
<thead> <thead>
<tr> <tr>
<th style="width: 200px;">Name</th> <th style="nowrap">Name</th>
<th>Value</th> <th>Value</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php foreach ($values as $name => $value): ?> <?php foreach ($values as $name => $value): ?>
<tr> <tr>
<th style="width: 200px;"><?= Html::encode($name) ?></th> <th style="white-space: normal"><?= Html::encode($name) ?></th>
<td style="overflow:auto"><?= Html::encode($value) ?></td> <td style="overflow:auto"><?= Html::encode($value) ?></td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
</tbody> </tbody>
</table> </table>
</div>
<?php endif; ?> <?php endif; ?>
...@@ -14,7 +14,7 @@ use yii\grid\GridView; ...@@ -14,7 +14,7 @@ use yii\grid\GridView;
echo GridView::widget([ echo GridView::widget([
'dataProvider' => $dataProvider, 'dataProvider' => $dataProvider,
'id' => 'db-panel-detailed-grid', 'id' => 'db-panel-detailed-grid',
'options' => ['class' => 'detail-grid-view'], 'options' => ['class' => 'detail-grid-view table-responsive'],
'filterModel' => $searchModel, 'filterModel' => $searchModel,
'filterUrl' => $panel->getUrl(), 'filterUrl' => $panel->getUrl(),
'columns' => [ 'columns' => [
......
...@@ -15,7 +15,7 @@ use yii\log\Logger; ...@@ -15,7 +15,7 @@ use yii\log\Logger;
echo GridView::widget([ echo GridView::widget([
'dataProvider' => $dataProvider, 'dataProvider' => $dataProvider,
'id' => 'log-panel-detailed-grid', 'id' => 'log-panel-detailed-grid',
'options' => ['class' => 'detail-grid-view'], 'options' => ['class' => 'detail-grid-view table-responsive'],
'filterModel' => $searchModel, 'filterModel' => $searchModel,
'filterUrl' => $panel->getUrl(), 'filterUrl' => $panel->getUrl(),
'rowOptions' => function ($model, $key, $index, $grid) { 'rowOptions' => function ($model, $key, $index, $grid) {
......
...@@ -15,7 +15,7 @@ use yii\helpers\Html; ...@@ -15,7 +15,7 @@ use yii\helpers\Html;
echo GridView::widget([ echo GridView::widget([
'dataProvider' => $dataProvider, 'dataProvider' => $dataProvider,
'id' => 'profile-panel-detailed-grid', 'id' => 'profile-panel-detailed-grid',
'options' => ['class' => 'detail-grid-view'], 'options' => ['class' => 'detail-grid-view table-responsive'],
'filterModel' => $searchModel, 'filterModel' => $searchModel,
'filterUrl' => $panel->getUrl(), 'filterUrl' => $panel->getUrl(),
'columns' => [ 'columns' => [
......
...@@ -19,5 +19,5 @@ $statusText = Html::encode(isset(Response::$httpStatuses[$statusCode]) ? Respons ...@@ -19,5 +19,5 @@ $statusText = Html::encode(isset(Response::$httpStatuses[$statusCode]) ? Respons
?> ?>
<div class="yii-debug-toolbar-block"> <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() ?>" 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> <a href="<?= $panel->getUrl() ?>" title="Action: <?= $panel->data['action'] ?>">Route <span class="label"><?= $panel->data['route'] ?></span></a>
</div> </div>
\ No newline at end of file
...@@ -13,21 +13,23 @@ use yii\helpers\VarDumper; ...@@ -13,21 +13,23 @@ use yii\helpers\VarDumper;
<?php else: ?> <?php else: ?>
<table class="table table-condensed table-bordered table-striped table-hover request-table" style="table-layout: fixed;"> <div class="table-responsive">
<thead> <table class="table table-condensed table-bordered table-striped table-hover request-table" style="table-layout: fixed;">
<tr> <thead>
<th style="width: 200px;">Name</th> <tr>
<th>Value</th> <th>Name</th>
</tr> <th>Value</th>
</thead> </tr>
<tbody> </thead>
<?php foreach ($values as $name => $value): ?> <tbody>
<tr> <?php foreach ($values as $name => $value): ?>
<th style="width: 200px;"><?= Html::encode($name) ?></th> <tr>
<td><?= htmlspecialchars(VarDumper::dumpAsString($value), ENT_QUOTES|ENT_SUBSTITUTE, \Yii::$app->charset, true) ?></td> <th><?= Html::encode($name) ?></th>
</tr> <td><?= htmlspecialchars(VarDumper::dumpAsString($value), ENT_QUOTES|ENT_SUBSTITUTE, \Yii::$app->charset, true) ?></td>
<?php endforeach; ?> </tr>
</tbody> <?php endforeach; ?>
</table> </tbody>
</table>
</div>
<?php endif; ?> <?php endif; ?>
...@@ -50,6 +50,7 @@ Yii Framework 2 Change Log ...@@ -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 #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 #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 #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: `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: `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) - 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