6 require_once 'plc_login.php';
8 // Get session and API handles
9 require_once 'plc_session.php';
13 require_once 'plc_drupal.php';
14 include 'plc_header.php';
17 require_once 'plc_functions.php';
18 require_once 'plc_minitabs.php';
19 require_once 'plc_tables.php';
20 require_once 'plc_details.php';
22 // --------------------
23 // recognized URL arguments
24 $nodegroup_id=intval($_GET['id']);
25 if ( ! $nodegroup_id ) { plc_error('Malformed URL - id not set'); return; }
28 // Get all columns as we focus on only one entry
29 $nodegroups= $api->GetNodeGroups( array($nodegroup_id));
31 if (empty($nodegroups)) {
32 drupal_set_message ("NodeGroup " . $nodegroup_id . " not found");
36 $nodegroup=$nodegroups[0];
37 $node_ids=$nodegroup['node_ids'];
38 $tagname=$nodegroup['tagname'];
40 # fetch corresponding nodes
41 $node_columns = array("hostname","node_id");
43 $nodes = $api->GetNodes( $node_ids, $node_columns);
45 $tabs ["All nodegroups"] = array ('url'=>l_nodegroups(),
46 'bubble'=>'All nodegroups');
47 $tabs ["All tags"] = array ('url'=>l_tags(),
48 'bubble'=>'All tags');
49 $tabs ["Local nodes"] = array ('url'=>l_nodes_peer('local'),
50 'bubble'=>'All local nodes');
52 drupal_set_title("Details for node group " . $nodegroup['groupname']);
55 $details=new PlcDetails(false);
57 $details->line ("Node group name",$nodegroup['groupname']);
58 $details->line ("Based on tag",href(l_tag($nodegroup['tag_type_id']),$tagname));
59 $details->line("Matching value",$nodegroup['value']);
60 $details->line("# nodes",count($nodegroup['node_ids']));
63 // xxx : add & delete buttons would make sense here too
66 $headers["Hostname"]="string";
68 $table = new PlcTable("nodegroup_nodes",$headers,0,array('search_width'=>15));
70 if ($nodes) foreach ($nodes as $node) {
72 $table->cell ( href (l_node ($node['node_id']),$node['hostname']));
78 include 'plc_footer.php';