Commit 73c8a1a8 authored by Christophe Maudoux's avatar Christophe Maudoux 🐛

Allow to hide other keys (#1661)

parent 8a9a5b0b
......@@ -42,7 +42,7 @@ sub addRoutes {
# Ignore hidden ConfTree Primary Keys
push @enabledPK, $_
unless ( $conf->{viewerHiddenPK} =~ /\b$_\b/ );
unless ( $self->{viewerHiddenPK} =~ /\b$_\b/ );
}
# HTML template
......@@ -55,10 +55,17 @@ sub addRoutes {
':cfgNum' => \@enabledPK
},
['GET']
)
);
# Other keys
->addRoute( view => { ':cfgNum' => { '*' => 'getKey' } }, ['GET'] )
foreach ( split /\s+/, $self->{viewerHiddenPK} ) {
$self->addRoute(
view => { ':cfgNum' => { $_ => 'rejectKey' } },
['GET']
);
}
# Other keys
$self->addRoute( view => { ':cfgNum' => { '*' => 'getKey' } }, ['GET'] )
# Difference between confs
->addRoute( diff => { ':conf1' => { ':conf2' => 'diff' } } )
......@@ -75,4 +82,9 @@ sub diff {
$self->SUPER::diff( $req, @path );
}
sub rejectKey {
my ( $self, $req ) = @_;
return $self->sendJSONresponse( $req, { 'value' => '_Hidden_' } );
}
1;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment