@@ -10,36 +10,70 @@ use Tracy\Helpers;
1010
1111?>
1212<style class="tracy-debug">
13- #tracy-debug .nette-RoutingPanel table {
14- font: 9pt/1.5 Consolas, monospace;
13+ #tracy-debug .nette-RoutingPanel-grid {
14+ background: #FDF5CE;
15+ display: grid;
16+ grid-template-columns: auto 1fr auto auto;
17+ border: 1px solid #E6DFBF;
1518 }
1619
17- #tracy-debug .nette-RoutingPanel tr {
18- border: #d6ceb0 0 solid;
20+ #tracy-debug .nette-RoutingPanel-grid-inner,
21+ #tracy-debug .nette-RoutingPanel-grid-columns {
22+ grid-column: 1 / span 4;
23+ display: grid;
24+ grid-template-columns: subgrid;
1925 }
2026
21- #tracy-debug .nette-RoutingPanel .yes td {
27+ #tracy-debug .nette-RoutingPanel-grid-columns:nth-child(2n) {
28+ background: rgba(0,0,0,0.02);
29+ }
30+
31+ #tracy-debug .nette-RoutingPanel-grid-header {
32+ color: #655E5E;
33+ background: #F4F3F1;
34+ font-size: 90%;
35+ font-weight: bold;
36+ }
37+
38+ #tracy-debug .nette-RoutingPanel-grid-group-header {
39+ grid-column: 1 / span 4;
40+ font-size: 90%;
41+ font-weight: bold;
42+ text-align: center;
43+ }
44+
45+ #tracy-debug .nette-RoutingPanel-grid-inner .nette-RoutingPanel-grid-inner {
46+ background: #23180007;
47+ box-shadow: 0 1px 20px 0px #00000040;
48+ border-right: 8px solid #0000002e;
49+ }
50+
51+ #tracy-debug .nette-RoutingPanel-grid-columns > div {
52+ border-bottom: 1px solid #95770026;
53+ border-right: 1px solid #95770026;
54+ padding: 2px 5px;
55+ }
56+
57+ #tracy-debug .nette-RoutingPanel-status-yes {
2258 background: #BDE678 !important;
2359 }
2460
25- #tracy-debug .nette-RoutingPanel . may td {
61+ #tracy-debug .nette-RoutingPanel-status- may {
2662 background: #C1D3FF !important;
2763 }
2864
29- #tracy-debug .nette-RoutingPanel . error td {
65+ #tracy-debug .nette-RoutingPanel-status- error {
3066 background: #ffd2c3 !important;
3167 }
3268
33- #tracy-debug .nette-RoutingPanel td.symbol {
34- text-align: center;
35- }
36-
37- #tracy-debug .nette-RoutingPanel td:first-child {
38- width: 20px;
69+ #tracy-debug .nette-RoutingPanel-symbol {
70+ text-align: right;
3971 }
4072
41- #tracy-debug .nette-RoutingPanel td:nth-child(2) {
42- white-space: nowrap;
73+ #tracy-debug .nette-RoutingPanel .tracy-dump.tracy-dump {
74+ padding: 0;
75+ margin: 0;
76+ border: none;
4377 }
4478
4579 #tracy-debug .nette-RoutingPanel pre, #tracy-debug .nette-RoutingPanel code {
@@ -72,54 +106,75 @@ use Tracy\Helpers;
72106</div>
73107
74108<div class="tracy-inner-container">
75- <?php if (empty ($ routers )): ?>
76- <p>No routers defined.</p>
109+ <?php if (empty ($ routes )): ?>
110+ <p>No routes defined.</p>
77111
78112<?php else : ?>
79- <table>
80- <thead>
81- <tr>
82- <th></th>
83- <th>Mask / Class</th>
84- <th>Defaults</th>
85- <?php if ($ hasModule ): ?> <th>Module</th><?php endif ?>
86- <th>Matched as</th>
87- </tr>
88- </thead>
89-
90- <tbody>
91- <?php foreach ($ routers as $ router ): ?>
92- <tr class="<?= $ router ->matched ?> " style="border-width: <?= ($ router ->gutterTop ?? 0 ) * 3 ?> px 0 <?= ($ router ->gutterBottom ?? 0 ) * 3 ?> px <?= $ router ->level * 6 ?> px">
93- <td class="symbol" title="<?= Helpers::escapeHtml (['yes ' => 'matched as first ' , 'may ' => 'suitable but not matched as first ' , 'no ' => '' , 'oneway ' => 'one-way ' , 'error ' => 'error ' ][$ router ->matched ]) ?> "
94- ><?= ['yes ' => '✓ ' , 'may ' => '≈ ' , 'no ' => '' , 'oneway ' => '⛔ ' , 'error ' => '❌ ' ][$ router ->matched ] ?> </td>
95-
96- <td><code title="<?= Helpers::escapeHtml ($ router ->class ) ?> "><?=
97- $ router ->path === '' ? '' : '<small> ' . Helpers::escapeHtml ($ router ->path ) . '</small> ' ,
98- isset ($ router ->mask ) ? str_replace (['/ ' , '- ' ], ['<wbr>/ ' , '<wbr>- ' ], Helpers::escapeHtml ($ router ->mask )) : str_replace ('\\' , '<wbr> \\' , Helpers::escapeHtml ($ router ->class ))
99- ?> </code></td>
100-
101- <td><code>
102- <?php foreach ($ router ->defaults as $ key => $ value ): ?>
103- <?= Helpers::escapeHtml ($ key ), ' = ' , is_string ($ value ) ? Helpers::escapeHtml ($ value ) . '<br /> ' : Dumper::toHtml ($ value , [Dumper::COLLAPSE => true , Dumper::LIVE => true ]) ?>
104- <?php endforeach ?>
105- </code></td>
113+ <div class="nette-RoutingPanel-grid">
114+ <div class="nette-RoutingPanel-grid-columns nette-RoutingPanel-grid-header">
115+ <div></div>
116+ <div>Mask / Class</div>
117+ <div>Defaults</div>
118+ <div>Matched as</div>
119+ </div>
120+ <?php
121+
122+ $ show = function ($ info , $ path = '' ) use (&$ show ) {
123+ if (is_array ($ info )) {
124+ ?>
125+ <div class="nette-RoutingPanel-grid-inner">
126+ <?php if ($ info ['domain ' ] || $ info ['module ' ]): ?>
127+ <div class="nette-RoutingPanel-grid-group-header">
128+ <?= $ info ['domain ' ] ? 'domain = ' . Helpers::escapeHtml ($ info ['domain ' ]) : '' ?>
129+ <?= $ info ['module ' ] ? ' module = ' . Helpers::escapeHtml ($ info ['module ' ]) : '' ?>
130+ </div>
131+ <?php endif ?>
132+ <?php
133+ $ path .= $ info ['path ' ];
134+ foreach ($ info ['routes ' ] as $ route ) {
135+ $ show ($ route , $ path );
136+ }
137+ ?>
138+ </div>
139+ <?php
140+ return ;
141+ }
106142
107- <?php if ($ hasModule ): ?> <td><code><?= Helpers::escapeHtml ($ router ->module ) ?> </code></td><?php endif ?>
143+ $ route = $ info ;
144+ ?>
145+ <div class="nette-RoutingPanel-grid-columns nette-RoutingPanel-status-<?= $ route ->matched ?> ">
146+ <div class="nette-RoutingPanel-symbol" title="<?= Helpers::escapeHtml (['yes ' => 'matched as first ' , 'may ' => 'suitable but not matched as first ' , 'no ' => '' , 'oneway ' => 'one-way ' , 'error ' => 'error ' ][$ route ->matched ]) ?> "
147+ ><?= ['yes ' => '✓ ' , 'may ' => '≈ ' , 'no ' => '' , 'oneway ' => '⛔ ' , 'error ' => '❌ ' ][$ route ->matched ] ?> </div>
148+
149+ <div><code title="<?= Helpers::escapeHtml ($ route ->class ) ?> "><?=
150+ $ path === '' ? '' : '<small> ' . Helpers::escapeHtml ($ path ) . '</small> ' ,
151+ isset ($ route ->mask ) ? str_replace (['/ ' , '- ' ], ['<wbr>/ ' , '<wbr>- ' ], Helpers::escapeHtml ($ route ->mask )) : str_replace ('\\' , '<wbr> \\' , Helpers::escapeHtml ($ route ->class ))
152+ ?> </code></div>
153+
154+ <div><code>
155+ <?php foreach ($ route ->defaults as $ key => $ value ): ?>
156+ <?= Helpers::escapeHtml ($ key ), ' = ' , is_string ($ value ) ? Helpers::escapeHtml ($ value ) . '<br> ' : Dumper::toHtml ($ value , [Dumper::COLLAPSE => true , Dumper::LIVE => true ]) ?>
157+ <?php endforeach ?>
158+ </code></div>
108159
109- <td ><?php if ($ router ->params ): ?> <code>
110- <?php $ params = $ router ->params ; ?>
160+ <div ><?php if ($ route ->params ): ?> <code>
161+ <?php $ params = $ route ->params ; ?>
111162 <?php if (isset ($ params [Presenter::PresenterKey])): ?>
112163 <strong><?= Helpers::escapeHtml ($ params ['presenter ' ] . ': ' . (isset ($ params [Presenter::ActionKey]) ? $ params [Presenter::ActionKey] : Presenter::DefaultAction)) ?> </strong><br />
113164 <?php unset($ params [Presenter::PresenterKey], $ params [Presenter::ActionKey]) ?>
114165 <?php endif ?>
115166 <?php foreach ($ params as $ key => $ value ): ?>
116- <?= Helpers::escapeHtml ($ key ), ' = ' , is_string ($ value ) ? Helpers::escapeHtml ($ value ) . '<br / > ' : Dumper::toHtml ($ value , [Dumper::COLLAPSE => true , Dumper::LIVE => true ]) ?>
167+ <?= Helpers::escapeHtml ($ key ), ' = ' , is_string ($ value ) ? Helpers::escapeHtml ($ value ) . '<br> ' : Dumper::toHtml ($ value , [Dumper::COLLAPSE => true , Dumper::LIVE => true ]) ?>
117168 <?php endforeach ?>
118- </code><?php elseif ($ router ->error ): ?> <strong><?= Helpers::escapeHtml ($ router ->error ->getMessage ()) ?> </strong><?php endif ?> </td>
119- </tr>
120- <?php endforeach ?>
121- </tbody>
122- </table>
169+ </code><?php elseif ($ route ->error ): ?> <strong><?= Helpers::escapeHtml ($ route ->error ->getMessage ()) ?> </strong><?php endif ?> </div>
170+ </div>
171+ <?php
172+ };
173+
174+ $ show ($ routes );
175+
176+ ?>
177+ </div>
123178<?php endif ?>
124179</div>
125180</div>
0 commit comments