Handle hostnames with upper-case letters
[webmin.git] / bacula-backup / list_pools.cgi
1 #!/usr/local/bin/perl
2 # Show a list of all backup pools
3
4 require './bacula-backup-lib.pl';
5 &ui_print_header(undef, $text{'pools_title'}, "", "pools");
6
7 $conf = &get_director_config();
8 @pools = &find("Pool", $conf);
9 &sort_by_name(\@pools);
10 if (@pools) {
11         print &ui_form_start("delete_pools.cgi", "post");
12         @links = ( &select_all_link("d"),
13                    &select_invert_link("d"),
14                    "<a href='edit_pool.cgi?new=1'>$text{'pools_add'}</a>" );
15         print &ui_links_row(\@links);
16         @tds = ( "width=5", "width=30%", "width=40%", "width=30%" );
17         print &ui_columns_start([ "", $text{'pools_name'},
18                                   $text{'pools_type'},
19                                   $text{'pools_reten'} ], "100%", 0, \@tds);
20         foreach $f (@pools) {
21                 $name = &find_value("Name", $f->{'members'});
22                 $type = &find_value("Pool Type", $f->{'members'});
23                 $reten = &find_value("Volume Retention", $f->{'members'});
24                 print &ui_checked_columns_row([
25                         "<a href='edit_pool.cgi?name=".&urlize($name)."'>".
26                         $name."</a>",
27                         $type,
28                         $reten,
29                         ], \@tds, "d", $name);
30                 }
31         print &ui_columns_end();
32         print &ui_links_row(\@links);
33         print &ui_form_end([ [ "delete", $text{'pools_delete'} ] ]);
34         }
35 else {
36         print "<b>$text{'pools_none'}</b><p>\n";
37         print "<a href='edit_pool.cgi?new=1'>$text{'pools_add'}</a><br>\n";
38         }
39
40 &ui_print_footer("", $text{'index_return'});
41