#!/usr/local/bin/perl # Shows hosts on which Usermin is installed require './cluster-usermin-lib.pl'; &ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1); # Display hosts on which modules will be installed print &ui_subheading($text{'index_hosts'}); @servers = &list_servers(); @hosts = &list_usermin_hosts(); if ($config{'sort_mode'} == 1) { @hosts = sort { my ($as) = grep { $_->{'id'} == $a->{'id'} } @servers; my ($bs) = grep { $_->{'id'} == $b->{'id'} } @servers; lc($as->{'host'}) cmp lc($bs->{'host'}) } @hosts; } elsif ($config{'sort_mode'} == 2) { @hosts = sort { my ($as) = grep { $_->{'id'} == $a->{'id'} } @servers; my ($bs) = grep { $_->{'id'} == $b->{'id'} } @servers; lc(&server_name($as)) cmp lc(&server_name($bs)) }@hosts; } $formno = 0; foreach $h (@hosts) { local ($s) = grep { $_->{'id'} == $h->{'id'} } @servers; next if (!$s); push(@titles, &server_name($s)."
". &text('index_version', $h->{'version'})); push(@links, "edit_host.cgi?id=$h->{'id'}"); push(@icons, "$gconfig{'webprefix'}/servers/images/$s->{'type'}.gif"); $gothost{$h->{'id'}}++; } if (@links) { if ($config{'table_mode'}) { # Show as table print &ui_columns_start([ $text{'index_thost'}, $text{'index_tdesc'}, $text{'index_tver'}, $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([ "". ($s->{'host'} || &get_system_hostname())."", $s->{'desc'}, $h->{'version'}, $type->[1], ]); } print &ui_columns_end(); } else { # Show as icons &icons_table(\@links, \@titles, \@icons); } } else { print "$text{'index_nohosts'}

\n"; } # Build common selectors @wgroups = &all_groups(\@hosts); $modsel2 = $modsel = "\n"; $modsel2 .= "\n"; $themesel = "\n"; # Show button for adding server print "\n"; @addservers = grep { !$gothost{$_->{'id'}} } @servers; if (@addservers) { print "\n"; $formno++; } else { print "\n"; } # Show button for adding server group @groups = &servers::list_all_groups(\@servers); if (@groups) { print "\n"; $formno++; } else { print "\n"; } print "
\n"; print "\n"; print "\n"; print "
\n"; print "\n"; print "\n"; print "
\n"; if (@hosts) { # Display modules lists and new module form print &ui_hr(); print &ui_subheading($text{'index_modules'}); print "\n"; print "\n"; print "\n"; $formno++; print "\n"; $formno++; print "
\n"; print "\n"; print $modsel; print "\n"; print $themesel; print "
\n"; print "\n"; &create_on_input(undef, 1, 1); print "

\n"; print "

\n"; print "$text{'index_installmsg'}

\n"; print " $text{'index_local'}\n"; print "\n"; print &file_chooser_button("local", 0, $formno); print "
\n"; print " $text{'index_uploaded'}\n"; print "
\n"; print " $text{'index_ftp'}\n"; print "
\n"; print " " x 5," ", "$text{'index_down'}

\n"; print " ", "$text{'index_nodeps'}
\n"; print "$text{'index_installon'}\n"; &create_on_input(); print "

\n"; print "\n"; print "

\n"; $formno++; # Display upgrade form &foreign_require("webmin", "webmin-lib.pl"); print &ui_hr(); print &ui_subheading($text{'index_upgrade'}); print "$text{'index_updesc'}

\n"; # what kind of install is the local system? $mode = &usermin::get_install_type(); print "

\n"; print "\n"; print " $text{'index_local'}\n"; print "\n"; print &file_chooser_button("file", 0, $formno),"
\n"; print " $text{'index_uploaded'}\n"; print "
\n"; print " $text{'index_ftp'}\n"; print "
\n"; if ($in{'mode'} eq 'rpm' || !$in{'mode'}) { print " $webmin::text{'upgrade_ftp'}
\n"; } print "

\n"; print " ", "$webmin::text{'upgrade_delete'}
\n"; print "$text{'index_upgradeon'}\n"; &create_on_input(); print "\n"; print "

\n"; $formno++; } &ui_print_footer("/", $text{'index'});