#!/usr/local/bin/perl # list_hosts.cgi # Display other webmin servers to which the configuration should be copied # and run. require './cfengine-lib.pl'; &foreign_require("servers", "servers-lib.pl"); &ui_print_header(undef, $text{'hosts_title'}, "", "hosts"); # Show existing servers print &ui_subheading($text{'hosts_hosts'}); @servers = &list_servers(); @hosts = &list_cfengine_hosts(); foreach $h (@hosts) { local ($s) = grep { $_->{'id'} == $h->{'id'} } @servers; next if (!$s); push(@titles, &server_name($s)); push(@links, "edit_host.cgi?id=$h->{'id'}"); push(@icons, "$gconfig{'webprefix'}/servers/images/$s->{'type'}.gif"); $gothost{$h->{'id'}}++; } if (@links) { &icons_table(\@links, \@titles, \@icons); } else { print "$text{'hosts_nohosts'}

\n"; } # Display adding form print "

\n"; print "\n"; @addservers = grep { !$gothost{$_->{'id'}} } @servers; if (@addservers) { print "\n"; } @groups = &servers::list_all_groups(\@servers); if (@groups) { print "\n"; } print "
\n"; print "\n"; print "
\n"; # Display run form if (@hosts) { print &ui_hr(); print "
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
$text{'hosts_rundesc'}
$text{'hosts_copydesc'}
\n"; print "\n"; print "\n"; print "
$text{'hosts_opts'}
\n"; &show_run_form(); print "
\n"; print "
\n"; } &ui_print_footer("", $text{'index_return'});