Add link to original monitor, if allowed

This commit is contained in:
Jamie Cameron
2015-10-20 21:36:48 -07:00
parent 82274422fb
commit 7f02ff8917

View File

@@ -22,6 +22,7 @@ if (!&read_file($oldstatus_file, \%oldstatus)) {
my $table = &ui_columns_start([ $text{'info_desc'}, $text{'index_host'},
$text{'info_last'} ]);
my $down = 0;
my $can = &foreign_available($module_name) && $access{'edit'};
foreach my $s (@serv) {
my $stat = &expand_oldstatus($oldstatus{$s->{'id'}});
my @remotes = &expand_remotes($s);
@@ -29,8 +30,13 @@ foreach my $s (@serv) {
my @icons = map { "<img src=".&get_status_icon($_)."> ".
&status_to_string($_) } @ups;
$down += length(grep { $_ == 0 } @ups);
my $desc = &html_escape($s->{'desc'});
if ($can) {
$desc = &ui_link("/$module_name/edit_mon.cgi?id=".
&urlize($s->{'id'}), $desc);
}
$table .= &ui_columns_row([
&html_escape($s->{'desc'}),
$desc,
&nice_remotes($s),
join("", @icons),
]);