Commit 78d321b2 by Carsten Brandt

Merge pull request #4031 from SDKiller/patch-1

Http status codes are hardcoded in filter in debug
parents a2858920 86797ef4
......@@ -11,6 +11,7 @@ Yii Framework 2 debug extension Change Log
- Enh #3103: debugger panel is now not displayed when printing a page (githubjeka)
- Enh #3108: Added `yii\debug\Module::enableDebugLogs` to disable logging debug logs by default (qiangxue)
- Enh #3810: Added "Latest" button on panels page (thiagotalma)
- Enh #4031: Http status codes were hardcoded in filter (sdkiller)
2.0.0-beta April 13, 2014
-------------------------
......
......@@ -60,6 +60,7 @@ class DefaultController extends Controller
'panels' => $this->module->panels,
'dataProvider' => $dataProvider,
'searchModel' => $searchModel,
'manifest' => $this->getManifest(),
]);
}
......
......@@ -34,6 +34,15 @@ if (isset($this->context->module->panels['db']) && isset($this->context->module-
echo " <h1>Available Debug Data</h1>";
$timeFormatter = extension_loaded('intl') ? Yii::createObject(['class' => 'yii\i18n\Formatter']) : Yii::$app->formatter;
$codes = [];
foreach ($manifest as $tag => $vals) {
if (!empty($vals['statusCode'])) {
$codes[] = $vals['statusCode'];
}
}
$codes = array_unique($codes, SORT_NUMERIC);
$statusCodes = (!empty($codes)) ? array_combine($codes, $codes) : true;
echo GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
......@@ -104,7 +113,7 @@ if (isset($this->context->module->panels['db']) && isset($this->context->module-
],
[
'attribute' => 'statusCode',
'filter' => [200 => 200, 404 => 404, 403 => 403, 500 => 500],
'filter' => $statusCodes,
'label' => 'Status code'
],
],
......
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