Show IP next to hostname
authorJamie Cameron <jcameron@webmin.com>
Wed, 12 Oct 2011 18:27:09 +0000 (11:27 -0700)
committerJamie Cameron <jcameron@webmin.com>
Wed, 12 Oct 2011 18:27:09 +0000 (11:27 -0700)
blue-theme/right.cgi

index f536b44..12221eb 100755 (executable)
@@ -33,9 +33,16 @@ if ($level == 0) {
        # Show general system information
        print "<table width=70%>\n";
 
+       # Ask status module for collected info
+       &foreign_require("system-status");
+       $info = &system_status::get_collected_info();
+
        # Hostname
+       $ip = $info && $info->{'ips'} ? $info->{'ips'}->[0]->[0] :
+                               &to_ipaddress(get_system_hostname());
+       $ip = " ($ip)" if ($ip);
        print "<tr> <td><b>$text{'right_host'}</b></td>\n";
-       print "<td>",&get_system_hostname(),"</td> </tr>\n";
+       print "<td>",&get_system_hostname(),$ip,"</td> </tr>\n";
 
        # Operating system
        print "<tr> <td><b>$text{'right_os'}</b></td>\n";
@@ -58,10 +65,6 @@ if ($level == 0) {
                }
        print "<td>$tm</td> </tr>\n";
 
-       # Ask status module for more
-       &foreign_require("system-status");
-       $info = &system_status::get_collected_info();
-
        # Kernel and CPU
        if ($info->{'kernel'}) {
                print "<tr> <td><b>$text{'right_kernel'}</b></td>\n";