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