2 # Show all groups that are actually templates for OC-Host node groups
4 require './bacula-backup-lib.pl';
5 &ui_print_header(undef, $text{'groups_title'}, "", "groups");
7 $conf = &get_director_config();
8 @groups = &find("Client", $conf);
9 @groups = grep { $name = &find_value("Name", $_->{'members'});
10 $name =~ /^ocgroup_/ } @groups;
11 &sort_by_name(\@groups);
13 print &ui_form_start("delete_groups.cgi", "post");
14 @links = ( &select_all_link("d"),
15 &select_invert_link("d") );
16 print &ui_links_row(\@links);
17 @tds = ( "width=5", "width=30%", "width=40%", "width=30%" );
18 print &ui_columns_start([ "", $text{'groups_name'},
20 $text{'groups_catalog'} ], "100%", 0, \@tds);
21 foreach $f (@groups) {
22 $name = &find_value("Name", $f->{'members'});
23 $name =~ s/^ocgroup_//g;
24 $port = &find_value("FDPort", $f->{'members'});
25 $cat = &find_value("Catalog", $f->{'members'});
27 print &ui_checked_columns_row([
28 "<a href='edit_group.cgi?name=".&urlize($name)."'>".
32 ], \@tds, "d", $name);
34 print &ui_columns_end();
35 print &ui_links_row(\@links);
36 print &ui_form_end([ [ "delete", $text{'groups_delete'} ] ]);
39 print "<b>$text{'groups_none'}</b><p>\n";
42 @ng = &list_node_groups();
43 @canng = grep { !$done{$_->{'name'}} } @ng;
46 print &ui_form_start("edit_group.cgi");
47 print "<b>$text{'groups_add'}</b>\n";
48 print &ui_select("new", undef,
49 [ map { [ $_->{'name'}, &text('groups_info', $_->{'name'}, scalar(@{$_->{'members'}})) ] } @canng ]);
50 print &ui_submit($text{'groups_ok'});
54 print "<b>$text{'groups_already'}</b><p>\n";
57 print "<b>$text{'groups_noadd'}</b><p>\n";
60 &ui_print_footer("", $text{'index_return'});