diff --git a/src/sunstone/public/js/plugins/images-tab.js b/src/sunstone/public/js/plugins/images-tab.js index 1c4b0e9516..a7d718dfb8 100644 --- a/src/sunstone/public/js/plugins/images-tab.js +++ b/src/sunstone/public/js/plugins/images-tab.js @@ -64,7 +64,7 @@ var create_image_tmpl =
'+tr("Human readable description of the image for other users.")+'
\ \
\ - \ + \ \
'+tr("Select the datastore for this image")+'
\ @@ -175,8 +175,10 @@ var create_image_tmpl =
\
\

'+tr("Write the image template here")+'

\ - \ + \ + \ + \
\
\
\ @@ -935,7 +937,20 @@ function setupCreateImageDialog(){ $('#create_image_form_manual',dialog).submit(function(){ var template=$('#template',this).val(); - Sunstone.runAction("Image.create",template); + var ds_id = $('#img_datastore_raw',this).val(); + + if (!ds_id){ + notifyError(tr("Please select a datastore for this image")); + return false; + }; + + var img_obj = { + "image" : { + "image_raw" : template + }, + "ds_id" : ds_id, + }; + Sunstone.runAction("Image.create",img_obj); $create_image_dialog.dialog('close'); return false; }); @@ -946,6 +961,7 @@ function popUpCreateImageDialog(){ $('#file-uploader input',$create_image_dialog).attr('style','margin:0;width:256px!important'); $('#img_datastore',$create_image_dialog).html(datastores_sel()); + $('#img_datastore_raw',$create_image_dialog).html(datastores_sel()); $create_image_dialog.dialog('open'); }