<&|/_elements/wrapper, title => 'Ping for ' . Jifty->web->session->id &>

<div id="pushed" style="overflow: scroll; width: 100%; height: 250px" >
        <% $region->render %>
</div>

<table width="80%"><tr valign="top"><td>
<fieldset>
<legend>New Pings</legend>
% my $form = Jifty->web->form;
<% $form->start %>
<% $action->form_field('host') %>
<% $action->form_field('only_failure')%>
<% $form->submit( label => 'Start' )%>
<% $form->end %>
</fieldset>
% my $id = Jifty->web->session->id;
% my $pings = Jifty->bus->modify("$id-ping") || {};
% if (my @subs = keys %$pings) {
</td><td>
<fieldset>
<legend>Current Pings</legend>
<table width="100%">
% foreach my $sub (@subs) {
% $form = Jifty->web->form;
<% $form->start %>
%    my $del = Jifty->web->new_action(class => 'CancelPing', arguments => { host => $sub });
<tr><td>
<% $del->form_field('host', render_as => 'Hidden', default_value => $sub) %>
<% $sub %>
</td><td>
<% $form->submit( label => 'Stop' )%>
<% $form->end %>
</td></tr>
% }
</table>
</fieldset>
% }
</td></tr></table>
</&>

<%init>
my $action = Jifty->web->new_action(class => 'AddPing');
my $region = Jifty::Web::PageRegion->new(
    name => 'pong',
    path => '/__jifty/empty',
);

</%init>
