3 # Display other webmin servers to which the configuration should be copied
6 require './cfengine-lib.pl';
7 &foreign_require("servers", "servers-lib.pl");
8 &ui_print_header(undef, $text{'hosts_title'}, "", "hosts");
10 # Show existing servers
11 print &ui_subheading($text{'hosts_hosts'});
12 @servers = &list_servers();
13 @hosts = &list_cfengine_hosts();
15 local ($s) = grep { $_->{'id'} == $h->{'id'} } @servers;
17 push(@titles, &server_name($s));
18 push(@links, "edit_host.cgi?id=$h->{'id'}");
19 push(@icons, "$gconfig{'webprefix'}/servers/images/$s->{'type'}.gif");
20 $gothost{$h->{'id'}}++;
23 &icons_table(\@links, \@titles, \@icons);
26 print "<b>$text{'hosts_nohosts'}</b><p>\n";
30 print "<form action=add.cgi>\n";
31 print "<table width=100%><tr>\n";
32 @addservers = grep { !$gothost{$_->{'id'}} } @servers;
34 print "<td><input type=submit name=add value='$text{'hosts_add'}'>\n";
35 print "<select name=server>\n";
36 foreach $s (@addservers) {
37 print "<option value=$s->{'id'}>",&server_name($s),"\n";
39 print "</select></td>\n";
41 @groups = &servers::list_all_groups(\@servers);
43 print "<td align=right><input type=submit name=gadd ",
44 "value='$text{'hosts_gadd'}'>\n";
45 print "<select name=group>\n";
46 foreach $g (@groups) {
47 print "<option>$g->{'name'}\n";
49 print "</select></td>\n";
51 print "</tr></table></form>\n";
56 print "<form action=cluster.cgi>\n";
57 print "<table width=100%>\n";
58 print "<tr> <td><input type=submit value='$text{'hosts_run'}'></td>\n";
59 print "<td>$text{'hosts_rundesc'}</td> </tr>\n";
60 print "<tr> <td><input type=submit name=copy ",
61 "value='$text{'hosts_copy'}'></td>\n";
62 print "<td>$text{'hosts_copydesc'}</td> </tr>\n";
65 print "<table border width=100%>\n";
66 print "<tr $tb> <td><b>$text{'hosts_opts'}</b></td> </tr>\n";
67 print "<tr $cb> <td><table width=100%>\n";
69 print "</table></td></tr></table>\n";
73 &ui_print_footer("", $text{'index_return'});