2 # Show a form for displaying the status of one pool
4 require './bacula-backup-lib.pl';
5 &ui_print_header(undef, $text{'poolstatus_title'}, "", "poolstatus");
9 $conf = &get_director_config();
10 @pools = map { $n=&find_value("Name", $_->{'members'}) }
12 @pools = sort { lc($a) cmp lc($b) } @pools;
14 $in{'pool'} ||= $pools[0];
16 print &ui_form_start("poolstatus_form.cgi");
17 print "<b>$text{'poolstatus_show'}</b>\n";
18 print &ui_select("pool", $in{'pool'},
19 [ map { [ $_ ] } @pools ]);
20 print &ui_submit($text{'poolstatus_ok'}),"<br>\n";
24 # Show volumes in this pool
25 @volumes = &get_pool_volumes($in{'pool'});
27 print &ui_subheading($text{'poolstatus_volumes'});
28 $never = "<i>$text{'poolstatus_never'}</i>";
30 print &ui_form_start("delete_volumes.cgi", "post");
31 print &ui_hidden("pool", $in{'pool'}),"\n";
32 print &select_all_link("d", 1),"\n";
33 print &select_invert_link("d", 1),"<br>\n";
35 print &ui_columns_start([ "",
36 $text{'poolstatus_name'},
37 $text{'poolstatus_type'},
38 $text{'poolstatus_first'},
39 $text{'poolstatus_last'},
40 $text{'poolstatus_bytes'},
41 $text{'poolstatus_status'} ],
43 foreach $v (@volumes) {
44 print &ui_columns_row([
45 &ui_checkbox("d", $v->{'volumename'}),
48 $v->{'firstwritten'} || $never,
49 $v->{'lastwritten'} || $never,
54 print &ui_columns_end();
55 print &select_all_link("d", 1),"\n";
56 print &select_invert_link("d", 1),"<br>\n";
57 print &ui_form_end([ [ "delete",$text{'poolstatus_delete'} ] ]);
60 print "<b>$text{'poolstatus_none'}</b><p>\n";
64 &ui_print_footer("", $text{'index_return'});
68 return $jobs{$_[0]} ? "<a href='edit_job.cgi?name=".&urlize($_[0])."'>$_[0]</a>" : $_[0];