From fc649f34e011677bb79d56669f713dee9e99c6ba Mon Sep 17 00:00:00 2001 From: franck cuny Date: Sun, 18 Apr 2010 19:09:30 +0200 Subject: set title and subtitle --- lib/Plack/Middleware/Debug/Dancer/Logger.pm | 3 ++- lib/Plack/Middleware/Debug/Dancer/Session.pm | 2 ++ lib/Plack/Middleware/Debug/Dancer/Settings.pm | 12 ++---------- lib/Plack/Middleware/Debug/Dancer/Version.pm | 2 ++ 4 files changed, 8 insertions(+), 11 deletions(-) (limited to 'lib/Plack') diff --git a/lib/Plack/Middleware/Debug/Dancer/Logger.pm b/lib/Plack/Middleware/Debug/Dancer/Logger.pm index 3fdc4e9..91f0cdc 100644 --- a/lib/Plack/Middleware/Debug/Dancer/Logger.pm +++ b/lib/Plack/Middleware/Debug/Dancer/Logger.pm @@ -5,7 +5,6 @@ use warnings; use parent qw(Plack::Middleware::Debug::Base); use Dancer::Logger; use Class::Method::Modifiers qw(install_modifier); -our $VERSION = '0.07'; # XXX Not thread/Coro/AE safe. Should use $c->env or something my $psgi_env; @@ -37,6 +36,8 @@ sub run { return sub { my $res = shift; + $panel->title('Dancer::Logger'); + $panel->nav_subtitle('Dancer::Logger'); my $log = delete $env->{'plack.middleware.dancer_log'}; if ($log) { $panel->content("
$log
"); diff --git a/lib/Plack/Middleware/Debug/Dancer/Session.pm b/lib/Plack/Middleware/Debug/Dancer/Session.pm index 055676a..e4e410d 100644 --- a/lib/Plack/Middleware/Debug/Dancer/Session.pm +++ b/lib/Plack/Middleware/Debug/Dancer/Session.pm @@ -11,6 +11,8 @@ sub run { return sub { my $session = Dancer::Session->get(); my @settings = map { $_ => $session->{$_}} keys %$session; + $panel->title('Dancer::Session'); + $panel->nav_subtitle("Dancer::Session"); $panel->content( sub { $self->render_list_pairs( \@settings ) } ); }; } diff --git a/lib/Plack/Middleware/Debug/Dancer/Settings.pm b/lib/Plack/Middleware/Debug/Dancer/Settings.pm index cf10748..cae1602 100644 --- a/lib/Plack/Middleware/Debug/Dancer/Settings.pm +++ b/lib/Plack/Middleware/Debug/Dancer/Settings.pm @@ -6,22 +6,14 @@ use parent qw(Plack::Middleware::Debug::Base); use Class::Method::Modifiers qw/install_modifier/; use Dancer::Config; -#my $psgi_env; -# install_modifier 'Dancer', 'around', 'start' => sub { -# my $orig = shift; -# my $self = shift; -# $psgi_env->{'plack.middleware.dancer_settings'} = $self->config; -# $self->$orig(@_); -# }; - sub run { my ( $self, $env, $panel ) = @_; -# $psgi_env = $env; return sub { my $res = shift; my $settings = Dancer::Config->settings(); -# my $settings = $env->{'plack.middleware.dancer_settings'}; + $panel->title('Dancer::Settings'); + $panel->nav_subtitle('Dancer::Settings'); my @settings = map { $_ => $settings->{$_}} keys %$settings; $panel->content( sub { $self->render_list_pairs( \@settings ) } ); }; diff --git a/lib/Plack/Middleware/Debug/Dancer/Version.pm b/lib/Plack/Middleware/Debug/Dancer/Version.pm index fe05275..5773af7 100644 --- a/lib/Plack/Middleware/Debug/Dancer/Version.pm +++ b/lib/Plack/Middleware/Debug/Dancer/Version.pm @@ -8,6 +8,8 @@ sub run { my ( $self, $env, $panel ) = @_; return sub { + $panel->title('Dancer::Version'); + $panel->nav_title('Dancer::Version'); $panel->nav_subtitle($Dancer::VERSION); }; } -- cgit 1.4.1