- $tabs['Update'] = array ('url'=>"/db/nodes/node_actions.php",
- 'method'=>'POST',
- 'values'=>array('action'=>'prompt-update','node_id'=>$node_id));
- $tabs['Delete'] = array ('url'=>"/db/nodes/node_actions.php",
- 'method'=>'POST',
- 'values'=>array('action'=>'delete','node_id'=>$node_id),
- 'confirm'=>'Are you sure to delete ' . $hostname. ' ?');
- // xxx subject to roles
- $tabs["Add Interface"]=l_interface_add_u($node_id);
- $tabs["Comon"]=l_comon("node_id",$node_id);
- $tabs["Events"]=l_event("Node","node",$node_id);
+ $tabs["Add Interface"]=array('url'=>l_interface_add($node_id),
+ 'bubble'=>"Define new network interface on $hostname");
+ $tabs['Delete'] = array ('url'=>l_actions(),
+ 'method'=>'POST',
+ 'values'=>array('action'=>'delete-node','node_id'=>$node_id),
+ 'bubble'=>"Delete node $hostname",
+ 'confirm'=>'Are you sure to delete ' . $hostname);
+ $tabs["Events"]=array_merge(tablook_event(),
+ array('url'=>l_event("Node","node",$node_id),
+ 'bubble'=>"Events for node $hostname"));
+ $tabs["Comon"]=array_merge(tablook_comon(),
+ array('url'=>l_comon("node_id",$node_id),
+ 'bubble'=>"Comon page about node $hostname"));
+ }
+
+plekit_linetabs($tabs);
+
+// show gray background on foreign objects : start a <div> with proper class
+$peers->block_start ($peer_id);
+
+$toggle = new PlekitToggle ('node',"Details",
+ array('bubble'=>'Display and modify details for that node',
+ 'visible'=>get_arg('show_details',true)));
+$toggle->start();
+
+$details=new PlekitDetails($privileges);
+$details->start();
+if ( ! $local_peer) {
+ $details->th_td("Peer",$peers->peer_link($peer_id));
+ $details->space();
+ }
+
+$details->form_start(l_actions(),array("action"=>"update-node", "node_id"=>$node_id));
+// xxx can hostname really be changed like this without breaking the rest, bootcd .. ?
+//$details->th_td("Hostname",$hostname,"hostname");
+$details->th_td("Hostname",$hostname);
+$details->th_td("Model",$model,"model");
+$details->tr_submit("submit","Update Node");
+$details->form_end();
+if ($privileges) $details->space();
+
+$details->th_td("Type",$node_type);
+$details->th_td("Version",$version);
+// let's use plc_objects
+$Node = new Node($node);
+$details->th_td("Date created",$Node->dateCreated());
+$details->th_td("Last contact",$Node->lastContact());
+$details->th_td("Last update",$Node->lastUpdated());
+
+// boot area
+$details->space ();
+if ( ! ($local_peer && $privileges)) {
+ // just display it
+ $boot_value=$boot_state;
+ } else {
+ $boot_value="";
+ $boot_form = new PlekitForm (l_actions(), array("node_id"=>$node_id,
+ "action"=>"node-boot-state"));
+ $boot_value .= $boot_form->start_html();
+ $states = array( 'boot'=>'Boot', 'safeboot'=>'SafeBoot', 'failboot'=>'FailBoot',
+ 'disabled' => 'Disabled', 'install'=>'Install', 'reinstall'=>'Reinstall');
+ $selectors=array();
+ foreach ($states as $dbname=>$displayname) {
+ $selector=array("display"=>$displayname, "value"=>$dbname);
+ if ($dbname == $boot_state) $selector['selected']=true;
+ $selectors []= $selector;