(*) slices list has links towards the slice page with the details area closed and...
[plewww.git] / planetlab / slices / slice.php
1 <?php
2
3 // $Id$
4
5 // Require login
6 require_once 'plc_login.php';
7
8 // Get session and API handles
9 require_once 'plc_session.php';
10 global $plc, $api;
11
12 // Print header
13 require_once 'plc_drupal.php';
14 include 'plc_header.php';
15
16 // Common functions
17 require_once 'plc_functions.php';
18 require_once 'plc_peers.php';
19 require_once 'linetabs.php';
20 require_once 'table.php';
21 require_once 'details.php';
22 require_once 'toggle.php';
23 require_once 'form.php';
24
25 // keep css separate for now
26 drupal_set_html_head('
27 <link href="/planetlab/css/my_slice.css" rel="stylesheet" type="text/css" />
28 ');
29
30 // -------------------- admins potentially need to get full list of users
31 ini_set('memory_limit','32M');
32
33 // -------------------- 
34 // recognized URL arguments
35 $slice_id=intval($_GET['id']);
36 if ( ! $slice_id ) { plc_error('Malformed URL - id not set'); return; }
37
38 ////////////////////
39 // Get all columns as we focus on only one entry
40 $slices= $api->GetSlices( array($slice_id));
41
42 if (empty($slices)) {
43   drupal_set_message ("Slice " . $slice_id . " not found");
44   return;
45  }
46
47 $slice=$slices[0];
48
49 // pull all node info to vars
50 $name= $slice['name'];
51 $expires = date( "d/m/Y", $slice['expires'] );
52 $site_id= $slice['site_id'];
53
54 //$node_ids=$slice['node_ids'];
55 $person_ids=$slice['person_ids'];
56 //$slice_tag_ids= $slice['slice_tag_ids'];
57
58 // get peers
59 $peer_id= $slice['peer_id'];
60 $peers=new Peers ($api);
61 $local_peer = ! $peer_id;
62
63 // gets site info
64 $sites= $api->GetSites( array( $site_id ) );
65 $site=$sites[0];
66 $site_name= $site['name'];
67 $max_slices = $site['max_slices'];
68 // xxx PIs
69 //$pis=$api->GetPersons(...)
70
71 // get all persons info
72 if (!empty($person_ids))
73   $persons=$api->GetPersons($person_ids,array('email','enabled'));
74
75
76 //////////////////////////////////////// building blocks for the renew area
77 // Constants
78 global $DAY;            $DAY = 24*60*60;
79 global $WEEK;           $WEEK = 7 * $DAY; 
80 global $MAX_WEEKS;      $MAX_WEEKS= 8;          // weeks from today
81 global $GRACE_DAYS;     $GRACE_DAYS=10;         // days for renewal promoted on top
82 global $NOW;            $NOW=mktime();
83
84 ////////////////////////////////////////////////////////////
85 // make the renew area on top and open if the expiration time is less than 10 days from now
86 function renew_needed ($slice) {
87   global $DAY, $NOW, $GRACE_DAYS;
88   $current_exp=$slice['expires'];
89
90   $time_left = $current_exp - $NOW;
91   $visible = $time_left/$DAY <= $GRACE_DAYS;
92   return $visible;
93 }
94
95 function renew_area ($slice,$site,$visible) {
96   global $DAY, $WEEK, $MAX_WEEKS, $GRACE_DAYS, $NOW;
97  
98   $current_exp=$slice['expires'];
99   $current_text = gmstrftime("%A %b-%d-%y %T %Z", $current_exp);
100   $max_exp= $NOW + ($MAX_WEEKS * $WEEK); // seconds since epoch
101   $max_text = gmstrftime("%A %b-%d-%y %T %Z", $max_exp);
102
103   // xxx some extra code needed to enable this area only if the slice description is OK:
104   // description and url must be non void
105   $toggle=
106     new PlekitToggle('renew',"Expires $current_text - Renew this slice",
107                      array("bubble"=>
108                            "Enter this zone if you wish to renew your slice",
109                            'visible'=>$visible));
110   $toggle->start();
111
112   // xxx message could take roles into account
113   if ($site['max_slices']<=0) {
114      $message= <<< EOF
115 <p class='my-slice-renewal'>Slice creation and renewal have been temporarily disabled for your
116 <site. This may have occurred because your site's nodes have been down
117 or unreachable for several weeks, and multiple attempts to contact
118 your site's PI(s) and Technical Contact(s) have all failed. If so,
119 contact your site's PI(s) and Technical Contact(s) and ask them to
120 bring up your site's nodes. Please visit your <a
121 href='/db/sites/index.php?id=$site_id'>site details</a> page to find
122 out more about your site's nodes, and how to contact your site's PI(s)
123 and Technical Contact(s).</p>
124 EOF;
125      echo $message;
126  
127   } else {
128     // xxx this is a rough cut and paste from the former UI
129     // showing a datepicker view could be considered as well with some extra work
130     // calculate possible extension lengths
131     $selectors = array();
132     foreach ( array ( 1 => "One more week", 
133                       2 => "Two more weeks", 
134                       3 => "Three more weeks", 
135                       4 => "One more month" ) as $weeks => $text ) {
136       $candidate_exp = $current_exp + $weeks*$WEEK;
137       if ( $candidate_exp < $max_exp) {
138         $selectors []= array('display'=>"$text (" . gmstrftime("%A %b-%d-%y %T %Z", $candidate_exp) . ")",
139                              'value'=>$candidate_exp);
140         $max_renewal_weeks=$weeks;
141         $max_renewal_date= gmstrftime("%A %b-%d-%y %T %Z", $candidate_exp);
142       }
143     }
144
145     if ( empty( $selectors ) ) {
146       print <<< EOF
147 <div class='my-slice-renewal'>
148 Slices annot be renewed more than $MAX_WEEKS weeks from now, i.e. not beyond $max_text. 
149 For this reason, the current slice cannot be renewed any further into the future, try again closer to expiration date.
150 </div>
151 EOF;
152      } else {
153       print <<< EOF
154 <div class='my-slice-renewal'>
155 <p>You must provide a short description as well as a link to a project website before renewing it.
156 Do <span class='bold'>not</span> provide bogus information; if a complaint is lodged against your slice 
157 and PlanetLab Operations is unable to determine what the normal behavior of your slice is, 
158 your slice may be deleted to resolve the complaint.</p>
159 <p><span class='bold'>NOTE:</span> 
160 Slices cannot be renewed beyond another $max_renewal_weeks week(s) ($max_renewal_date).
161 </p>
162 </div>
163 EOF;
164
165       $form = new PlekitForm (l_actions(),
166                               array('action'=>'renew-slice',
167                                     'slice_id'=>$slice['slice_id']));
168       $form->start();
169       print $form->label_html('expires','Duration');
170       print $form->select_html('expires',$selectors,array('label'=>'Pick one'));
171       print $form->submit_html('renew-button','Renew');
172       $form->end();
173     }
174   }
175  
176   $toggle->end();
177 }
178
179 ////////////////////////////////////////////////////////////
180
181 $am_in_slice = in_array(plc_my_person_id(),$person_ids);
182
183 if ($am_in_slice) {
184   drupal_set_title("My slice " . $name);
185  } else {
186   drupal_set_title("Slice " . $name);
187 }
188
189 $privileges = ( $local_peer && (plc_is_admin()  || plc_is_pi() || $am_in_slice));
190 $tags_privileges = $privileges || plc_is_admin();
191
192 $tabs=array();
193 $tabs [] = tab_nodes_slice($slice_id);
194 $tabs [] = tab_site($site_id);
195
196 // are these the right privileges for deletion ?
197 if ($privileges) {
198   $tabs ['Delete']= array('url'=>l_actions(),
199                           'method'=>'post',
200                           'values'=>array('action'=>'delete-slice','slice_id'=>$slice_id),
201                           'bubble'=>"Delete slice $name",
202                           'confirm'=>"Are you sure to delete slice $name");
203
204   $tabs["Events"]=array_merge(tablook_event(),
205                               array('url'=>l_event("Slice","slice",$slice_id),
206                                     'bubble'=>"Events for slice $name"));
207   $tabs["Comon"]=array_merge(tablook_comon(),
208                              array('url'=>l_comon("slice_id",$slice_id),
209                                    'bubble'=>"Comon page about slice $name"));
210 }
211
212 plekit_linetabs($tabs);
213
214 ////////////////////////////////////////
215 $peers->block_start($peer_id);
216
217 //////////////////////////////////////// renewal area 
218 // (1) close to expiration : show on top and open
219
220 if ($local_peer ) {
221   $renew_visible = renew_needed ($slice);
222   if ($renew_visible) renew_area ($slice,$site,true);
223  }
224
225
226 //////////////////// details
227 // default for opening the details section or not ?
228 if ($local_peer) {
229   $default_show_details = true;
230  } else {
231   $default_show_details = ! $renew_visible;
232  }
233   
234 $toggle = 
235   new PlekitToggle ('my-slice-details',"Details",
236                     array('bubble'=>
237                           'Display and modify details for that slice',
238                           'visible'=>get_arg('show_details',$default_show_details)));
239 $toggle->start();
240
241 $details=new PlekitDetails($privileges);
242 $details->form_start(l_actions(),array('action'=>'update-slice',
243                                        'slice_id'=>$slice_id,
244                                        'name'=>$name));
245
246 $details->start();
247 if (! $local_peer) {
248   $details->th_td("Peer",$peers->peer_link($peer_id));
249   $details->space();
250  }
251
252
253 $details->th_td('Name',$slice['name']);
254 $details->th_td('Description',$slice['description'],'description',
255                 array('input_type'=>'textarea',
256                       'width'=>50,'height'=>5));
257 $details->th_td('URL',$slice['url'],'url',array('width'=>50));
258 $details->tr_submit("submit","Update Slice");
259 $details->th_td('Expires',$expires);
260 $details->th_td('Instantiation',$slice['instantiation']);
261 $details->th_td('Site',l_site_obj($site));
262 // xxx show the PIs here
263 //$details->th_td('PIs',...);
264 $details->end();
265
266 $details->form_end();
267 $toggle->end();
268
269 //////////////////// persons
270 $person_columns = array('email','person_id','first_name','last_name','roles');
271 $persons=$api->GetPersons(array('person_id'=>$slice['person_ids']));
272 // just propose to add everyone else, 
273 // as regular persons can see only a fraction of the db anyway
274 $potential_persons=
275   $api->GetPersons(array('~person_id'=>$slice['person_ids'],'peer_id'=>NULL,'enabled'=>true),
276                    $person_columns);
277 $count=count($persons);
278
279 $toggle=
280   new PlekitToggle ('my-slice-persons',"$count Users",
281                     array('bubble'=>
282                           'Manage accounts attached to this slice',
283                           'visible'=>get_arg('show_persons',false)));
284 $toggle->start();
285
286 ////////// people currently in
287 // visible:
288 // hide if both current+add are included
289 // so user can chose which section is of interest
290 // show otherwise
291 $toggle_persons = new PlekitToggle ('my-slice-persons-current',
292                                     "$count people currently in $name",
293                                     array('visible'=>get_arg('show_persons_current',!$privileges)));
294 $toggle_persons->start();
295
296 $headers=array();
297 $headers['email']='string';
298 $headers['first']='string';
299 $headers['last']='string';
300 $headers['R']='string';
301 if ($privileges) $headers[plc_delete_icon()]="none";
302 $table=new PlekitTable('persons',$headers,'0',
303                        array('notes_area'=>false));
304 $form=new PlekitForm(l_actions(),array('slice_id'=>$slice['slice_id']));
305 $form->start();
306 $table->start();
307 if ($persons) foreach ($persons as $person) {
308   $table->row_start();
309   $table->cell(l_person_obj($person));
310   $table->cell($person['first_name']);
311   $table->cell($person['last_name']);
312   $table->cell(plc_vertical_table ($person['roles']));
313   if ($privileges) $table->cell ($form->checkbox_html('person_ids[]',$person['person_id']));
314   $table->row_end();
315 }
316 // actions area
317 if ($privileges) {
318
319   // remove persons
320   $table->tfoot_start();
321
322   $table->row_start();
323   $table->cell($form->submit_html ("remove-persons-from-slice","Remove selected"),
324                array('hfill'=>true,'align'=>'right'));
325   $table->row_end();
326  }
327 $table->end();
328 $toggle_persons->end();
329
330 ////////// people to add
331 if ($privileges) {
332   $count=count($potential_persons);
333   $toggle_persons = new PlekitToggle ('my-slice-persons-add',
334                                       "$count people may be added to $name",
335                                       array('visible'=>get_arg('show_persons_add',false)));
336   $toggle_persons->start();
337   if ( ! $potential_persons ) {
338     // xxx improve style
339     echo "<p class='not-relevant'>No person to add</p>";
340   } else {
341     $headers=array();
342     $headers['email']='string';
343     $headers['first']='string';
344     $headers['last']='string';
345     $headers['R']='string';
346     $headers['+']="none";
347     $options = array('notes_area'=>false,
348                      'search_width'=>15,
349                      'pagesize'=>8);
350     // show search for admins only as other people won't get that many names to add
351     if ( ! plc_is_admin() ) $options['search_area']=false;
352     
353     $table=new PlekitTable('add_persons',$headers,'0',$options);
354     $form=new PlekitForm(l_actions(),array('slice_id'=>$slice['slice_id']));
355     $form->start();
356     $table->start();
357     if ($potential_persons) foreach ($potential_persons as $person) {
358         $table->row_start();
359         $table->cell(l_person_obj($person));
360         $table->cell($person['first_name']);
361         $table->cell($person['last_name']);
362         $table->cell(plc_vertical_table ($person['roles']));
363         $table->cell ($form->checkbox_html('person_ids[]',$person['person_id']));
364         $table->row_end();
365       }
366     // add users
367     $table->tfoot_start();
368     $table->row_start();
369     $table->cell($form->submit_html ("add-persons-in-slice","Add selected"),
370                  array('hfill'=>true,'align'=>'right'));
371     $table->row_end();
372     $table->end();
373     $form->end();
374   }
375   $toggle_persons->end();
376 }
377 $toggle->end();
378
379 //////////////////////////////////////////////////////////// Nodes
380 // the nodes details to display here
381 // (1) we search for the tag types for which 'category' matches 'node*/ui*'
382 // all these tags will then be tentatively displayed in this area
383 // (2) further information can also be optionally specified in the category:
384 //     (.) we split the category with '/' and search for assignments of the form var=value
385 //     (.) header can be set to supersede the column header (default is tagname)
386 //     (.) rank can be used for ordering the columns (default is tagname)
387 //     (.) type is passed to the javascript table, for sorting (default is 'string')
388
389 // minimal list as a start
390 $node_fixed_columns = array('hostname','node_id','peer_id','slice_ids_whitelist','run_level','boot_state');
391 // scan tag types to find relevant additional columns
392 $nodeui_tag_types = $api->GetTagTypes(array('category'=>'node*/ui*'));
393 // extract tagname
394 $node_tag_columns = array_map(create_function('$tt','return $tt["tagname"];'),$nodeui_tag_types);
395 // build an ordered list of chunks {'tagname','header','rank','description'}
396 $more_tags = array();
397 foreach ($nodeui_tag_types as $tag_type) {
398   $tagname=$tag_type['tagname'];
399   $chunk=array();
400   $chunk['tagname']=$tagname;
401   $chunk['header']=$tagname;
402   $chunk['rank']=$tagname;
403   $chunk['type']='string';
404   $chunk['description']=$tag_type['description'];
405   $category_tokens=split('/',$tag_type['category']);
406   foreach ($category_tokens as $token) {
407     $assign=split('=',$token);
408     if (count($assign)==2) 
409       $chunk[$assign[0]]=$assign[1];
410   }
411   $more_tags []= $chunk;
412 }
413
414 function sort_chunks ($ch1, $ch2) { return strcmp($ch1['rank'],$ch2['rank']); }
415 usort ($more_tags, sort_chunks);
416
417 //plc_debug('ordered additional tags',$more_tags);
418
419 $node_columns=array_merge($node_fixed_columns,$node_tag_columns);
420 $nodes=$api->GetNodes(array('node_id'=>$slice['node_ids']),$node_columns);
421 $potential_nodes=$api->GetNodes(array('~node_id'=>$slice['node_ids']),$node_columns);
422 $count=count($nodes);
423
424 $toggle=new PlekitToggle ('my-slice-nodes',"$count Nodes",
425                           array('bubble'=>
426                                 'Manage nodes attached to this slice',
427                                 'visible'=>get_arg('show_nodes',false)));
428 $toggle->start();
429
430 ////////// nodes currently in
431 $count=count($nodes);
432 $toggle_nodes=new PlekitToggle('my-slice-nodes-current',
433                                "$count nodes currently in $name",
434                                array('visible'=>get_arg('show_nodes_current',!$privileges)));
435 $toggle_nodes->start();
436
437 $headers=array();
438 $notes=array();
439 $headers['peer']='string';
440 $headers['hostname']='string';
441 $headers['S']='string';
442 $notes[]='S = last known status';
443 foreach ($more_tags as $chunk) {
444   $header=$chunk['header'];
445   $headers[$header]=$chunk['type'];
446   if ($header != $chunk['tagname']) $notes []= $header . ' = ' . $chunk['description'];
447 }
448 if ($privileges) $headers[plc_delete_icon()]="none";
449
450 $table_options = array('notes'=>$notes,
451                        'search_width'=>15,
452                        'pagesize'=>20);
453 $table=new PlekitTable('nodes',$headers,'1',$table_options);
454
455 $form=new PlekitForm(l_actions(),array('slice_id'=>$slice['slice_id']));
456 $form->start();
457 $table->start();
458 if ($nodes) foreach ($nodes as $node) {
459   $table->row_start();
460   $peers->cell($table,$node['peer_id']);
461   $table->cell(l_node_obj($node));
462   $run_level=$node['run_level'];
463   if ( empty($run_level)) $run_level=$node['boot_state'];
464   $class=($run_level == 'boot') ? 'node-ok' : 'node-ko';
465   $table->cell($run_level,array('class'=>$class));
466   foreach ($more_tags as $chunk) $table->cell($node[$chunk['tagname']]);
467
468   if ($privileges) $table->cell ($form->checkbox_html('node_ids[]',$node['node_id']));
469   $table->row_end();
470 }
471 // actions area
472 if ($privileges) {
473
474   // remove nodes
475   $table->tfoot_start();
476
477   $table->row_start();
478   $table->cell($form->submit_html ("remove-nodes-from-slice","Remove selected"),
479                array('hfill'=>true,'align'=>'right'));
480   $table->row_end();
481  }
482 $table->end();
483 $toggle_nodes->end();
484
485 ////////// nodes to add
486 if ($privileges) {
487   $new_potential_nodes = array();
488   if ($potential_nodes) foreach ($potential_nodes as $node) {
489       $emptywl=empty($node['slice_ids_whitelist']);
490       $inwl = (!emptywl) and in_array($slice['slice_id'],$node['slice_ids_whitelist']);
491       if ($emptywl or $inwl)
492         $new_potential_nodes[]=$node;
493   }
494   $potential_nodes=$new_potential_nodes;
495
496   $count=count($potential_nodes);
497   $toggle_nodes=new PlekitToggle('my-slice-nodes-add',
498                                  "$count more nodes available",
499                                  array('visible'=>get_arg('show_nodes_add',false)));
500   $toggle_nodes->start();
501
502   if ( ! $potential_nodes ) {
503     // xxx improve style
504     echo "<p class='not-relevant'>No node to add</p>";
505   } else {
506     $headers=array();
507     $notes=array();
508     $headers['peer']='string';
509     $headers['hostname']='string';
510     $headers['S']='string';
511     $notes[]='S = last known status';
512     foreach ($more_tags as $chunk) {
513       $header=$chunk['header'];
514       $headers[$header]=$chunk['type'];
515       if ($header != $chunk['tagname']) $notes []= $header . ' = ' . $chunk['description'];
516     }
517     $headers['+']="none";
518     
519     $table=new PlekitTable('add_nodes',$headers,'1', $table_options);
520     $form=new PlekitForm(l_actions(),
521                          array('slice_id'=>$slice['slice_id']));
522     $form->start();
523     $table->start();
524     if ($potential_nodes) foreach ($potential_nodes as $node) {
525         $table->row_start();
526         $peers->cell($table,$node['peer_id']);
527         $table->cell(l_node_obj($node));
528         $run_level=$node['run_level'];
529         if ( empty($run_level)) $run_level=$node['boot_state'];
530         $class=($run_level == 'boot') ? 'node-ok' : 'node-ko';
531         $table->cell($run_level,array('class'=>$class));
532         foreach ($more_tags as $chunk) $table->cell($node[$chunk['tagname']]);
533         $table->cell ($form->checkbox_html('node_ids[]',$node['node_id']));
534         $table->row_end();
535       }
536     // add nodes
537     $table->tfoot_start();
538     $table->row_start();
539     $table->cell($form->submit_html ("add-nodes-in-slice","Add selected"),
540                  array('hfill'=>true,'align'=>'right'));
541     $table->row_end();
542     $table->end();
543     $form->end();
544   }
545   $toggle_nodes->end();
546 }
547 $toggle->end();
548
549 //////////////////////////////////////////////////////////// Tags
550 //if ( $local_peer ) {
551   $tags=$api->GetSliceTags (array('slice_id'=>$slice_id));
552   function get_tagname ($tag) { return $tag['tagname'];}
553   $tagnames = array_map ("get_tagname",$tags);
554   
555   $toggle = new PlekitToggle ('slice-tags',count_english_warning($tags,'tag'),
556                               array('bubble'=>'Inspect and set tags on tat slice',
557                                     'visible'=>get_arg('show_tags',false)));
558   $toggle->start();
559   
560   $headers=array(
561     "Name"=>"string",
562     "Value"=>"string",
563     "Node"=>"string",
564     "NodeGroup"=>"string");
565   if ($tags_privileges) $headers[plc_delete_icon()]="none";
566   
567   $table_options=array("notes_area"=>false,"pagesize_area"=>false,"search_width"=>10);
568   $table=new PlekitTable("slice_tags",$headers,'0',$table_options);
569   $form=new PlekitForm(l_actions(),
570                        array('slice_id'=>$slice['slice_id']));
571   $form->start();
572   $table->start();
573   if ($tags) {
574     foreach ($tags as $tag) {
575       $node_name = "ALL";
576       if ($tag['node_id']) {
577         $nodes = $api->GetNodes(array('node_id'=>$tag['node_id']));
578         if($nodes) {
579           $node = $nodes[0];
580           $node_name = $node['hostname'];
581         }
582       }
583       $nodegroup_name="n/a";
584       if ($tag['nodegroup_id']) { 
585         $nodegroup=$api->GetNodeGroups(array('nodegroup_id'=>$tag['nodegroup_id']));
586         if ($nodegroup) {
587           $nodegroup = $nodegroup[0];
588           $nodegroup_name = $nodegroup['groupname'];
589         }
590       }
591       $table->row_start();
592       $table->cell(l_tag_obj($tag));
593       $table->cell($tag['value']);
594       $table->cell($node_name);
595       $table->cell($nodegroup_name);
596       if ($tags_privileges) $table->cell ($form->checkbox_html('slice_tag_ids[]',$tag['slice_tag_id']));
597       $table->row_end();
598     }
599   }
600   if ($tags_privileges) {
601     $table->tfoot_start();
602     $table->row_start();
603     $table->cell($form->submit_html ("delete-slice-tags","Remove selected"),
604                  array('hfill'=>true,'align'=>'right'));
605     $table->row_end();
606     
607     $table->row_start();
608     function tag_selector ($tag) {
609       return array("display"=>$tag['tagname'],"value"=>$tag['tag_type_id']);
610     }
611     $all_tags= $api->GetTagTypes( array ("category"=>"slice*","-SORT"=>"+tagname"), array("tagname","tag_type_id"));
612     $selector_tag=array_map("tag_selector",$all_tags);
613     
614     function node_selector($node) { 
615       return array("display"=>$node["hostname"],"value"=>$node['node_id']);
616     }
617     $all_nodes = $api->GetNodes( array ("node_id" => $slice['node_ids']), array("hostname","node_id"));
618     $selector_node=array_map("node_selector",$all_nodes);
619     
620     function nodegroup_selector($ng) {
621       return array("display"=>$ng["groupname"],"value"=>$ng['nodegroup_id']);
622     }
623     $all_nodegroups = $api->GetNodeGroups( array("groupname"=>"*"), array("groupname","nodegroup_id"));
624     $selector_nodegroup=array_map("nodegroup_selector",$all_nodegroups);
625     
626     $table->cell($form->select_html("tag_type_id",$selector_tag,array('label'=>"Choose Tag")));
627     $table->cell($form->text_html("value","",array('width'=>8)));
628     $table->cell($form->select_html("node_id",$selector_node,array('label'=>"All Nodes")));
629     $table->cell($form->select_html("nodegroup_id",$selector_nodegroup,array('label'=>"No Nodegroup")));
630     $table->cell($form->submit_html("add-slice-tag","Set Tag"),array('columns'=>2,'align'=>'left'));
631     $table->row_end();
632   }
633     
634   $table->end();
635   $form->end();
636   $toggle->end();
637 //}
638
639
640 //////////////////////// renew slice
641 if ($local_peer ) {
642   if ( ! $renew_visible) renew_area ($slice,$site,false);
643  }
644
645 $peers->block_end($peer_id);
646
647 // Print footer
648 include 'plc_footer.php';
649
650 ?>