3 # Shows a form for running a command, allowing the selection of a server or
4 # group of servers to run it on.
6 require './cluster-shell-lib.pl';
7 &ui_print_header(undef, $text{'index_title'}, "", "intro", 0, 1);
9 print "<form action=run.cgi method=post>\n";
12 print "<tr> <td><b>$text{'index_cmd'}</b></td>\n";
13 print "<td><input name=cmd size=60></td> </tr>\n";
15 open(COMMANDS, $commands_file);
16 chop(@commands = <COMMANDS>);
19 print "<tr> <td align=right><b>$text{'index_old'}</b></td>\n";
20 print "<td><select name=old>\n";
21 foreach $c (&unique(@commands)) {
24 print "</select> <input type=submit name=clear ",
25 "value='$text{'index_clear'}'></td> </tr>\n";
28 %serv = map { $_, 1 } split(/ /, $config{'server'});
29 print "<tr> <td valign=top><b>$text{'index_server'}</b></td>\n";
30 print "<td><select multiple size=5 name=server>\n";
31 printf "<option value=ALL %s>%s\n",
32 $serv{'ALL'} ? 'selected' : '', $text{'index_all'};
33 printf "<option value=* %s>%s\n",
34 $serv{'*'} ? 'selected' : '', $text{'index_this'};
35 foreach $s (grep { $_->{'user'} }
36 sort { $a->{'host'} cmp $b->{'host'} }
37 &servers::list_servers()) {
38 printf "<option value=%s %s>%s\n",
39 $s->{'host'}, $serv{$s->{'host'}} ? "selected" : "",
40 $s->{'host'}.($s->{'desc'} ? " (".$s->{'desc'}.")" : "");
42 foreach $g (&servers::list_all_groups()) {
43 $gn = "group_".$g->{'name'};
44 printf "<option value=%s %s>%s\n",
45 $gn, $serv{$gn} ? "selected" : "",
46 &text('index_group', $g->{'name'});
48 print "</select></td> </tr>\n";
51 print "<td colspan=2><input type=submit value='$text{'index_run'}'></td> </tr>\n";
53 print "</table></form>\n";
55 &ui_print_footer("/", $text{'index'});