5 |
|
|
6 |
use Continuity::Widget::DomNode; |
use Continuity::Widget::DomNode; |
7 |
use Data::Dump qw/dump/; |
use Data::Dump qw/dump/; |
8 |
use Carp qw/confess cluck/; |
use Carp qw/confess/; |
9 |
use File::Slurp; |
use File::Slurp; |
10 |
|
|
11 |
has 'head' => ( |
has 'head' => ( |
24 |
] }, |
] }, |
25 |
); |
); |
26 |
|
|
27 |
has 'urequest_url' => ( |
has 'request_url' => ( |
28 |
is => 'rw', |
is => 'rw', |
29 |
isa => 'Uri', coerce => 1, |
isa => 'Uri', coerce => 1, |
30 |
default => '/', |
default => '/', |
125 |
my $status_line = ''; |
my $status_line = ''; |
126 |
foreach my $part ( @{ $self->status } ) { |
foreach my $part ( @{ $self->status } ) { |
127 |
foreach my $name ( keys %$part ) { |
foreach my $name ( keys %$part ) { |
128 |
warn "### part [$name] = ", length( $part->{name} ), " bytes" if $self->debug; |
my $content = $part->{$name}; |
129 |
$status_line .= qq|<span class="frey-popup">$name<span>| . $part->{$name} . qq|</span></span>|; |
if ( ref($content) ) { |
130 |
|
$content = '<code>' . dump( $content ) . '</code>'; |
131 |
|
} else { |
132 |
|
$content = qq|<span>$content</span>|; |
133 |
|
} |
134 |
|
warn "### part [$name] = ", length( $content ), " bytes" if $self->debug; |
135 |
|
$status_line .= qq|<span class="frey-popup">$name $content</span>|; |
136 |
} |
} |
137 |
} |
} |
138 |
|
|
147 |
qq| |
qq| |
148 |
<div class="frey-status-line"> |
<div class="frey-status-line"> |
149 |
<a href="/">Frey</a> $Frey::VERSION |
<a href="/">Frey</a> $Frey::VERSION |
150 |
<a href="?reload=$reload_counter"><code>| . $self->urequest_url . qq|</code></a> |
<a href="?reload=$reload_counter"><code>| . $self->request_url . qq|</code></a> |
151 |
$status_line |
$status_line |
152 |
</div> |
</div> |
153 |
</body></html> |
</body></html> |
161 |
|
|
162 |
sub error { |
sub error { |
163 |
my ( $self, $error ) = @_; |
my ( $self, $error ) = @_; |
164 |
cluck $error; |
my ($package, $filename, $line) = caller; |
165 |
$error =~ s{at\s+(\S+)\s+line\s+(\d+)}{ <a href="/editor$1+$2" target="editor">$1</a> line $2}gsm; |
$error .= " at $filename line $line"; |
166 |
|
warn "WARN: $error\n"; |
167 |
|
$error =~ s{at\s+(\S+)\s+line\s+(\d+)}{at <a href="/editor$1+$2" target="editor">$1</a> line $2}gsm; |
168 |
return qq|<pre class="frey-error">$error</pre>|; |
return qq|<pre class="frey-error">$error</pre>|; |
169 |
} |
} |
170 |
|
|