mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-22 01:30:23 +08:00
Merge pull request #1751 from lucianobaraglia/some-debug-fixes
Some debug code style fixes...
This commit is contained in:
@@ -42,7 +42,7 @@ class DbPanel extends Panel
|
|||||||
$queryCount = count($timings);
|
$queryCount = count($timings);
|
||||||
$queryTime = number_format($this->getTotalQueryTime($timings) * 1000) . ' ms';
|
$queryTime = number_format($this->getTotalQueryTime($timings) * 1000) . ' ms';
|
||||||
|
|
||||||
return Yii::$app->view->render('panels/db/summary',[
|
return Yii::$app->view->render('panels/db/summary', [
|
||||||
'timings' => $this->calculateTimings(),
|
'timings' => $this->calculateTimings(),
|
||||||
'panel' => $this,
|
'panel' => $this,
|
||||||
'queryCount' => $queryCount,
|
'queryCount' => $queryCount,
|
||||||
@@ -112,9 +112,9 @@ class DbPanel extends Panel
|
|||||||
$this->_models[] = [
|
$this->_models[] = [
|
||||||
'type' => $this->detectQueryType($dbTiming['info']),
|
'type' => $this->detectQueryType($dbTiming['info']),
|
||||||
'query' => $dbTiming['info'],
|
'query' => $dbTiming['info'],
|
||||||
'duration' => ($dbTiming['duration'] * 1000), #in milliseconds
|
'duration' => ($dbTiming['duration'] * 1000), // in milliseconds
|
||||||
'trace' => $dbTiming['trace'],
|
'trace' => $dbTiming['trace'],
|
||||||
'timestamp' => $dbTiming['timestamp'],
|
'timestamp' => ($dbTiming['timestamp'] * 1000), // in milliseconds
|
||||||
'seq' => $seq,
|
'seq' => $seq,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class LogPanel extends Panel
|
|||||||
$searchModel = new Log();
|
$searchModel = new Log();
|
||||||
$dataProvider = $searchModel->search(Yii::$app->request->get(), $this->getModels());
|
$dataProvider = $searchModel->search(Yii::$app->request->get(), $this->getModels());
|
||||||
|
|
||||||
return Yii::$app->view->render('panels/log/detail',[
|
return Yii::$app->view->render('panels/log/detail', [
|
||||||
'dataProvider' => $dataProvider,
|
'dataProvider' => $dataProvider,
|
||||||
'panel' => $this,
|
'panel' => $this,
|
||||||
'searchModel' => $searchModel,
|
'searchModel' => $searchModel,
|
||||||
@@ -61,7 +61,7 @@ class LogPanel extends Panel
|
|||||||
* @param boolean $refresh if needed to build models from log messages and refresh them.
|
* @param boolean $refresh if needed to build models from log messages and refresh them.
|
||||||
* @return array models
|
* @return array models
|
||||||
*/
|
*/
|
||||||
protected function getModels($refresh=false)
|
protected function getModels($refresh = false)
|
||||||
{
|
{
|
||||||
if ($this->_models === null || $refresh) {
|
if ($this->_models === null || $refresh) {
|
||||||
$this->_models = [];
|
$this->_models = [];
|
||||||
@@ -71,7 +71,7 @@ class LogPanel extends Panel
|
|||||||
'message' => $message[0],
|
'message' => $message[0],
|
||||||
'level' => $message[1],
|
'level' => $message[1],
|
||||||
'category' => $message[2],
|
'category' => $message[2],
|
||||||
'time' => ($message[3] * 1000), #time in milliseconds
|
'time' => ($message[3] * 1000), // time in milliseconds
|
||||||
'trace' => $message[4]
|
'trace' => $message[4]
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ $this->title = 'Yii Debugger';
|
|||||||
<div class="default-view">
|
<div class="default-view">
|
||||||
<div id="yii-debug-toolbar">
|
<div id="yii-debug-toolbar">
|
||||||
<div class="yii-debug-toolbar-block title">
|
<div class="yii-debug-toolbar-block title">
|
||||||
<?php echo Html::a('Yii Debugger', ['index'],['title' => 'Back to main debug page']);?>
|
<?= Html::a('Yii Debugger', ['index'], ['title' => 'Back to main debug page']) ?>
|
||||||
</div>
|
</div>
|
||||||
<?php foreach ($panels as $panel): ?>
|
<?php foreach ($panels as $panel): ?>
|
||||||
<?= $panel->getSummary() ?>
|
<?= $panel->getSummary() ?>
|
||||||
|
|||||||
Reference in New Issue
Block a user