Make servers list sorting nicer
authorJamie Cameron <jcameron@webmin.com>
Mon, 16 Aug 2010 16:50:54 +0000 (09:50 -0700)
committerJamie Cameron <jcameron@webmin.com>
Mon, 16 Aug 2010 16:50:54 +0000 (09:50 -0700)
custom/edit_cmd.cgi
custom/run.cgi

index 4fa564f..82ad344 100755 (executable)
@@ -87,9 +87,11 @@ if (@servers > 1) {
        @hosts = ( 0 ) if (!@hosts);
        print &ui_table_row(&hlink($text{'edit_servers'}, "servers"),
         &ui_select("hosts", \@hosts,
-                [ sort { lc($a->[1]) cmp lc($b->[1]) }
-                       map { [ $_->{'id'}, ($_->{'desc'} || $_->{'host'}) ] }
-                           @servers ],
+                [ map { [ $_->{'id'},
+                          !$_->{'host'} ? $_->{'desc'} :
+                            $_->{'host'}.
+                            ($_->{'desc'} ? ' ('.$_->{'desc'}.')' : '') ] }
+                      sort { lc($a->{'host'}) cmp lc($b->{'host'}) } @servers],
                 5, 1), 3);
        }
 
index 2d6cd1e..6c5fe5c 100755 (executable)
@@ -55,7 +55,7 @@ foreach $h (@hosts) {
                                        $cmd, $env, $export, $str, 1);
                }
        else {
-               # Foreign call
+               # Remote foreign call
                &remote_foreign_require($server->{'host'}, "custom",
                                        "custom-lib.pl");
                &remote_foreign_call($server->{'host'}, "custom",