From: Stephen Soltesz Date: Wed, 13 Apr 2011 21:43:26 +0000 (-0400) Subject: Add Test PCU button, to work with Reboot Node button X-Git-Tag: plewww-4.3-64~9^2~1 X-Git-Url: http://git.onelab.eu/?p=plewww.git;a=commitdiff_plain;h=f831adeb944ad788c6091d561917a154112583eb Add Test PCU button, to work with Reboot Node button Add link to PCU edit on site list page --- diff --git a/planetlab/includes/plc_functions.php b/planetlab/includes/plc_functions.php index a51bf59..a05fdd9 100644 --- a/planetlab/includes/plc_functions.php +++ b/planetlab/includes/plc_functions.php @@ -75,6 +75,7 @@ function l_actions_download () { return "/db/nodes/node_downloads.php"; } function l_register_node () { return "/registerwizard/index.php"; } function l_pcu_add () { return "/registerwizard/index.php/register/stage1_addpcu"; } function l_pcu ($pcu_id) { return "/db/sites/pcu.php?id=$pcu_id"; } +function l_pcu_href ($pcu_id, $text) { return href(l_pcu($pcu_id), $text); } function l_nodes () { return "/db/nodes/index.php"; } function l_nodes_peer ($peer_id) { return "/db/nodes/index.php?peerscope=$peer_id"; } diff --git a/planetlab/nodes/node.php b/planetlab/nodes/node.php index cfce37e..f976f50 100644 --- a/planetlab/nodes/node.php +++ b/planetlab/nodes/node.php @@ -261,9 +261,19 @@ I've experienced a problem rebooting $hostname with the pcu_id $pcu_id; $url=rawurlencode($body); $email = ">Report a problem"; - $details->form_start(l_actions(),array("action"=>"reboot-node-with-pcu", "node_id"=>$node_id, "hostname"=>$hostname)); - print $details->tr_html($email . $details->form->submit_html("submit","Reboot Node"), "right"); - $details->form_end(); + // NOTE: not sure how to make the buttons display side-by-side... + $reboot = $details->form_start_html(l_actions(),array("action"=>"reboot-node-with-pcu", + "node_id"=>$node_id, "hostname"=>$hostname, "test"=>FALSE)); + $reboot .= $email . $details->form->submit_html("submit","Reboot Node"); + $reboot .= $details->form_end_html(); + + $reboot .= $details->form_start_html(l_actions(),array("action"=>"reboot-node-with-pcu", + "node_id"=>$node_id, "hostname"=>$hostname, "test"=>TRUE)); + $reboot .= $details->form->submit_html("submit","Test PCU"); + $reboot .= $details->form_end_html(); + + $details->tr($reboot, "right"); + } $details->space(); diff --git a/planetlab/sites/site.php b/planetlab/sites/site.php index d80dc5f..760cb0e 100644 --- a/planetlab/sites/site.php +++ b/planetlab/sites/site.php @@ -264,7 +264,7 @@ if ( $local_peer ) { if (empty($ports)) return plc_error_html('???'); $port=$ports[0]; $pcu=$pcu_hash[$pcu_id]; - $display= $pcu['hostname'] . ' : ' . $port; + $display= l_pcu_href($pcu_id, $pcu['hostname'] . ' : ' . $port); $pcu_hash[$pcu_id]['displayed']=true; return $display; }