[Jifty-commit] r6855 - in jifty/trunk/lib/Jifty/Plugin: .
Jifty commits
jifty-commit at lists.jifty.org
Wed Apr 22 19:51:06 EDT 2009
Author: sartak
Date: Wed Apr 22 19:51:06 2009
New Revision: 6855
Modified:
jifty/trunk/lib/Jifty/Plugin/RequestInspector.pm
jifty/trunk/lib/Jifty/Plugin/RequestInspector/View.pm
Log:
Add a way to clear requests
Modified: jifty/trunk/lib/Jifty/Plugin/RequestInspector.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/RequestInspector.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/RequestInspector.pm Wed Apr 22 19:51:06 2009
@@ -35,6 +35,11 @@
return $requests[$id - 1]; # 1-based
}
+sub clear_requests {
+ @requests = ();
+ undef $current_inspection;
+}
+
sub get_plugin_data {
my $self = shift;
my $id = shift;
Modified: jifty/trunk/lib/Jifty/Plugin/RequestInspector/View.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/RequestInspector/View.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/RequestInspector/View.pm Wed Apr 22 19:51:06 2009
@@ -7,7 +7,27 @@
title => "Request Inspector"
}
content {
+ render_region(
+ name => 'request-inspector',
+ path => '/__jifty/admin/requests/requests',
+ );
+
+ div {
+ hyperlink(
+ label => "Clear requests",
+ onclick => {
+ refresh => 'request-inspector',
+ args => {
+ clear_requests => 1,
+ },
+ },
+ ),
+ };
+};
+
+template '/__jifty/admin/requests/requests' => sub {
my $request_inspector = Jifty->find_plugin('Jifty::Plugin::RequestInspector');
+ $request_inspector->clear_requests if get('clear_requests');
ol {
attr { id is 'request-inspector' };
@@ -35,6 +55,7 @@
};
}
};
+
};
template '/__jifty/admin/requests/plugins' => sub {
More information about the Jifty-commit
mailing list