Commit 950577d5 by Klimov Paul

Dynamic naming added to `DbPanel`

parent 60a5b31a
......@@ -48,6 +48,14 @@ class DbPanel extends Panel
}
/**
* @return string short name of the panel, which will be use in summary.
*/
public function getSummaryName()
{
return 'DB';
}
/**
* @inheritdoc
*/
public function getSummary()
......
......@@ -7,7 +7,7 @@ use yii\helpers\Html;
use yii\grid\GridView;
?>
<h1>Database Queries</h1>
<h1><?= $panel->getName(); ?> Queries</h1>
<?php
......
......@@ -6,7 +6,7 @@
<?php if ($queryCount): ?>
<div class="yii-debug-toolbar-block">
<a href="<?= $panel->getUrl() ?>" title="Executed <?= $queryCount ?> database queries which took <?= $queryTime ?>.">
DB <span class="label label-info"><?= $queryCount ?></span> <span class="label"><?= $queryTime ?></span>
<?= $panel->getSummaryName() ?>DB <span class="label label-info"><?= $queryCount ?></span> <span class="label"><?= $queryTime ?></span>
</a>
</div>
<?php endif; ?>
......@@ -27,6 +27,14 @@ class MongoDbPanel extends DbPanel
}
/**
* @inheritdoc
*/
public function getSummaryName()
{
return 'MongoDB';
}
/**
* Returns all profile logs of the current request for this panel.
* @return array
*/
......
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