<commit_before>#!/usr/bin/perl
use strict;
use warnings;

use CGI qw(:standard);

use lib '../include';
use Locutus;

my $page = 'files';
my %vars = ();

my $dbh = Locutus::db_connect();

my $offset = int(param('offset'));
$offset = 0 if ($offset < 0);

my $only_unmatched = int(param('list_unmatched_only'));
my $select_view = 'v_web_list_files';
$select_view = 'v_web_list_unmatched_files' if ($only_unmatched == 1);

$vars{'files'} = $dbh->selectall_arrayref('SELECT * FROM ' . $select_view . ' ORDER BY filename LIMIT 25 OFFSET ' . $offset, {Slice => {}});

Locutus::process_template($page, \%vars);<commit_msg>added filtering of filenames too in files list<commit_after>#!/usr/bin/perl
use strict;
use warnings;

use CGI qw(:standard);

use lib '../include';
use Locutus;

my $page = 'files';
my %vars = ();

my $dbh = Locutus::db_connect();

my $offset = int(param('offset'));
$offset = 0 if ($offset < 0);

my $only_unmatched = int(param('list_unmatched_only'));
my $select_view = 'v_web_list_files';
$select_view = 'v_web_list_unmatched_files' if ($only_unmatched == 1);

my $filter = param('filter') || '';
$filter = ' WHERE filename ILIKE ' . $dbh->quote('%' . $filter . '%') unless ($filter eq '');

$vars{'files'} = $dbh->selectall_arrayref('SELECT * FROM ' . $select_view . $filter . ' ORDER BY filename LIMIT 25 OFFSET ' . $offset, {Slice => {}});

Locutus::process_template($page, \%vars);
{'fraction_non_alphanumeric': 0.19230769230769232, 'fraction_numerical': 0.007122507122507123, 'mean_word_length': 5.2444444444444445, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3457974', 'n_tokens_mistral': 524, 'n_tokens_neox': 506, 'n_words': 127}