1 package MojoFacets::Actions;
6 use base 'Mojolicious::Controller';
9 use Data::Dump qw(dump);
15 my $max = $self->param('max') || 50;
16 my $action_regex = join('|', $self->param('action_filter'));
17 warn "# action_regex $action_regex\n";
22 foreach my $path ( sort { $b cmp $a } glob '/tmp/actions/*' ) {
23 if ( $path =~ m{/((\d+\.\d+)\.data\.(.+))$} ) {
24 my ( $uid, $t, $action ) = ( $1, $2, $3 );
26 next if $action_regex && $action !~ m/^($action_regex)$/;
27 push @$actions, { uid => $uid, t => $t, action => $action }
30 warn "ignore: $path\n";
34 # Render template "actions/index.html.ep" with message
35 $self->render(actions => $actions, stats => $stats );
41 my $uid = $self->param('uid');
42 $self->render( change => retrieve( "/tmp/actions/$uid" ), uid => $uid );