Fixes #6890: Added ability to filter by query type

This commit is contained in:
pana1990
2015-01-20 14:20:02 +01:00
committed by Alexander Makarov
parent 07accd9b7d
commit b3850a4e73
3 changed files with 20 additions and 0 deletions

View File

@ -5,6 +5,7 @@ Yii Framework 2 debug extension Change Log
-----------------------
- Bug #6903: Fixed display issue with phpinfo() table (kalayda, cebe)
- Enh #6890: Added ability to filter by query type (pana1990)
2.0.2 January 11, 2015

View File

@ -190,4 +190,22 @@ class DbPanel extends Panel
{
return (($this->criticalQueryThreshold !== null) && ($count > $this->criticalQueryThreshold));
}
/**
* Returns array query types
*
* @return array
* @since 2.0.3
*/
public function getTypes()
{
return array_reduce(
$this->_models,
function ($result, $item) {
$result[$item['type']] = $item['type'];
return $result;
},
[]
);
}
}

View File

@ -49,6 +49,7 @@ echo GridView::widget([
'value' => function ($data) {
return Html::encode(mb_strtoupper($data['type'], 'utf8'));
},
'filter' => $panel->getTypes(),
],
[
'attribute' => 'query',