3 # Displays a list of existing delay pools
5 require './squid-lib.pl';
6 $access{'delay'} || &error($text{'delay_ecannot'});
7 &ui_print_header(undef, $text{'delay_title'}, "", "edit_delay", 0, 0, 0, &restart_button());
10 # Display all known delay pools
11 $pools = &find_value("delay_pools", $conf);
12 @links = ( &select_all_link("d"),
13 &select_invert_link("d"),
14 "<a href='edit_pool.cgi?new=1'>$text{'delay_add'}</a>" );
16 @pools = sort { $a->{'values'}->[0] <=> $b->{'values'}->[0] }
17 &find_config("delay_class", $conf);
18 @params = &find_config("delay_parameters", $conf);
19 print &ui_form_start("delete_pools.cgi", "post");
20 print &ui_links_row(\@links);
22 print &ui_columns_start([ "",
28 $squid_version >= 3 ? (
30 $text{'delay_tag'} ) : ( ),
33 local ($pr) = grep { $_->{'values'}->[0] ==
34 $p->{'values'}->[0] } @params;
36 push(@cols, "<a href='edit_pool.cgi?idx=$p->{'values'}->[0]'>".
37 "$p->{'values'}->[0]</a>");
38 push(@cols, $text{"delay_class_$p->{'values'}->[1]"});
39 if ($p->{'values'}->[1] == 5) {
40 push(@cols, "", "", "", "");
41 push(@cols, &pool_param($pr->{'values'}->[1]));
44 push(@cols, &pool_param($pr->{'values'}->[1]));
45 if ($p->{'values'}->[1] == 2) {
46 push(@cols, &pool_param($pr->{'values'}->[2]));
50 push(@cols, &pool_param($pr->{'values'}->[3]));
51 push(@cols, &pool_param($pr->{'values'}->[2]));
53 if ($squid_version >= 3) {
54 if ($p->{'values'}->[1] == 4) {
55 push(@cols, &pool_param(
56 $pr->{'values'}->[4]));
64 print &ui_checked_columns_row(\@cols, \@tds,
65 "d", $p->{'values'}->[0]);
67 print &ui_columns_end();
68 print &ui_links_row(\@links);
69 print &ui_form_end([ [ "delete", $text{'delay_delete'} ] ]);
72 print "<b>$text{'delay_none'}</b><p>\n";
73 print &ui_links_row([ $links[2] ]);
76 print "<form action=save_delay.cgi>\n";
77 print "<table border width=100%>\n";
78 print "<tr $tb> <td><b>$text{'delay_header'}</b></td> </tr>\n";
79 print "<tr $cb> <td><table width=100%>\n";
82 print &opt_input($text{'delay_initial'}, "delay_initial_bucket_level", $conf,
83 $text{'default'}, 4, "%");
84 print "<td colspan=2 width=50%></td>\n";
87 print "</table></td></tr></table>\n";
88 print "<input type=submit value='$text{'save'}'></form>\n";
90 &ui_print_footer("", $text{'eicp_return'});
95 if ($_[0] =~ /^([0-9\-]+)\/([0-9\-]+)$/) {
96 return $1 == -1 ? $text{'delay_unlimited'} :
97 &text('delay_param', "$1", "$2");