Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

conf tool: show nicer file link

  • Loading branch information...
commit 58596e4a1dd67ea730a35f2d7aac14652c01adad 1 parent af28945
@sni authored
View
2  plugins/plugins-available/conf/lib/Monitoring/Config.pm
@@ -517,7 +517,7 @@ sub update_object {
my $newname = $obj->get_name();
- if($oldname ne $newname) {
+ if(defined $oldname and $oldname ne $newname) {
$self->rename_dependencies($obj, $oldname, $newname);
}
View
11 plugins/plugins-available/conf/lib/Thruk/Utils/Conf.pm
@@ -515,16 +515,23 @@ sub _compare_configs {
##########################################################
sub _link_obj {
my($obj,$line) = @_;
- my $path;
+ my($path, $link);
if(defined $line) {
$path = $obj;
+ $link = 'file='.$path.'&line='.$line;
} else {
$line = $obj->{'line'};
$path = $obj->{'file'}->{'path'};
+ $link = 'data.id='.$obj->get_id();
}
my $shortpath = $path;
$shortpath =~ s/.*\///gmx;
- return('<a href="conf.cgi?sub=objects&amp;file='.$path.'&amp;line='.$line.'">'.$shortpath.':'.$line.'</a>');
+ if($line == 0) {
+ $line = '';
+ } else {
+ $line = ':'.$line
+ }
+ return('<a href="conf.cgi?sub=objects&amp;'.$link.'">'.$shortpath.$line.'</a>');
}
##########################################################
Please sign in to comment.
Something went wrong with that request. Please try again.