Skip to content

Commit

Permalink
polished Tracy bar panel
Browse files Browse the repository at this point in the history
  • Loading branch information
petrparolek committed Feb 1, 2025
1 parent 8e25685 commit 576c8ea
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions src/Tracy/templates/panel.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@ use Tracy\Helpers;
/** @var array $dbParams */
/** @var array<array{sql: string, params: mixed[], types: mixed[], duration: float }> $queries */
?>
<style>
#tracy-debug td.tracy-dbal-sql {
background: white !important
}
<style>
#tracy-debug td.tracy-dbal-sql {
background: white !important
}

#tracy-debug .tracy-dbal-source {
color: #999 !important
}
#tracy-debug .tracy-dbal-source {
color: #999 !important
}

#tracy-debug .tracy-dbal tr table {
margin: 8px 0;
max-height: 150px;
overflow: auto
}
#tracy-debug .tracy-dbal tr table {
margin: 8px 0;
max-height: 150px;
overflow: auto
}

#tracy-debug .nettrine-dbal td > a.tracy-toggle::before {
content: 'source';
}
</style>
#tracy-debug .nettrine-dbal td > a.tracy-toggle::before {
content: 'source';
}
</style>

<?php if ($queriesNum === 0) { ?>
<h1>No queries</h1>
Expand All @@ -45,6 +45,7 @@ use Tracy\Helpers;
</h1>
<div class="tracy-inner nettrine-dbal">
<?php if ($queries !== []): ?>
<h2>Queries with params</h2>
<table class="tracy-sortable">
<tr>
<th>Time&nbsp;ms</th>
Expand Down Expand Up @@ -82,6 +83,7 @@ use Tracy\Helpers;
</table>
<?php endif; ?>
<?php if ($queries !== []): ?>
<h2>Plain queries</h2>
<table class="tracy-sortable">
<tr>
<th>Time&nbsp;ms</th>
Expand All @@ -96,7 +98,7 @@ use Tracy\Helpers;
<br><a class="tracy-toggle tracy-collapsed" data-tracy-ref="^tr .nettrine-dbal-backtrace"></a>
<?php endif; ?>
</td>
<td class="tracy-dbal-sql">z
<td class="tracy-dbal-sql">
<?php $sql = $formatter->formatSql($connection, $q['sql'], $q['params']); ?>
<?= QueryUtils::highlight($sql); ?>
<?php if (count($q['source']) !== 0): ?>
Expand All @@ -112,7 +114,7 @@ use Tracy\Helpers;
</table>
<?php endif; ?>

<div style="margin-top: 2px;">
<div style="margin-top: 25px;">
<?= Dumper::toHtml($dbParams, [Dumper::COLLAPSE => true]); ?>
</div>
</div>
Expand Down

0 comments on commit 576c8ea

Please sign in to comment.