document.getElementById('yii-debug-toolbar-min').style.display = 'none'; document.getElementById('yii-debug-toolbar').style.display = 'block'; if (window.localStorage) { localStorage.setItem('yii-debug-toolbar', 'maximized'); } EOD; $firstPanel = reset($panels); $url = $firstPanel->getUrl(); ?> <div id="yii-debug-toolbar" class="yii-debug-toolbar-<?php echo $position; ?> hidden-print"> <div class="yii-debug-toolbar-block title"> <a href="<?php echo Url::to(['index']); ?> "> <img width="29" height="30" alt="" src="<?php echo \yii\debug\Module::getYiiLogo(); ?> "> Yii Debugger </a> </div> <?php foreach ($panels as $panel) { ?> <?php echo $panel->getSummary();
$calloutClass = 'callout-important'; } ?> <div class="callout <?php echo $calloutClass; ?> "> <?php $count = 0; $items = []; foreach ($manifest as $meta) { $label = $meta['tag'] . ': ' . $meta['method'] . ' ' . $meta['url'] . ($meta['ajax'] ? ' (AJAX)' : '') . ', ' . date('Y-m-d h:i:s a', $meta['time']) . ', ' . $meta['ip']; $url = ['view', 'tag' => $meta['tag'], 'panel' => $activePanel->id]; $items[] = ['label' => $label, 'url' => Url::to($url)]; if (++$count >= 10) { break; } } echo ButtonGroup::widget(['options' => ['class' => 'btn-group-sm'], 'buttons' => [Html::a('All', Url::to(['index']), ['class' => 'btn btn-default']), Html::a('Latest', Url::to(['view', 'panel' => $activePanel->id]), ['class' => 'btn btn-default']), ButtonDropdown::widget(['label' => 'Last 10', 'options' => ['class' => 'btn-default btn-sm'], 'dropdown' => ['items' => $items]])]]); echo "\n" . $summary['tag'] . ': ' . $summary['method'] . ' ' . Html::a(Html::encode($summary['url']), $summary['url']); echo ' at ' . date('Y-m-d h:i:s a', $summary['time']) . ' by ' . $summary['ip']; ?> </div> <?php echo $activePanel->getDetail(); ?> </div> </div> </div> </div>
$statusCodes = !empty($codes) ? array_combine($codes, $codes) : null; echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'rowOptions' => function ($model, $key, $index, $grid) use($searchModel) { $dbPanel = $this->context->module->panels['db']; if ($searchModel->isCodeCritical($model['statusCode']) || $dbPanel->isQueryCountCritical($model['sqlCount'])) { return ['class' => 'danger']; } else { return []; } }, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'tag', 'value' => function ($data) { return Html::a($data['tag'], \mysoft\helpers\Url::to(['/debug/default/view', 'tag' => $data['tag']])); }, 'format' => 'html'], ['attribute' => 'time', 'value' => function ($data) { return '<span class="nowrap">' . Yii::$app->formatter->asDatetime($data['time'], 'short') . '</span>'; }, 'format' => 'html'], 'ip', ['attribute' => 'sqlCount', 'label' => 'Query Count', 'value' => function ($data) { $dbPanel = $this->context->module->panels['db']; if ($dbPanel->isQueryCountCritical($data['sqlCount'])) { $content = Html::tag('b', $data['sqlCount']) . ' ' . Html::tag('span', '', ['class' => 'glyphicon glyphicon-exclamation-sign']); return Html::a($content, \mysoft\helpers\Url::to(['view', 'panel' => 'db', 'tag' => $data['tag']]), ['title' => 'Too many queries. Allowed count is ' . $dbPanel->criticalQueryThreshold]); } else { return $data['sqlCount']; } }, 'format' => 'html'], ['attribute' => 'mailCount', 'visible' => isset($this->context->module->panels['mail'])], ['attribute' => 'method', 'filter' => ['get' => 'GET', 'post' => 'POST', 'delete' => 'DELETE', 'put' => 'PUT', 'head' => 'HEAD']], ['attribute' => 'ajax', 'value' => function ($data) { return $data['ajax'] ? 'Yes' : 'No'; }, 'filter' => ['No', 'Yes']], ['attribute' => 'url', 'label' => 'URL'], ['attribute' => 'statusCode', 'filter' => $statusCodes, 'label' => 'Status code']]]); } else { echo "<div class='alert alert-warning'>No data available. Panel <code>db</code> or <code>request</code> not found.</div>"; } ?> </div> </div> </div>