Skip to content

Commit

Permalink
action-menu: support file name with extension in _THRUK_ACTION_MENU
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Nov 5, 2024
1 parent 69d6916 commit fd82cbe
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/Thruk/Config.pm
Original file line number Diff line number Diff line change
Expand Up @@ -682,8 +682,11 @@ sub set_default_config {
next unless -d $folder.'/.';
my @files = glob($folder.'/*');
for my $file (@files) {
if($file =~ m%([^/]+)\.(json|js)$%mx) {
my $basename = $1;
if($file =~ m%([^/]+\.json|js)$%mx) {
my $filename = $1;
my $basename = $filename;
$basename =~ s%\.[^.]+$%%gmx;
$config->{'action_menu_items'}->{$filename} = 'file://'.$file;
$config->{'action_menu_items'}->{$basename} = 'file://'.$file;
}
}
Expand Down

0 comments on commit fd82cbe

Please sign in to comment.