Commit b3850a4e by pana1990 Committed by Alexander Makarov

Fixes #6890: Added ability to filter by query type

parent 07accd9b
...@@ -5,6 +5,7 @@ Yii Framework 2 debug extension Change Log ...@@ -5,6 +5,7 @@ Yii Framework 2 debug extension Change Log
----------------------- -----------------------
- Bug #6903: Fixed display issue with phpinfo() table (kalayda, cebe) - 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 2.0.2 January 11, 2015
......
...@@ -190,4 +190,22 @@ class DbPanel extends Panel ...@@ -190,4 +190,22 @@ class DbPanel extends Panel
{ {
return (($this->criticalQueryThreshold !== null) && ($count > $this->criticalQueryThreshold)); 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;
},
[]
);
}
} }
...@@ -49,6 +49,7 @@ echo GridView::widget([ ...@@ -49,6 +49,7 @@ echo GridView::widget([
'value' => function ($data) { 'value' => function ($data) {
return Html::encode(mb_strtoupper($data['type'], 'utf8')); return Html::encode(mb_strtoupper($data['type'], 'utf8'));
}, },
'filter' => $panel->getTypes(),
], ],
[ [
'attribute' => 'query', 'attribute' => 'query',
......
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