OLD");
+//print_r($visiblecolumns);
+//$node_columns=array_merge($node_fixed_columns,$visiblecolumns);
+
+
// server-side filtering - set pattern in $_GET for filtering on hostname
if ($pattern) {
$node_filter['hostname']=$pattern;
@@ -159,7 +255,10 @@ $nifty=new PlekitNifty ('','objects-list','big');
$nifty->start();
$headers = array (); $offset=0;
$notes=array();
+$notes [] = "For information about the different columns please see the node table layout tab above or mouse over the column headers";
+
+/*
// fixed columns
if (plc_is_admin()) {
$short="I"; $long="node_id"; $type='int';
@@ -183,15 +282,47 @@ $headers=array_merge($headers,$visibletags->headers());
$notes=array_merge($notes,$visibletags->notes());
$short="?"; $long="extra status info"; $type='string';
$headers[$short]=array('type'=>$type,'title'=>$long); $notes []= "$short = $long";
+*/
+
+$info_header = array();
+$short="?"; $long="extra status info"; $type='string';
+$info_header[$short]=array('type'=>$type,'title'=>$long, 'label'=>'?', 'header'=>'?', 'visible'=>true);
+//$notes []= "$short = $long";
+//$info_header["?"] = "none";
+$headers = array_merge($ConfigureColumns->get_headers(),$info_header);
+
+//print("HEADERS");
+//print_r($headers);
+
+$toggle_nodes=new PlekitToggle('nodes-column-configuration',
+ "Node table layout",
+ array('visible'=>'1'));
+$toggle_nodes->start();
+print("
");
+print("");
+print("");
+print("");
+print("");
+print("
");
+//print("");
+print("");
+$ConfigureColumns->configuration_panel_html(true);
+$ConfigureColumns->javascript_init();
+$toggle_nodes->end();
+
+$table_options = array('notes'=>$notes,
+ 'search_width'=>15,
+ 'pagesize'=>20,
+ 'configurable'=>true);
# initial sort on hostnames
-$table=new PlekitTable ("nodes",$headers,4+$offset);
+$table=new PlekitTable ("nodes",$headers,3+$offset, $table_options);
$table->start();
$peers = new Peers ($api);
// write rows
foreach ($nodes as $node) {
- $node_obj = new Node ($node);
+ //$node_obj = new Node ($node);
$hostname=$node['hostname'];
$node_id=$node['node_id'];
$site_id=$node['site_id'];
@@ -202,22 +333,27 @@ foreach ($nodes as $node) {
$peer_id=$node['peer_id'];
$table->row_start();
+ $table->cell($node['node_id'], array('display'=>'none'));
if (plc_is_admin()) $table->cell(l_node_t($node_id,$node_id));
- $peers->cell ($table,$peer_id);
- $table->cell (topdomain($hostname));
- $table->cell (l_site_t($site_id,$login_base));
$table->cell (l_node_t($node_id,$hostname));
- $table->cell (l_interface_t($interface_id,$ip),array('only-if'=> !$peer_id));
- list($label,$class) = $node_obj->status_label_class();
+ $peers->cell ($table,$peer_id);
+ //$table->cell (topdomain($hostname));
+ $node['domain'] = topdomain($hostname);
+ //$table->cell (l_site_t($site_id,$login_base));
+ $node['sitename'] = l_site_t($site_id,$login_base);
+ //$table->cell (l_interface_t($interface_id,$ip),array('only-if'=> !$peer_id));
+ $node['ipaddress'] = l_interface_t($interface_id,$ip);
+ list($label,$class) = Node::status_label_class_($node);
$table->cell ($label,array('class'=>$class));
- $table->cell (count($node['slice_ids']));
- foreach ($visiblecolumns as $tagname) $table->cell($node[$tagname]);
+ //$table->cell (count($node['slice_ids']));
+ //foreach ($visiblecolumns as $tagname) $table->cell($node[$tagname]);
+ $ConfigureColumns->cells($table, $node);
$table->cell (node_status($node));
$table->row_end();
}
-$table->end(array('notes'=>$notes));
+$table->end();
$nifty->end();
//plekit_linetabs ($tabs,"bottom");
@@ -226,3 +362,19 @@ $nifty->end();
include 'plc_footer.php';
?>
+
+
+