From efa72c8aab0d9b99c921b31c38e13e320168edde Mon Sep 17 00:00:00 2001 From: Sven Nierlein Date: Thu, 24 Aug 2023 18:33:24 +0200 Subject: [PATCH] fix indention test --- lib/Thruk/Utils/Status.pm | 11 ++++++----- templates/_status_filter.tt | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/Thruk/Utils/Status.pm b/lib/Thruk/Utils/Status.pm index fd4b85a57a..8ce3e9a4a5 100644 --- a/lib/Thruk/Utils/Status.pm +++ b/lib/Thruk/Utils/Status.pm @@ -2896,14 +2896,14 @@ 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) { @@ -2911,7 +2911,7 @@ sub search2text { 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); } @@ -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 = $@; @@ -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') { diff --git a/templates/_status_filter.tt b/templates/_status_filter.tt index de57905817..fb1def7e21 100644 --- a/templates/_status_filter.tt +++ b/templates/_status_filter.tt @@ -96,7 +96,7 @@ [% END %]