Allow to hide other keys (#1661)
This commit is contained in:
parent
8a9a5b0b3a
commit
73c8a1a8d7
@ -42,7 +42,7 @@ sub addRoutes {
|
|||||||
|
|
||||||
# Ignore hidden ConfTree Primary Keys
|
# Ignore hidden ConfTree Primary Keys
|
||||||
push @enabledPK, $_
|
push @enabledPK, $_
|
||||||
unless ( $conf->{viewerHiddenPK} =~ /\b$_\b/ );
|
unless ( $self->{viewerHiddenPK} =~ /\b$_\b/ );
|
||||||
}
|
}
|
||||||
|
|
||||||
# HTML template
|
# HTML template
|
||||||
@ -55,10 +55,17 @@ sub addRoutes {
|
|||||||
':cfgNum' => \@enabledPK
|
':cfgNum' => \@enabledPK
|
||||||
},
|
},
|
||||||
['GET']
|
['GET']
|
||||||
)
|
);
|
||||||
|
|
||||||
|
foreach ( split /\s+/, $self->{viewerHiddenPK} ) {
|
||||||
|
$self->addRoute(
|
||||||
|
view => { ':cfgNum' => { $_ => 'rejectKey' } },
|
||||||
|
['GET']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
# Other keys
|
# Other keys
|
||||||
->addRoute( view => { ':cfgNum' => { '*' => 'getKey' } }, ['GET'] )
|
$self->addRoute( view => { ':cfgNum' => { '*' => 'getKey' } }, ['GET'] )
|
||||||
|
|
||||||
# Difference between confs
|
# Difference between confs
|
||||||
->addRoute( diff => { ':conf1' => { ':conf2' => 'diff' } } )
|
->addRoute( diff => { ':conf1' => { ':conf2' => 'diff' } } )
|
||||||
@ -75,4 +82,9 @@ sub diff {
|
|||||||
$self->SUPER::diff( $req, @path );
|
$self->SUPER::diff( $req, @path );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub rejectKey {
|
||||||
|
my ( $self, $req ) = @_;
|
||||||
|
return $self->sendJSONresponse( $req, { 'value' => '_Hidden_' } );
|
||||||
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
Loading…
Reference in New Issue
Block a user