Skip to content

Commit

Permalink
fix indention test
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Aug 24, 2023
1 parent 6905e73 commit efa72c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions lib/Thruk/Utils/Status.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2896,22 +2896,22 @@ returns text/lexical filter for status search
=cut
sub search2text {
my($c, $type, $search) = @_;
my($c, $type, $search, $intend) = @_;

my $txt;
my @subs;
for my $s (@{$search}) {
my($hostfilter, $servicefilter) = single_search($c, $s);
eval {
push @subs, _filtertext($servicefilter, 2);
push @subs, _filtertext($servicefilter, $intend ? 2 : undef);
};
my $err = $@;
if($err) {
require Data::Dumper;
confess("failed to expand search: ".$err."\n".Data::Dumper::Dumper($servicefilter));
}
}
$txt = _filtercombine("or", \@subs, 2) // "";
$txt = _filtercombine("or", \@subs, , $intend ? 2 : undef) // "";
return($txt);
}

Expand All @@ -2925,11 +2925,11 @@ returns text/lexical filter for structured filter
=cut
sub filter2text {
my($c, $type, $filter) = @_;
my($c, $type, $filter, $intend) = @_;

my $txt;
eval {
$txt = _filtertext($filter, 2);
$txt = _filtertext($filter, $intend ? 2 : undef);
$txt =~ s/^\((.*)\)$/$1/gmx; # remove outermose brackets
};
my $err = $@;
Expand All @@ -2943,6 +2943,7 @@ sub filter2text {
##############################################
sub _filtertext {
my($filter, $intend) = @_;

$intend = $intend + 2 if $intend;
return "" unless defined $filter;
if(ref $filter eq 'HASH') {
Expand Down
2 changes: 1 addition & 1 deletion templates/_status_filter.tt
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
</div>
[% END %]
<div class="body min-w-[800px] border-t borderDefault flexcol js-advancedfilter"[% IF ! has_lex_filter %] style="display: none;"[% END %]>
[% WRAPPER _filter_advanced.tt disabled=!has_lex_filter %][% IF has_lex_filter %][% has_lex_filter %][% ELSIF ! has_error %][% search2text("service", searches.$paneprefix) %][% END %][% END %]
[% WRAPPER _filter_advanced.tt disabled=!has_lex_filter %][% IF has_lex_filter %][% has_lex_filter %][% ELSIF ! has_error %][% search2text("service", searches.$paneprefix, 1) %][% END %][% END %]
</div>
</div>
</div>
Expand Down

0 comments on commit efa72c8

Please sign in to comment.