You have successfully added your first Zone and Pod. After clicking 'OK', this UI will automatically refresh to give you access to the rest of cloud features.
") .dialog('option', 'buttons', { "OK": function() { $(this).dialog("close"); window.location.reload(); } }).dialog("open"); } }, error: function(XMLHttpResponse) { handleError(XMLHttpResponse, function() { handleErrorInDialog(XMLHttpResponse, $thisDialog); }); } }); }, "Cancel": function() { $(this).dialog("close"); } }).dialog("open"); return false; }); } function secondaryStorageJSONToTemplate(json, template) { template.data("jsonObj", json); template.attr("id", "secondaryStorage_"+json.id).data("secondaryStorageId", json.id); template.find("#id").text(json.id); template.find("#title").text(fromdb(json.name)); template.find("#name").text(fromdb(json.name)); template.find("#zonename").text(fromdb(json.zonename)); template.find("#type").text(json.type); template.find("#ipaddress").text(json.ipaddress); setHostStateInRightPanel(fromdb(json.state), template.find("#state")) template.find("#version").text(json.version); setDateField(json.disconnected, template.find("#disconnected")); var $actionLink = template.find("#secondarystorage_action_link"); $actionLink.bind("mouseover", function(event) { $(this).find("#secondarystorage_action_menu").show(); return false; }); $actionLink.bind("mouseout", function(event) { $(this).find("#secondarystorage_action_menu").hide(); return false; }); var $actionMenu = $actionLink.find("#secondarystorage_action_menu"); $actionMenu.find("#action_list").empty(); buildActionLinkForSubgridItem("Delete Secondary Storage", secondarystorageActionMap, $actionMenu, template); } function bindEventHandlerToDialogAddVlanForZone() { //direct VLAN shows only "tagged" option while public VLAN shows both "tagged" and "untagged" option. var dialogAddVlanForZone = $("#dialog_add_vlan_for_zone"); dialogAddVlanForZone.find("#add_publicip_vlan_type").change(function(event) { var addPublicipVlanTagged = dialogAddVlanForZone.find("#add_publicip_vlan_tagged").empty(); // default value of "#add_publicip_vlan_scope" is "zone-wide". Calling change() will hide "#add_publicip_vlan_domain_container", "#add_publicip_vlan_account_container". dialogAddVlanForZone.find("#add_publicip_vlan_scope").change(); if ($(this).val() == "false") { //direct VLAN (only tagged option) addPublicipVlanTagged.append(''); dialogAddVlanForZone.find("#add_publicip_vlan_vlan_container").show(); dialogAddVlanForZone.find("#add_publicip_vlan_pod_container").hide(); } else { //public VLAN addPublicipVlanTagged.append('').append(''); if (dialogAddVlanForZone.find("#add_publicip_vlan_tagged") == "tagged") { dialogAddVlanForZone.find("#add_publicip_vlan_vlan_container").show(); dialogAddVlanForZone.find("#add_publicip_vlan_pod_container").hide(); } else { dialogAddVlanForZone.find("#add_publicip_vlan_vlan_container").hide(); dialogAddVlanForZone.find("#add_publicip_vlan_pod_container").hide(); } } return false; }); if (getNetworkType() != "vnet") { dialogAddVlanForZone.find("#add_publicip_vlan_tagged").change(function(event) { // default value of "#add_publicip_vlan_scope" is "zone-wide". Calling change() will hide "#add_publicip_vlan_domain_container", "#add_publicip_vlan_account_container". dialogAddVlanForZone.find("#add_publicip_vlan_scope").change(); if (dialogAddVlanForZone.find("#add_publicip_vlan_type").val() == "false") { //direct VLAN (only tagged option) dialogAddVlanForZone.find("#add_publicip_vlan_vlan_container").show(); dialogAddVlanForZone.find("#add_publicip_vlan_pod_container").hide(); } else { //public VLAN if ($(this).val() == "tagged") { dialogAddVlanForZone.find("#add_publicip_vlan_vlan_container").show(); dialogAddVlanForZone.find("#add_publicip_vlan_pod_container").hide(); } else { dialogAddVlanForZone.find("#add_publicip_vlan_vlan_container").hide(); dialogAddVlanForZone.find("#add_publicip_vlan_pod_container").hide(); } } return false; }); } else { dialogAddVlanForZone.find("#add_publicip_vlan_container").hide(); } dialogAddVlanForZone.find("#add_publicip_vlan_scope").change(function(event) { if($(this).val() == "zone-wide") { dialogAddVlanForZone.find("#add_publicip_vlan_domain_container").hide(); dialogAddVlanForZone.find("#add_publicip_vlan_account_container").hide(); } else { // account-specific dialogAddVlanForZone.find("#add_publicip_vlan_domain_container").show(); dialogAddVlanForZone.find("#add_publicip_vlan_account_container").show(); } return false; }); } var secondarystorageActionMap = { "Delete Secondary Storage": { isAsyncJob: false, dialogBeforeActionFn: doDeleteSecondaryStorage, inProcessText: "Deleting Secondary Storaget....", afterActionSeccessFn: function(json, id, $subgridItem) { $subgridItem.slideUp("slow", function() { $(this).remove(); }); } } } function doDeleteSecondaryStorage($actionLink, $subgridItem) { var jsonObj = $subgridItem.data("jsonObj"); $("#dialog_confirmation_delete_secondarystorage") .dialog('option', 'buttons', { "Confirm": function() { var $thisDialog = $(this); $thisDialog.dialog("close"); var name = $thisDialog.find("#name").val(); var id = jsonObj.id; var apiCommand = "command=deleteHost&id="+id; doActionToSubgridItem(id, $actionLink, apiCommand, $subgridItem); }, "Cancel": function() { $(this).dialog("close"); } }).dialog("open"); } var zoneActionMap = { "Edit Zone": { dialogBeforeActionFn: doEditZone }, "Delete Zone": { api: "deleteZone", isAsyncJob: false, inProcessText: "Deleting Zone....", afterActionSeccessFn: function(json, $midmenuItem1, id) { $midmenuItem1.slideUp(function() { $(this).remove(); }); clearRightPanel(); zoneJsonClearRightPanel(); } } } function doEditZone($actionLink, $detailsTab, $midmenuItem1) { var $readonlyFields = $detailsTab.find("#name, #dns1, #dns2, #internaldns1, #internaldns2, #vlan, #guestcidraddress"); var $editFields = $detailsTab.find("#name_edit, #dns1_edit, #dns2_edit, #internaldns1_edit, #internaldns2_edit, #startvlan_edit, #endvlan_edit, #guestcidraddress_edit"); $readonlyFields.hide(); $editFields.show(); $detailsTab.find("#cancel_button, #save_button").show(); $detailsTab.find("#cancel_button").unbind("click").bind("click", function(event){ $editFields.hide(); $readonlyFields.show(); $("#save_button, #cancel_button").hide(); return false; }); $detailsTab.find("#save_button").unbind("click").bind("click", function(event){ doEditZone2($actionLink, $detailsTab, $midmenuItem1, $readonlyFields, $editFields); return false; }); } function doEditZone2($actionLink, $detailsTab, $midmenuItem1, $readonlyFields, $editFields) { // validate values var isValid = true; isValid &= validateString("Name", $detailsTab.find("#name_edit"), $detailsTab.find("#name_edit_errormsg")); isValid &= validateIp("DNS 1", $detailsTab.find("#dns1_edit"), $detailsTab.find("#dns1_edit_errormsg"), false); //required isValid &= validateIp("DNS 2", $detailsTab.find("#dns2_edit"), $detailsTab.find("#dns2_edit_errormsg"), true); //optional isValid &= validateIp("Internal DNS 1", $detailsTab.find("#internaldns1_edit"), $detailsTab.find("#internaldns1_edit_errormsg"), false); //required isValid &= validateIp("Internal DNS 2", $detailsTab.find("#internaldns2_edit"), $detailsTab.find("#internaldns2_edit_errormsg"), true); //optional if ($("#tab_content_details #vlan_container").css("display") != "none") { isValid &= validateString("Start VLAN Range", $detailsTab.find("#startvlan_edit"), $detailsTab.find("#startvlan_edit_errormsg"), true); //optional (Bug 5730 requested to change VLAN to be optional when updating zone) isValid &= validateString("End VLAN Range", $detailsTab.find("#endvlan_edit"), $detailsTab.find("#endvlan_edit_errormsg"), true); //optional } isValid &= validateCIDR("Guest CIDR", $detailsTab.find("#guestcidraddress_edit"), $detailsTab.find("#guestcidraddress_edit_errormsg"), false); //required if (!isValid) return; var moreCriteria = []; var jsonObj = $detailsTab.data("jsonObj"); var oldDns1 = jsonObj.dns1; var oldDns2 = jsonObj.dns2; var id = jsonObj.id; moreCriteria.push("&id="+id); var name = trim($detailsTab.find("#name_edit").val()); moreCriteria.push("&name="+todb(name)); var dns1 = trim($detailsTab.find("#dns1_edit").val()); moreCriteria.push("&dns1="+encodeURIComponent(dns1)); var dns2 = trim($detailsTab.find("#dns2_edit").val()); if (dns2 != null & dns2.length > 0) moreCriteria.push("&dns2="+encodeURIComponent(dns2)); var internaldns1 = trim($detailsTab.find("#internaldns1_edit").val()); moreCriteria.push("&internaldns1="+encodeURIComponent(internaldns1)); var internaldns2 = trim($detailsTab.find("#internaldns2_edit").val()); if (internaldns2 != null & internaldns2.length > 0) moreCriteria.push("&internaldns2="+encodeURIComponent(internaldns2)); var vlan; if ($("#tab_content_details #vlan_container").css("display") != "none") { var vlanStart = trim($detailsTab.find("#startvlan_edit").val()); if(vlanStart != null && vlanStart.length > 0) { var vlanEnd = trim($detailsTab.find("#endvlan_edit").val()); if (vlanEnd != null && vlanEnd.length > 0) vlan = vlanStart + "-" + vlanEnd; else vlan = vlanStart; moreCriteria.push("&vlan=" + encodeURIComponent(vlan)); } } var guestcidraddress = trim($detailsTab.find("#guestcidraddress_edit").val()); moreCriteria.push("&guestcidraddress="+encodeURIComponent(guestcidraddress)); $.ajax({ data: createURL("command=updateZone"+moreCriteria.join("")), dataType: "json", success: function(json) { var item = json.updatezoneresponse.zone; $midmenuItem1.data("jsonObj", item); zoneJsonToRightPanel($midmenuItem1); $editFields.hide(); $readonlyFields.show(); $("#save_button, #cancel_button").hide(); if(item.dns1 != oldDns1 || item.dns2 != oldDns2) { $("#dialog_info") .text("DNS update will not take effect until all virtual routers are stopped and then started") .dialog("open"); } } }); }