bug 12614: Zone wizard update

-Add support to filter network offerings based on whether security
 groups is checked; options then come from a separate
 'securityGroupNetworkOfferings' object:

args.response.success({
  domains: domainObjs,

  // Non-security-group-enabled offerings
  networkOfferings: networkOfferingObjs,

  // Security group-enabled offerings
  securityGroupNetworkOfferings: []
});

-Remove old/unused fields from wizard
This commit is contained in:
bfederle 2011-12-19 11:35:26 -08:00
parent e816b3a80b
commit 07ed925ab1
4 changed files with 65 additions and 43 deletions

View File

@ -1,5 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CloudStack</title>
@ -433,22 +433,6 @@
<div class="desc">Choose this network model if you wish to enable VLAN support. This network model provides the most flexibility in allowing administrators to provide custom network offerings such as providing firewall, vpn, or load balancer support as well as enabling direct vs virtual networking.</div>
<input type="radio" name="network-model" value="Advanced" />
<label>Advanced</label>
<div class="isolation-mode">
<h3>Isolation mode</h3>
<div class="select-area">
<input type="radio" name="isolation-mode" value="vlan"
checked="checked" disabled="disabled" />
<label>VLAN</label>
<div class="desc">Choose this if you wish to use zone-wide VLANs to provide guest VM isolation.</div>
</div>
<div class="select-area">
<input type="radio" name="isolation-mode" value="security-groups"
disabled="disabled" />
<label>Security Groups</label>
<div class="desc">Choose this if you wish to use security groups to provide guest VM isolation.</div>
</div>
</div>
</div>
</div>
</div>
@ -544,13 +528,22 @@
</div>
<div class="conditional basic">
<!-- Enable security groups -->
<div class="field">
<div class="name">
<span>Enable security groups</span>
</div>
<div class="value">
<input type="checkbox" name="security-groups-enabled" />
</div>
</div>
<!-- Network Offering -->
<div class="field">
<div class="name">
<span>Network Offering</span>
</div>
<div class="value">
<select name="zone-network-offering" class="network-offering required"></select>
<select name="networkOfferingId" class="network-offering required"></select>
</div>
</div>
</div>
@ -571,7 +564,7 @@
<span>Name</span>
</div>
<div class="value">
<input type="text" name="pod-name" class="required" />
<input type="text" name="podName" class="required" />
</div>
</div>
@ -581,7 +574,7 @@
<span>Gateway</span>
</div>
<div class="value">
<input type="text" name="pod-gateway" class="required" />
<input type="text" name="podGateway" class="required" />
</div>
</div>
@ -591,7 +584,7 @@
<span>Netmask</span>
</div>
<div class="value">
<input type="text" name="pod-netmask" class="required" />
<input type="text" name="podNetmask" class="required" />
</div>
</div>
@ -601,9 +594,9 @@
<span>Reserved IP</span>
</div>
<div class="value multi-range">
<input type="text" name="pod-ip-range-start" class="required" />
<input type="text" name="podStartIp" class="required" />
<span class="divider">-</span>
<input type="text" name="pod-ip-range-end" />
<input type="text" name="podEndIp" />
</div>
</div>
</div>

View File

@ -433,22 +433,6 @@
<div class="desc">Choose this network model if you wish to enable VLAN support. This network model provides the most flexibility in allowing administrators to provide custom network offerings such as providing firewall, vpn, or load balancer support as well as enabling direct vs virtual networking.</div>
<input type="radio" name="network-model" value="Advanced" />
<label>Advanced</label>
<div class="isolation-mode">
<h3>Isolation mode</h3>
<div class="select-area">
<input type="radio" name="isolation-mode" value="vlan"
checked="checked" disabled="disabled" />
<label>VLAN</label>
<div class="desc">Choose this if you wish to use zone-wide VLANs to provide guest VM isolation.</div>
</div>
<div class="select-area">
<input type="radio" name="isolation-mode" value="security-groups"
disabled="disabled" />
<label>Security Groups</label>
<div class="desc">Choose this if you wish to use security groups to provide guest VM isolation.</div>
</div>
</div>
</div>
</div>
</div>
@ -544,6 +528,15 @@
</div>
<div class="conditional basic">
<!-- Enable security groups -->
<div class="field">
<div class="name">
<span>Enable security groups</span>
</div>
<div class="value">
<input type="checkbox" name="security-groups-enabled" />
</div>
</div>
<!-- Network Offering -->
<div class="field">
<div class="name">

View File

@ -2852,7 +2852,15 @@
}
});
args.response.success({domains: domainObjs, networkOfferings: networkOfferingObjs});
args.response.success({
domains: domainObjs,
// Non-security-group-enabled offerings
networkOfferings: networkOfferingObjs,
// Security group-enabled offerings
securityGroupNetworkOfferings: []
});
},
// Step 3: Setup Pod

View File

@ -110,8 +110,9 @@
return $(this).index() <= targetIndex;
}).toggleClass('active');
// Load data provider for domain dropdowns
if (!$targetStep.hasClass('loaded') && (index == 2 || index == 4)) {
var loadData = function(options) {
if (!options) options = {};
args.steps[targetIndex]({
response: {
success: function(args) {
@ -121,14 +122,41 @@
});
$(args.networkOfferings).each(function() {
$('<option></option>').val(this.id).html(this.name)
$('<option></option>')
.val(this.id)
.html(this.name)
.appendTo($targetStep.find('select.network-offering'));
});
$targetStep.addClass('loaded');
// Security groups checkbox filters offering drop-down
var $securityGroupsEnabled = $wizard.find(
'input[name=security-groups-enabled]'
);
$securityGroupsEnabled.data('target-index', targetIndex);
$securityGroupsEnabled.change(function() {
var $check = $(this);
var $select = $targetStep.find('select.network-offering');
var objs = $check.is(':checked') ?
args.securityGroupNetworkOfferings : args.networkOfferings;
$select.children().remove();
$(objs).each(function() {
$('<option></option>')
.val(this.id)
.html(this.name)
.appendTo($select);
});
});
}
}
});
};
// Load data provider for domain dropdowns
if (!$targetStep.hasClass('loaded') && (index == 2 || index == 4)) {
loadData();
}
setTimeout(function() {