make 'mac' field on an interface editable.
[plewww.git] / planetlab / nodes / interface.php
index 248ca4f..5a8af9b 100644 (file)
@@ -48,7 +48,8 @@ if ( ! $node_id) {
  }
 
 $tabs=array();
-$tabs[] = array('label'=>'Back to node', 'url'=>l_node($node_id),
+$tabs[] = array('label'=>'Back to node', 'url'=>l_node($node_id), 
+               'values' => array('show_details'=>False,'show_interfaces'=>True),
                'bubble'=>'Cancel pending changes');
 plekit_linetabs($tabs);
 
@@ -70,6 +71,11 @@ drupal_set_html_head ('
 <script type="text/javascript" src="/planetlab/nodes/interface.js"></script>
 ');
 
+$toggle = new PlekitToggle ('interface',"Details",
+                           array('bubble'=>'Display and modify details for that interface',
+                                 'visible'=>get_arg('show_details',true)));
+$toggle->start();
+
 $details=new PlekitDetails($can_update);
 
 // xxx hardwire network type for now
@@ -105,9 +111,11 @@ $details->th_td("DNS 2",$interface['dns2'],"dns2",array('width'=>15,
 $details->space();
 $details->th_td("BW limit (bps)",$interface['bwlimit'],"bwlimit",array('width'=>11));
 $details->th_td("Hostname",$interface['hostname'],"hostname");
+$details->th_td("Mac address",$interface['mac'],"mac", array('onChange'=>'macChecker("mac", true)'));
+
 # xxx should the user be allowed to change this ?
-$mac=$interface['mac'];
-if ($mac) $details->th_td("MAC address",$mac);
+//$mac=$interface['mac'];
+//if ($mac) $details->th_td("MAC address",$mac);
 
 // the buttons
 $update_button = $form->submit_html ("update-interface","Update",
@@ -125,6 +133,7 @@ switch ($mode) {
 
 $details->end();
 $form->end();
+$toggle->end();
 
 // no tags if the interface has not been created yet
 if ($mode == 'add') return;