Skip to content

Commit 0781ba2

Browse files
committed
ConnectionPanel: table does not exceed the window
1 parent a1a5140 commit 0781ba2

File tree

3 files changed

+9
-15
lines changed

3 files changed

+9
-15
lines changed

src/Bridges/DatabaseTracy/dist/panel.phtml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
declare(strict_types=1);
33
?>
44
<style class="tracy-debug">
5-
#tracy-debug td.nette-DbConnectionPanel-sql { background: white !important }
5+
#tracy-debug td.nette-DbConnectionPanel-sql { background: white !important; overflow-x: auto; max-width: 0; }
66
#tracy-debug .nette-DbConnectionPanel-source { color: #BBB !important }
77
#tracy-debug .nette-DbConnectionPanel-explain td { white-space: pre }
88
#tracy-debug td.nette-DbConnectionPanel-sql-insert { background: #E7ffE7 !important }
@@ -12,13 +12,12 @@ declare(strict_types=1);
1212

1313
<h1 title="<?= Tracy\Helpers::escapeHtml($connection->getDsn()) ?>">Queries: <?= Tracy\Helpers::escapeHtml($count) ?><?= Tracy\Helpers::escapeHtml($totalTime ? sprintf(', time: %0.3f ms', $totalTime * 1000) : '') ?>, <?= Tracy\Helpers::escapeHtml($name) ?></h1>
1414

15-
<div class="tracy-inner">
16-
<div class="tracy-inner-container">
15+
<div class="tracy-inner" style="min-width: 600px">
1716
<table class="tracy-sortable">
1817
<tr>
19-
<th>Time&nbsp;ms</th>
18+
<th style="width: 1%">Time&nbsp;ms</th>
2019
<th>SQL Query</th>
21-
<th>Rows</th>
20+
<th style="width: 1%">Rows</th>
2221
</tr>
2322

2423
<?php foreach ($queries as [$connection, $sql, $params, $source, $time, $rows, $error, $command, $explain]): ?>
@@ -67,4 +66,3 @@ declare(strict_types=1);
6766
<?php if (count($queries) < $count): ?> <p>...and more</p><?php endif ?>
6867

6968
</div>
70-
</div>

src/Bridges/DatabaseTracy/panel.latte

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<style class="tracy-debug">
2-
#tracy-debug td.nette-DbConnectionPanel-sql { background: white !important }
2+
#tracy-debug td.nette-DbConnectionPanel-sql { background: white !important; overflow-x: auto; max-width: 0; }
33
#tracy-debug .nette-DbConnectionPanel-source { color: #BBB !important }
44
#tracy-debug .nette-DbConnectionPanel-explain td { white-space: pre }
55
#tracy-debug td.nette-DbConnectionPanel-sql-insert { background: #E7ffE7 !important }
@@ -9,13 +9,12 @@
99

1010
<h1 title="{$connection->getDsn()}">Queries: {$count}{$totalTime ? sprintf(', time: %0.3f ms', $totalTime * 1000) : ''}, {$name}</h1>
1111

12-
<div class="tracy-inner">
13-
<div class="tracy-inner-container">
12+
<div class="tracy-inner" style="min-width: 600px">
1413
<table class="tracy-sortable">
1514
<tr>
16-
<th>Time&nbsp;ms</th>
15+
<th style="width: 1%">Time&nbsp;ms</th>
1716
<th>SQL Query</th>
18-
<th>Rows</th>
17+
<th style="width: 1%">Rows</th>
1918
</tr>
2019

2120
{foreach $queries as [$connection, $sql, $params, $source, $time, $rows, $error, $command, $explain]}
@@ -59,4 +58,3 @@
5958

6059
{if count($queries) < $count}<p>...and more</p>{/if}
6160
</div>
62-
</div>

tests/Database.Tracy/panel.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
%A%
22
<h1 title="sqlite::memory:">Queries: 4, time: %a% ms, foo</h1>
33

4-
<div class="tracy-inner">
5-
<div class="tracy-inner-container">
4+
<div class="tracy-inner" style="min-width: 600px">
65
<table class="tracy-sortable">
76
%A%
87
<td %a%>%A%</td>
@@ -55,4 +54,3 @@ <h1 title="sqlite::memory:">Queries: 4, time: %a% ms, foo</h1>
5554
</table>
5655

5756
</div>
58-
</div>

0 commit comments

Comments
 (0)