Added a Module Config option to show managed systems in a table
authorJamie Cameron <jcameron@webmin.com>
Thu, 20 Dec 2007 20:20:15 +0000 (20:20 +0000)
committerJamie Cameron <jcameron@webmin.com>
Thu, 20 Dec 2007 20:20:15 +0000 (20:20 +0000)
cluster-software/CHANGELOG
cluster-software/config
cluster-software/config.info
cluster-software/index.cgi
cluster-software/lang/en

index 0a3c9cf..5ecc09a 100644 (file)
@@ -13,3 +13,5 @@ When doing cluster compares, groups can be selected as well as individual hosts.
 ---- Changes since 1.310 ----
 Added the ability to list, install and delete packages on systems using different package formats.
 Added a popup progress window to track uploaded package files.
+---- Changes since 1.380 ----
+Added a Module Config option to show managed systems in a table.
index 9a3ce07..470eaee 100644 (file)
@@ -1 +1,2 @@
 sort_mode=0
+table_mode=0
index 6264e71..b6b7a1e 100644 (file)
@@ -1 +1,2 @@
 sort_mode=Sort hosts by,1,1-Hostname,0-Order added,2-Description
+table_mode=Show hosts as,1,1-Table,0-Icons
index e625453..3b88ae2 100755 (executable)
@@ -35,7 +35,31 @@ foreach $h (@hosts) {
        $gothost{$h->{'id'}}++;
        }
 if (@links) {
-       &icons_table(\@links, \@titles, \@icons);
+       if ($config{'table_mode'}) {
+               # Show as table
+               print &ui_columns_start([ $text{'index_thost'},
+                                         $text{'index_tdesc'},
+                                         $text{'index_tcount'},
+                                         $text{'index_ttype'} ]);
+               foreach $h (@hosts) {
+                       local ($s) = grep { $_->{'id'} == $h->{'id'} } @servers;
+                       next if (!$s);
+                       local ($type) = grep { $_->[0] eq $s->{'type'} }
+                                            @servers::server_types;
+                       print &ui_columns_row([
+                               "<a href='edit_host.cgi?id=$h->{'id'}'>".
+                               ($s->{'host'} || &get_system_hostname())."</a>",
+                               $s->{'desc'},
+                               scalar(@{$h->{'packages'}}),
+                               $type->[1],
+                               ]);
+                       }
+               print &ui_columns_end();
+               }
+       else {
+               # Show as icons
+               &icons_table(\@links, \@titles, \@icons);
+               }
        }
 else {
        print "<b>$text{'index_nohosts'}</b><p>\n";
index 2f64f5b..e8a3ce0 100644 (file)
@@ -17,6 +17,10 @@ index_down=Each server should re-download package
 index_count=($1 packages)
 this_server=this server
 index_compare=Compare Servers
+index_thost=Hostname
+index_tdesc=Description
+index_tcount=Packages
+index_ttype=OS type
 
 install_err=Failed to install package
 install_elocal=No local file given