3 # Show all cron jobs that run on multiple servers
5 require './cluster-cron-lib.pl';
6 &ui_print_header(undef, $text{'index_title'}, "", "intro", 0, 1);
8 @links = ( &select_all_link("d"),
9 &select_invert_link("d"),
10 "<a href='edit.cgi?new=1'>$text{'index_add'}</a>" );
12 @jobs = &list_cluster_jobs();
14 print &ui_form_start("delete_jobs.cgi", "post");
15 print &ui_links_row(\@links);
16 print &ui_columns_start([ "",
17 $cron::text{'index_user'},
18 $cron::text{'index_active'},
19 $text{'index_servers'},
20 $cron::text{'index_command'} ],
22 [ "width=5", undef, undef, undef, "colspan=2" ]);
25 push(@cols, "<tt>$j->{'cluster_user'}</tt>");
27 $j->{'active'} ? $text{'yes'}
28 : "<font color=#ff0000>$text{'no'}</font>");
29 local @servers = map {
30 $_ eq "*" ? $text{'edit_this'} :
31 $_ =~ /^group_(.*)$/ ? &text('edit_group', "$1") : $_
32 } split(/\s+/, $j->{'cluster_server'});
34 push(@cols, join(", ", @servers[0 .. 1]).", ".
35 &text('index_more', @servers-2));
38 push(@cols, join(", ", @servers));
40 local $max = $cron::config{'max_len'} || 10000;
41 local $cmd = $j->{'cluster_command'};
43 sprintf "<a href='edit.cgi?id=$j->{'cluster_id'}'>%s</a>%s",
45 &html_escape(substr($cmd, 0, $max)) :
46 $cmd !~ /\S/ ? "BLANK" : &html_escape($cmd),
47 length($cmd) > $max ? " ..." : "");
48 push(@cols, "<a href='exec.cgi?id=$j->{'cluster_id'}'>".
49 "$text{'index_run'}</a>");
50 print &ui_checked_columns_row(
52 [ "width=5", undef, undef, undef, undef, "width=10" ],
53 "d", $j->{'cluster_id'});
55 print &ui_columns_end();
56 print &ui_links_row(\@links);
57 print &ui_form_end([ [ "delete", $cron::text{'index_delete'} ] ]);
60 print "<b>$text{'index_none'}</b><p>\n";
61 print &ui_links_row([ $links[2] ]);
64 &ui_print_footer("/", $text{'index'});