X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=planetlab%2Fnodes%2Fnode_downloads.php;fp=planetlab%2Fnodes%2Fnode_actions.php;h=6baadb0ffdc9014bd2c26cb80cde3e04f13a8926;hb=350bb4d9c096b0cfb877fb67ab94ebac753a98a5;hp=6de70c96cddb8b7979fc42e82e958823d354c08c;hpb=bc69546bd6a533ce02ec4e8efb8abeeb459c584c;p=plewww.git diff --git a/planetlab/nodes/node_actions.php b/planetlab/nodes/node_downloads.php similarity index 72% rename from planetlab/nodes/node_actions.php rename to planetlab/nodes/node_downloads.php index 6de70c9..6baadb0 100644 --- a/planetlab/nodes/node_actions.php +++ b/planetlab/nodes/node_downloads.php @@ -1,34 +1,9 @@ actual UpdateNode - // (POST) node_id=node_id ng_add=nodegroup_id - // AddNodeToNodeGroup - // (POST) boot_state=boot_state node_id=node_id - // (POST) ng_add=nodegroup_id - // (*) downloadconf.php - // (GET) id=node_id [download=1] - // either showed current status, or performed actual config download - - // in this new version we support only POST behaviour with the following interface + + // cleaned up, keep only the actions related to downloading stuff // REQUIRED : node_id=node_id - // (*) action='prompt-update' : former node_update.php - // (*) action='update' - // hostname= - // model= : actually updated the node - // (*) action='boot-state' - // boot_state= : changes bootstate - // (*) action='delete' : deletes node // (*) action='download-node-floppy' : // (*) action='download-node-iso' : // (*) action='download-node-usb' : @@ -38,12 +13,6 @@ // (*) action='download-generic-iso': // (*) action='download-generic-usb': // : performs actual generic download - // (*) action='add-in-nodegroup': should include this for compatibility, replaces ng_add, - // though I could not figure where it's called - - - // TODO : manage a post field for displaying results of previous page - // see the special 'flash' in rails // delivering node-dependant images requires larger memory limit // trial and error, based on the current sizes @@ -115,7 +84,7 @@ function show_download_confirm_button ($api, $node_id, $action, $can_gen_config, 'download-node-usb' => 'USB image' ); $format = $action_labels [ $action ] ; - print( "

\n"); + print( "

\n"); print ("\n"); print ("\n"); print ("\n"); @@ -138,78 +107,6 @@ $action=$_POST['action']; switch ($action) { - // ACTION: prompt-update - // from former node_update.php - case "prompt-update": - - require_once('plc_drupal.php'); - $node_info= $api->GetNodes( array( $node_id ), array( "hostname", "model" ) ); - drupal_set_title("Updating " . $node_info[0]['hostname']); - include 'plc_header.php'; - - // start form - echo "\n"; - echo "\n"; - echo "\n"; - if( $_POST['error'] ) plc_error(unserialize( $_POST['error'])); - echo "

\n - \n - \n -
Hostname:
Model:
\n -

\n -

\n"; - - echo "

Back to Node\n"; - - break; - - // ACTION: update - // from former node_actions.php - case "update": - - $hostname= $_POST['hostname']; - $model= $_POST['model']; - - $fields= array( "hostname"=>$hostname, "model"=>$model ); - $api->UpdateNode( intval( $node_id ), $fields ); - $error= $api->error(); - - if( empty( $error ) ) { - plc_redirect(l_node($node_id)); - } else { - echo "". $error . "\n" ; - echo "

Press back to retry

"; - } - - break; - - // ACTION: delete - // from former node_actions.php - case "delete": - $api->DeleteNode( intval( $node_id ) ); - plc_redirect(l_nodes()); - break; - - // ACTION: boot-state - // from former node_actions.php - case "boot-state": - switch( $_POST['boot_state'] ) { - case 'boot': - case 'dbg': - case 'inst': - case 'rins': - case 'rcnf': - case 'new': - $api->UpdateNode( intval( $node_id ), array( "boot_state" => $_POST['boot_state'] ) ); - plc_redirect (l_node($node_id)); - break; - default: - print "
no such boot state " . $_POST['boot_state'] . "
"; - break; - } - break; - - // ACTION: download-generic case "download-generic-iso": case "download-generic-usb": @@ -415,7 +312,7 @@ if( $has_primary ) { break; default: - echo "Unkown action <$action>."; + drupal-set_error("Unkown action $action in node_downloads.php"); plc_redirect (l_node($node_id)); break; }