bug 8265: Added support to not allow vmware templates to use security groups in the VM wizard.

This commit is contained in:
will 2011-01-28 15:27:54 -08:00
parent a857c70fa6
commit b328c26834
3 changed files with 16 additions and 7 deletions

View File

@ -304,6 +304,8 @@ label.network.domain=Network Domain
label.nfs.storage=NFS Storage
label.secondary.storage=Secondary Storage
label.security.group=Security Group
label.security.groups=Security Groups
label.no.security.groups=No Available Security Groups
label.ingress.rule=Ingress Rule
label.add.security.group=Add Security Group
label.add.ingress.rule=Add Ingress Rule
@ -702,6 +704,7 @@ message.snapshot.schedule=Your snapshot schedule is currently set to
message.add.volume=Please fill in the following data to add a new volume.
message.attach.volume=Please fill in the following data to attach a new volume. If you are attaching a disk volume to a Windows based virtual machine, you will need to reboot the instance to see the attached disk.
message.add.pod=Add a new pod for zone <b><span id="add_pod_zone_name"></span></b>
message.no.network.support=Your selected hypervisor, vSphere, does not have any additional network features. Please continue to step 5.
#Errors

View File

@ -679,7 +679,7 @@ dictionary = {
</div>
<div id="for_basic_zone" style="display:none">
<h3><fmt:message key="label.security.groups"/></h3>
<span id="not_available_message" style="display:none">security group is currently not available</span>
<span id="not_available_message" style="display:none"><fmt:message key="label.no.security.groups"/></span>
<ol id="security_group_section" style="display:none">
<li>
<select id="security_group_dropdown" class="multiple" multiple="multiple" size="15">
@ -690,6 +690,9 @@ dictionary = {
</li>
</ol>
</div>
<div id="for_no_network_support" style="display:none">
<span id="not_available_message"><fmt:message key="message.no.network.support"/></span>
</div>
</div>
</div>
<div class="vmpopup_navigationpanel">

View File

@ -649,7 +649,8 @@ function initVMWizard() {
$template.attr("id", ("vmWizardTemplate_"+jsonObj.id));
$template.data("templateId", jsonObj.id);
$template.data("templateType", templateType);
$template.data("templateName", fromdb(jsonObj.displaytext));
$template.data("templateName", fromdb(jsonObj.displaytext));
$template.data("hypervisor", jsonObj.hypervisor);
$template.find("#icon").removeClass().addClass(getIconForOS(jsonObj.ostypename));
$template.find("#name").text(fromdb(jsonObj.displaytext));
@ -858,6 +859,7 @@ function initVMWizard() {
if (zoneObj.networktype == "Advanced") {
$thisPopup.find("#step4").find("#for_advanced_zone").show();
$thisPopup.find("#step4").find("#for_basic_zone").hide();
$thisPopup.find("#step4").find("#for_no_network_support").hide();
var networkName = "Virtual Network";
var networkDesc = "A dedicated virtualized network for your account. The broadcast domain is contained within a VLAN and all public network access is routed out by a virtual router.";
@ -1013,17 +1015,18 @@ function initVMWizard() {
});
}
else { // Basic Network
$thisPopup.find("#step4").find("#for_basic_zone").show();
$thisPopup.find("#step4").find("#for_advanced_zone").hide();
if(getDirectAttachSecurityGroupsEnabled() == "true" && $selectedVmWizardTemplate.data("hypervisor") != "VmWare" ) {
if(getDirectAttachSecurityGroupsEnabled() == "true" && $selectedVmWizardTemplate.data("hypervisor") != "VMware" ) {
$thisPopup.find("#step4").find("#for_basic_zone").show();
$thisPopup.find("#step4").find("#for_no_network_support").hide();
$thisPopup.find("#step4").find("#security_group_section").show();
$thisPopup.find("#step4").find("#not_available_message").hide();
$thisPopup.find("#step5").find("#wizard_review_network").text("Basic Network");
}
else {
$thisPopup.find("#step4").find("#not_available_message").show();
$thisPopup.find("#step4").find("#security_group_section").hide();
$thisPopup.find("#step5").find("#wizard_review_network").text("");
$thisPopup.find("#step4").find("#for_basic_zone").hide();
$thisPopup.find("#step4").find("#for_no_network_support").show();
$thisPopup.find("#step5").find("#wizard_review_network").text("Basic Network");
}
}
}