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';
21 //require_once 'plc_forms.php';
22 //require_once 'plc_peers.php';
24 // --------------------
25 // recognized URL arguments
26 $nodegroup_id=intval($_GET['id']);
27 if ( ! $nodegroup_id ) { plc_error('Malformed URL - id not set'); return; }
30 // Get all columns as we focus on only one entry
31 $nodegroups= $api->GetNodeGroups( array($nodegroup_id));
33 if (empty($nodegroups)) {
34 drupal_set_message ("NodeGroup " . $nodegroup_id . " not found");
38 $nodegroup=$nodegroups[0];
39 $node_ids=$nodegroup['node_ids'];
40 $tagname=$nodegroup['tagname'];
42 # fetch corresponding nodes
43 $node_columns = array("hostname","node_id");
45 $nodes = $api->GetNodes( $node_ids, $node_columns);
47 $tabs ["All nodegroups"] = array ('url'=>l_nodegroups(),
48 'bubble'=>'All nodegroups');
49 $tabs ["All tags"] = array ('url'=>l_tags(),
50 'bubble'=>'All tags');
51 $tabs ["Local nodes"] = array ('url'=>l_nodes_peer('local'),
52 'bubble'=>'All local nodes');
54 drupal_set_title("Details for node group " . $nodegroup['groupname']);
58 plc_details_line ("Node group name",$nodegroup['groupname']);
59 plc_details_line ("Based on tag",href(l_tag($nodegroup['tag_type_id']),$tagname));
60 plc_details_line("Matching value",$nodegroup['value']);
61 plc_details_line("# nodes",count($nodegroup['node_ids']));
64 // xxx : add & delete buttons would make sense here too
67 $headers["Hostname"]="string";
69 $table = new PlcTable("nodegroup_nodes",$headers,0,array('search_width'=>15));
71 if ($nodes) foreach ($nodes as $node) {
73 $table->cell ( href (l_node ($node['node_id']),$node['hostname']));
79 include 'plc_footer.php';