From 9090ab074178097f73d54c583a40a022183d9978 Mon Sep 17 00:00:00 2001 From: franck cuny Date: Sat, 21 Aug 2010 17:15:09 +0200 Subject: add apps panel, rewrite routes one --- lib/Plack/Middleware/Debug/Dancer/App.pm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 lib/Plack/Middleware/Debug/Dancer/App.pm (limited to 'lib/Plack/Middleware/Debug/Dancer/App.pm') diff --git a/lib/Plack/Middleware/Debug/Dancer/App.pm b/lib/Plack/Middleware/Debug/Dancer/App.pm new file mode 100644 index 0000000..424c1eb --- /dev/null +++ b/lib/Plack/Middleware/Debug/Dancer/App.pm @@ -0,0 +1,27 @@ +package Plack::Middleware::Debug::Dancer::App; + +use strict; +use warnings; + +use parent qw/Plack::Middleware::Debug::Base/; +use Dancer::App; + +sub run { + my ( $self, $env, $panel ) = @_; + + return sub { + my $applications; + + foreach my $app ( Dancer::App->applications ) { + $applications->{ $app->{name} } = $app->{settings}; + } + + $panel->title('Applications'); + $panel->nav_title('Applications'); + $panel->content( + sub { $self->render_hash( $applications, [ keys %$applications ] ) } + ); + }; +} + +1; -- cgit v1.2.3