diff --git a/src/sunstone/public/js/plugins/images-tab.js b/src/sunstone/public/js/plugins/images-tab.js index 8713f11fb6..8a70352d59 100644 --- a/src/sunstone/public/js/plugins/images-tab.js +++ b/src/sunstone/public/js/plugins/images-tab.js @@ -128,6 +128,20 @@ var create_image_tmpl =
Type of file system to be built. This can be any value understood by mkfs unix command.
\ \ \ +
\ +
\ + \ + \ + \ + \ + \ + \ +
\ + \ + \ +
\ +
\
\
\ \ @@ -658,6 +672,30 @@ function setupCreateImageDialog(){ }); + $('#add_custom_var_image_button', dialog).click( + function(){ + var name = $('#custom_var_image_name',$create_image_dialog).val(); + var value = $('#custom_var_image_value',$create_image_dialog).val(); + if (!name.length || !value.length) { + notifyError("Custom attribute name and value must be filled in"); + return false; + } + option= ''; + $('select#custom_var_image_box',$create_image_dialog).append(option); + return false; + } + ); + + $('#remove_custom_var_image_button', dialog).click( + function(){ + $('select#custom_var_image_box :selected',$create_image_dialog).remove(); + return false; + } + ); + + $('#create_image_form_easy',dialog).submit(function(){ var exit = false; $('.img_man',this).each(function(){ @@ -709,6 +747,15 @@ function setupCreateImageDialog(){ img_json["FSTYPE"] = fstype; break; } + + //Time to add custom attributes + $('#custom_var_image_box option',$create_image_dialog).each(function(){ + var attr_name = $(this).attr("name"); + var attr_value = $(this).val(); + img_json[attr_name] = attr_value; + }); + + var obj = { "image" : img_json }; Sunstone.runAction("Image.create", obj); diff --git a/src/sunstone/public/js/plugins/templates-tab.js b/src/sunstone/public/js/plugins/templates-tab.js index cd7db8af35..89e434ae57 100644 --- a/src/sunstone/public/js/plugins/templates-tab.js +++ b/src/sunstone/public/js/plugins/templates-tab.js @@ -535,7 +535,7 @@ var create_template_tmpl = '
\ \
Name for the custom variable
\
\ -
\ +
\ \ \
Value of the custom variable
\ @@ -1733,8 +1733,7 @@ function setupCreateTemplateDialog(){ var name = $('#custom_var_name',section_custom_var).val(); var value = $('#custom_var_value',section_custom_var).val(); if (!name.length || !value.length) { - notifyError("Custom variable name and value must be\ -filled in"); + notifyError("Custom variable name and value must be filled in"); return false; } option= '
\
\
\ +
\ +
\ + \ + \ + \ + \ + \ + \ +
\ + \ + \ +
\ +
\
\
\