File: debug.html.ep

package info (click to toggle)
libmojolicious-perl 8.12%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,720 kB
  • sloc: perl: 12,099; makefile: 14
file content (441 lines) | stat: -rw-r--r-- 13,896 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
<!DOCTYPE html>
<!-- Request ID: <%= $c->req->request_id %> -->
<html>
  <head>
    % my $title = stash('exception') ? 'Server error' : 'Page not found';
    <title><%= $title %> (<%= app->mode %> mode)</title>
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Expires" content="-1">
    %= javascript '/mojo/jquery/jquery.js'
    %= javascript '/mojo/prettify/run_prettify.js'
    %= stylesheet '/mojo/prettify/prettify-mojo-dark.css'
    <style>
      a img {
        border: 0;
      }
      body {
        background: url(<%= url_for '/mojo/pinstripe-light.png' %>);
        color: #445555;
        font: 0.9em 'Helvetica Neue', Helvetica, sans-serif;
        font-weight: normal;
        line-height: 1.5em;
        margin: 0;
      }
      :not(pre) > code {
        background-color: #eef9ff;
        border: solid #cce4ff 1px;
        border-radius: 5px;
        color: #333;
        font: 0.9em Consolas, Menlo, Monaco, Courier, monospace;
        padding: 0.4em;
      }
      h1 {
        color: #2a2a2a;
        font-size: 1.5em;
        margin: 0;
      }
      pre {
        font: 0.9em Consolas, Menlo, Monaco, Courier, monospace;
        margin: 0;
        white-space: pre-wrap;
      }
      pre > code {
        display: block;
        font: 1.0em Consolas, Menlo, Monaco, Courier, monospace;
        margin-bottom: 0.7em;
        margin-top: 0.7em;
      }
      table {
        border-collapse: collapse;
        width: 100%;
      }
      td { padding: 0.5em }
      .box {
        background-color: #fff;
        border: 1px solid #c1c1c1;
        overflow: hidden;
        padding: 1em;
      }
      .code {
        background-color: #1a1a1a;
        background: url(<%= url_for '/mojo/pinstripe-dark.png' %>);
        color: #eee;
        text-shadow: #333 0 1px 0;
      }
      .important {
        background-color: rgba(47, 48, 50, .75);
       }
      .infobox {
        color: #333;
       }
      .infobox tr:nth-child(odd) .value {
        background-color: #ddeeff;
       }
      .infobox tr:nth-child(even) .value {
        background-color: #eef9ff;
       }
      .key {
        text-align: right;
      }
      .more table {
        margin-bottom: 1em;
       }
      .spaced {
        margin-left: 5em;
        margin-right: 5em;
      }
      .striped {
        border-top: solid #cce4ff 1px;
       }
      .tap {
        font: 0.5em Verdana, sans-serif;
        text-align: center;
      }
      .value {
        padding-left: 1em;
       }
      .wide {
        width: 100%;
       }
      #error {
        font: 1.5em 'Helvetica Neue', Helvetica, sans-serif;
        font-weight: 300;
        margin: 0;
        text-shadow: #333 0 1px 0;
      }
      #footer {
        padding-top: 0.5em;
        text-align: center;
      }
      #nothing {
        border-bottom: 0;
        padding-top: 20px;
      }
      #showcase {
        border-bottom: 0;
        border-top: 0;
      }
      #showcase table {
        margin-top: 1em;
      }
      #showcase td {
        padding-top: 0;
        padding-bottom: 0;
      }
      #showcase .key {
        padding-right: 0;
      }
      #log {
        border-radius: 5px;
        margin-top: 1em;
      }
      #log table {
        margin: 0;
      }
      #mojobar {
        background-color: #1a1a1a;
        background: -webkit-linear-gradient(top, #2a2a2a 0%, #000 100%);
        background: -moz-linear-gradient(top, #2a2a2a 0%, #000 100%);
        background: linear-gradient(top, #2a2a2a 0%, #000 100%);
        box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.5);
        height: 46px;
        overflow: hidden;
        width: 100%;
        z-index: 1000;
      }
      #mojobar-brand {
        display: inline-block;
        padding-left: 50px;
        padding-top: 4px;
      }
      #mojobar-links {
        display: inline;
        float: right;
        height: 60px;
        margin-top: 0.8em;
        padding-right: 50px;
      }
      #mojobar-links a {
        color: #bbb;
        font: 0.9em 'Helvetica Neue', Helvetica, sans-serif;
        margin-left: 0.5em;
        text-decoration: none;
        transition: all 200ms ease-in-out;
      }
      #mojobar-links a:hover {
        color: #fff;
      }
      #mojobar-links input {
        background-color: #3a3a3a;
        border: 1px solid rgba(0, 0, 0, 0.1);
        border-radius: 3px;
        color: #eee;
        display: inline;
        margin-left: 1em;
        padding: 4px;
        transition: all 0.15s;
      }
      #mojobar-links input:focus {
        background-color: #fff;
        color: #111;
        outline: 0;
      }
      #mojobar-links form {
        display: inline;
      }
      #more, #trace {
        border-bottom-left-radius: 5px;
        border-bottom-right-radius: 5px;
      }
      #more .tap, #trace .tap {
        text-shadow: #ddd 0 1px 0;
      }
      #request {
        border-bottom: 0;
        border-top-left-radius: 5px;
        border-top-right-radius: 5px;
        margin-top: 1em;
      }
      #routes {
        border-bottom-left-radius: 5px;
        border-bottom-right-radius: 5px;
        padding-top: 30px;
      }
      #trace {
        border-top: 0;
      }
      #wrapperlicious {
        max-width: 1000px;
        margin: 0 auto;
      }
    </style>
  </head>
  <body>
    <div id="mojobar">
      %= link_to 'https://mojolicious.org' => (id => 'mojobar-brand') => begin
        <picture>
          <img src="<%= url_for '/mojo/logo-white.png' %>"
            srcset="<%= url_for '/mojo/logo-white-2x.png' %> 2x">
        </picture>
      % end
      <div id="mojobar-links">
        %= link_to Documentation => 'https://mojolicious.org/perldoc'
        <%= link_to Chat =>
          'https://kiwiirc.com/nextclient/#irc://irc.freenode.net/mojo?nick=guest-?'
        %>
        %= link_to Wiki => 'https://github.com/mojolicious/mojo/wiki'
        %= link_to GitHub => 'https://github.com/mojolicious/mojo'
        %= link_to CPAN => 'https://metacpan.org/release/Mojolicious/'
        %= link_to MailingList => 'https://groups.google.com/group/mojolicious'
        %= link_to Twitter => 'https://twitter.com/perlmojo'
        %= form_for 'https://www.google.com/cse' => (target => '_blank') => begin
          %= hidden_field cx => '014527573091551588235:pwfplkjpgbi'
          %= hidden_field ie => 'UTF-8'
          %= search_field 'q', placeholder => 'Search'
        %= end
      </div>
    </div>
    <script>
      function mojoDrawer(handle, drawer) {
        $(handle).on('click', function () {
          $(drawer).slideToggle('slow');
          var text = $(handle + ' div.tap').text();
          text = text == "tap for more" ? "tap for less" : "tap for more";
          $(handle + ' div.tap').text(text);
        });
        $(drawer).toggle();
      }
      $(function () {
        mojoDrawer('#trace', '#frames');
        mojoDrawer('#more', '#infos');
      });
    </script>
    <div id="wrapperlicious">
      % my $kv = begin
        % my ($key, $value) = @_;
        <tr>
          <td class="key"><%= $key %>:</td>
          <td class="striped value wide"><pre><%= $value %></pre></td>
        </tr>
      % end
      % if (my $exception = stash 'exception') {
        <div id="nothing" class="box spaced"></div>
        % my $cv = begin
          % my ($key, $value, $i) = @_;
          %= tag 'tr', $i ? (class => 'important') : (), begin
            <td class="key"><%= $key %></td>
            <td class="value wide">
              <pre><code class="prettyprint"><%= $value %></code></pre>
            </td>
          % end
        % end
        <div id="showcase" class="box code spaced">
          <pre id="error"><%= $exception->message %></pre>
          <div id="context" class="more">
            <table>
              % for my $line (@{$exception->lines_before}) {
                %= $cv->($line->[0], $line->[1])
              % }
              % if (defined $exception->line->[1]) {
                %= $cv->($exception->line->[0], $exception->line->[1], 1)
              % }
              % for my $line (@{$exception->lines_after}) {
                %= $cv->($line->[0], $line->[1])
              % }
            </table>
          </div>
          % if (defined $exception->line->[2]) {
            <div id="insight" class="more">
              <table>
                % for my $line (@{$exception->lines_before}) {
                  %= $cv->($line->[0], $line->[2])
                % }
                %= $cv->($exception->line->[0], $exception->line->[2], 1)
                % for my $line (@{$exception->lines_after}) {
                  %= $cv->($line->[0], $line->[2])
                % }
              </table>
            </div>
            <div class="tap">tap for more</div>
            <script>
              var current = '#context';
              function mojoShowcase() {
                $('#showcase').on('click', function () {
                  $(this).unbind('click');
                  $(current).slideToggle('slow', function () {
                    current = current == '#context' ? '#insight' : '#context';
                    $(current).slideToggle('slow', function () {
                      mojoShowcase();
                    });
                  });
                });
              }
              mojoShowcase();
              $('#insight').toggle();
            </script>
          % }
        </div>
        <div id="trace" class="box spaced">
          % if (@{$exception->frames}) {
            <div id="frames" class="infobox more">
              <table>
                % for my $frame (@{$exception->frames}) {
                  <tr>
                    <td class="striped value wide">
                      <pre><%= $frame->[1] . ':' . $frame->[2] %></pre>
                    </td>
                  </tr>
                % }
              </table>
            </div>
            <div class="tap">tap for more</div>
          % }
        </div>
      % }
      % else {
        <div id="routes" class="box infobox spaced">
          <h1>Page not found... yet!</h1>
          <p>
            None of these routes could generate a response for your
            <code><%= $c->req->method %></code> request for
            <code><%= $c->req->url->path->to_route %></code>, maybe you need
            to add a new one?
          </p>
          % my $walk = begin
            % my ($walk, $route, $depth) = @_;
            <tr>
              <td class="striped value">
                % my $pattern = $route->pattern->unparsed || '/';
                % $pattern = "+$pattern" if $depth;
                <pre><%= '  ' x $depth %><%= $pattern %></pre>
              </td>
              <td class="striped value">
                <pre><%= uc(join ',', @{$route->via || []}) || '*' %></pre>
              </td>
              <td class="striped value">
                % my $name = $route->name;
                <pre><%= $route->has_custom_name ? qq{"$name"} : $name %></pre>
              </td>
            </tr>
            % $depth++;
            %= $walk->($walk, $_, $depth) for @{$route->children};
            % $depth--;
          % end
          <table>
            <thead>
              <tr>
                <th>Pattern</th>
                <th>Methods</th>
                <th>Name</th>
              </tr>
            </thead>
            %= $walk->($walk, $_, 0) for @{app->routes->children};
          </table>
        </div>
      % }
      <div id="request" class="box infobox spaced">
        <table>
          % my $req = $c->req;
          %= $kv->('Request ID' => $req->request_id)
          %= $kv->(Method => $req->method)
          % my $url = $req->url;
          %= $kv->(URL => $url->to_string)
          %= $kv->('Base URL' => $url->base->to_string)
          %= $kv->(Parameters => dumper $req->params->to_hash)
          %= $kv->(Stash => dumper $snapshot)
          %= $kv->(Session => dumper session)
          %= $kv->(Version => $req->version)
          % for my $name (sort @{$c->req->headers->names}) {
            % my $value = $c->req->headers->header($name);
            %= $kv->($name, $value)
          % }
        </table>
      </div>
      <div id="more" class="box infobox more spaced">
        <div id="infos">
          <table>
            %= $kv->(Perl => "$^V ($^O)")
            % my $version  = $Mojolicious::VERSION;
            % my $codename = $Mojolicious::CODENAME;
            %= $kv->(Mojolicious => "$version ($codename)")
            %= $kv->(Home => app->home)
            %= $kv->('Template paths' => dumper app->renderer->paths)
            %= $kv->('Template classes' => dumper app->renderer->classes)
            %= $kv->('Static paths' => dumper app->static->paths)
            %= $kv->('Static classes' => dumper app->static->classes)
            %= $kv->(Include => dumper \@INC)
            %= $kv->(Config => dumper app->config)
            %= $kv->(Moniker => app->moniker)
            %= $kv->(Name => $0)
            %= $kv->(Executable => $^X)
            %= $kv->(PID => $$)
            %= $kv->(Time => scalar localtime(time))
          </table>
        </div>
        <div class="tap">tap for more</div>
      </div>
      % if (@{app->log->history}) {
        <div id="log" class="box infobox spaced">
          <table>
            % for my $msg (@{app->log->history}) {
              <tr>
                <td class="striped value wide">
                  <pre><%= app->log->format->(@$msg) %></pre>
                </td>
              </tr>
            % }
          </table>
        </div>
      % }
    </div>
    <div id="footer">
      %= link_to 'https://mojolicious.org' => begin
        <picture>
          <img src="<%= url_for '/mojo/logo-black.png' %>"
            srcset="<%= url_for '/mojo/logo-black-2x.png' %> 2x"
            alt="Mojolicious logo">
        </picture>
      % end
    </div>
  </body>
</html>