Commit 950577d5 by Klimov Paul

Dynamic naming added to `DbPanel`

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