Show hostname in mouseover of icon
authorJamie Cameron <jcameron@webmin.com>
Wed, 4 Feb 2009 05:29:28 +0000 (05:29 +0000)
committerJamie Cameron <jcameron@webmin.com>
Wed, 4 Feb 2009 05:29:28 +0000 (05:29 +0000)
status/CHANGELOG
status/index.cgi

index 4a4d145..8b43ba2 100644 (file)
@@ -58,3 +58,5 @@ Allow saving of remote Webmin monitors when the remote host is down.
 Added a new monitor type for checking the expiry and validity of SSL certificates in a local file or on any SSL website.
 ---- Changes since 1.440 ----
 Added an option to the FTP status monitor to make a TLS encrypted connection. Requires the Net::FTPSSL Perl module though.
+---- Changes since 1.450 ----
+Added a tooltip to status icons to show the hostname.
index b9f3b7b..6d96b92 100755 (executable)
@@ -129,26 +129,32 @@ foreach $s (@_) {
                # Showing the current status
                @stats = &service_status($s, 1);
                @ups = map { $_->{'up'} } @stats;
+               @remotes = map { $_->{'remote'} } @stats;
                }
        elsif ($oldstatus) {
                # Getting status from last check
                $stat = &expand_oldstatus($oldstatus{$s->{'id'}});
+               @remotes = &expand_remotes($s);
                @ups = map { defined($stat->{$_}) ? ( $stat->{$_} ) : ( ) }
-                          &expand_remotes($s);
+                          @remotes;
                }
        if (!@ups) {
                push(@cols, "");
                }
        else {
                local @icons;
-               foreach my $up (@ups) {
+               for(my $i=0; $i<@ups; $i++) {
+                       $up = $ups[$i];
+                       $h = $remotes[$i];
+                       $h = $text{'index_local'} if ($h eq '*');
                        push(@icons, "<img src=images/".
                              ($up == 1 ? "up.gif" :
                              $up == -1 ? "not.gif" :
                              $up == -2 ? "webmin.gif" :
                              $up == -3 ? "timed.gif" :
                              $up == -4 ? "skip.gif" :
-                                         "down.gif").">");
+                                         "down.gif").
+                             " title='".&html_escape($h)."'>");
                        }
                push(@cols, join("", @icons));
                }