X-Git-Url: http://git.onelab.eu/?p=plewww.git;a=blobdiff_plain;f=planetlab%2Fnodes%2Fnodes.php;fp=planetlab%2Fnodes%2Fnodes.php;h=5fbbe0ef16b07334b6d78790e8e199aa4495de8c;hp=18ca93d57b2a69266cfae0901f516fd98b31e54d;hb=b9c88ef1d81730922317338a3e774d987ce1889d;hpb=229bb4e91f366f2d863449c67029a5167c0f66fc diff --git a/planetlab/nodes/nodes.php b/planetlab/nodes/nodes.php index 18ca93d..5fbbe0e 100644 --- a/planetlab/nodes/nodes.php +++ b/planetlab/nodes/nodes.php @@ -28,7 +28,7 @@ drupal_set_html_head(' '); -// -------------------- +// -------------------- // recognized URL arguments $peerscope = get_array($_GET, 'peerscope'); $pattern = get_array($_GET, 'pattern'); @@ -47,77 +47,73 @@ if (count (plc_my_site_ids()) == 1) { } $tabs []= tab_nodes_local(); -// -------------------- +// -------------------- $node_filter=array(); ////////////////// // performs sanity check and summarize the result in a single column function node_status ($node) { - $messages=array(); - if ($node['node_type'] != 'regular' && $node['node_type'] != 'reservable' ) - $messages []= $node['node_type']; - - // checks on local nodes only - if ( ( ! $node['peer_id']) ) { - // has it got interfaces - if (count($node['interface_ids']) == 0) - $messages []= "No interface"; - } - return plc_vertical_table($messages,'plc-warning'); + $messages=array(); + if ($node['node_type'] != 'regular' && $node['node_type'] != 'reservable' ) + $messages []= $node['node_type']; + + // checks on local nodes only + if ( ( ! $node['peer_id']) ) { + // has it got interfaces + if (count($node['interface_ids']) == 0) + $messages []= "No interface"; + } + return plc_vertical_table($messages,'plc-warning'); } -if (plc_is_admin()) - $default_configuration = "ID:f|hostname:f|ST:f|AU:f|RES:f"; -else +if (plc_is_admin()) { + $default_configuration = "ID:f|hostname:f|ST:f|AU:f|RES:f"; +} else { $default_configuration = "hostname:f|ST:f|AU:f|RES:f"; +} //$extra_default = "LCN|DN|R|L|OS|MS|SN"; $column_configuration = ""; $slice_column_configuration = ""; $show_configuration = ""; +$conf_tag_id = ""; +$show_tag_id = ""; $PersonTags=$api->GetPersonTags (array('person_id'=>$plc->person['person_id'])); //print_r($PersonTags); foreach ($PersonTags as $ptag) { - if ($ptag['tagname'] == 'columnconf') - { - $column_configuration = $ptag['value']; - $conf_tag_id = $ptag['person_tag_id']; - } - if ($ptag['tagname'] == 'showconf') - { - $show_configuration = $ptag['value']; - $show_tag_id = $ptag['person_tag_id']; - } + if ($ptag['tagname'] == 'columnconf') { + $column_configuration = $ptag['value']; + $conf_tag_id = $ptag['person_tag_id']; + } + if ($ptag['tagname'] == 'showconf') { + $show_configuration = $ptag['value']; + $show_tag_id = $ptag['person_tag_id']; + } } //print("column configuration = ".$column_configuration); $nodesconf_exists = false; -if ($column_configuration == "") -{ - $column_configuration = "nodes;default"; - $nodesconf_exists = true; -} -else { - $slice_conf = explode(";",$column_configuration); - for ($i=0; $inode table layout tab above or mouse over the column headers"; $info_header = array(); -$short="?"; $long="extra status info"; $type='string'; -$info_header[$short]=array('type'=>$type,'title'=>$long, 'label'=>'?', 'header'=>'?', 'visible'=>true); +$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); @@ -336,7 +332,7 @@ href="http://trac.myslice.info">http://trac.myslice.info. '; $toggle_nodes=new PlekitToggle('nodes-layout', "Node table layout", - array('visible'=>NULL, + array('visible'=>NULL, 'info-text'=>$layout_help, 'info-visible'=>$show_columns_message)); $toggle_nodes->start(); @@ -378,7 +374,7 @@ foreach ($nodes as $node) { $ip=$interface_hash[$node['node_id']]['ip']; $interface_id=$interface_hash[$node['node_id']]['interface_id']; $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)); @@ -401,7 +397,7 @@ foreach ($nodes as $node) { $ConfigureColumns->cells($table, $node); $table->cell (node_status($node)); $table->row_end(); - + } $table->end();