diff --git a/ui/new/jsp/iso.jsp b/ui/new/jsp/iso.jsp index b7d6ab38876..f6fcd0d4b48 100644 --- a/ui/new/jsp/iso.jsp +++ b/ui/new/jsp/iso.jsp @@ -154,6 +154,59 @@ + +
Please enter the following data to create your new ISO
+Copy ISO XXX from zone XXX to
diff --git a/ui/new/scripts/cloud.core2.iso.js b/ui/new/scripts/cloud.core2.iso.js index 58686de9e63..26c9dbbee02 100644 --- a/ui/new/scripts/cloud.core2.iso.js +++ b/ui/new/scripts/cloud.core2.iso.js @@ -4,6 +4,65 @@ var g_zoneNames = []; function afterLoadIsoJSP() { var $detailsTab = $("#right_panel_content #tab_content_details"); + //add button *** + $("#midmenu_add_link").show(); + + $("#midmenu_add_link").bind("click", function(event) { + $("#dialog_add_iso") + .dialog('option', 'buttons', { + "Create": function() { + var thisDialog = $(this); + thisDialog.dialog("close"); + + // validate values + var isValid = true; + isValid &= validateString("Name", thisDialog.find("#add_iso_name"), thisDialog.find("#add_iso_name_errormsg")); + isValid &= validateString("Display Text", thisDialog.find("#add_iso_display_text"), thisDialog.find("#add_iso_display_text_errormsg")); + isValid &= validateString("URL", thisDialog.find("#add_iso_url"), thisDialog.find("#add_iso_url_errormsg")); + if (!isValid) + return; + + var name = trim(thisDialog.find("#add_iso_name").val()); + var desc = trim(thisDialog.find("#add_iso_display_text").val()); + var url = trim(thisDialog.find("#add_iso_url").val()); + var zoneId = thisDialog.find("#add_iso_zone").val(); + //var isPublic = thisDialog.find("#add_iso_public").val(); + var isPublic = "false"; //default to private for now + var osType = thisDialog.find("#add_iso_os_type").val(); + var bootable = thisDialog.find("#add_iso_bootable").val(); + + var $midmenuItem1 = beforeAddingMidMenuItem() ; + + $.ajax({ + data: createURL("command=registerIso&name="+encodeURIComponent(name)+"&displayText="+encodeURIComponent(desc)+"&url="+encodeURIComponent(url)+"&zoneId="+zoneId+"&isPublic="+isPublic+"&osTypeId="+osType+"&bootable="+bootable+"&response=json"), + dataType: "json", + success: function(json) { + var result = json.registerisoresponse; + isoToMidmenu(result.iso[0], $midmenuItem1); + bindClickToMidMenu($midmenuItem1, isoToRigntPanel); + + /* + if(result.iso.length > 1) { + for(var i=1; i