mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-748: Support deployment of VM on Tier + network
This commit is contained in:
parent
d579c937bb
commit
d6ce2af209
|
|
@ -33,11 +33,10 @@
|
|||
|
||||
// Called in networks list, when VPC drop-down is changed
|
||||
// -- if vpcID given, return true if in network specified by vpcID
|
||||
// -- if vpcID == -1, return true if network is not associated with a VPC
|
||||
// -- if vpcID == -1, always show all networks
|
||||
vpcFilter: function(data, vpcID) {
|
||||
return vpcID != -1?
|
||||
data.vpcid == vpcID :
|
||||
!data.vpcid;
|
||||
return vpcID != -1 ?
|
||||
data.vpcid == vpcID : true;
|
||||
},
|
||||
|
||||
// Runs when advanced SG-enabled zone is run, before
|
||||
|
|
@ -401,7 +400,12 @@
|
|||
includingSecurityGroup = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (networkObj.vpcid) {
|
||||
networkObj._singleSelect = true;
|
||||
}
|
||||
|
||||
//for Advanced SG-enabled zone, list only SG network offerings
|
||||
if(selectedZoneObj.networktype == 'Advanced' && selectedZoneObj.securitygroupsenabled == true) {
|
||||
if(includingSecurityGroup == false)
|
||||
|
|
|
|||
|
|
@ -91,7 +91,8 @@
|
|||
options = options ? options : {};
|
||||
|
||||
$(data).each(function() {
|
||||
var id = this[fields.id];
|
||||
var item = this;
|
||||
var id = item[fields.id];
|
||||
|
||||
var $select = $('<div>')
|
||||
.addClass('select')
|
||||
|
|
@ -107,17 +108,22 @@
|
|||
.val(id)
|
||||
.click(function() {
|
||||
var $select = $(this).closest('.select');
|
||||
var isSingleSelect = $select.hasClass('single-select');
|
||||
var $radio = $select.find('input[type=radio]');
|
||||
var $newNetwork = $(this).closest('.content').find('.select.new-network');
|
||||
var $otherSelects = $select.siblings().filter(':visible');
|
||||
var isCheckbox = $(this).attr('type') == 'checkbox';
|
||||
var isSingleSelect = $(this).closest('.select-container').hasClass('single-select');
|
||||
|
||||
if (isCheckbox) {
|
||||
if ((isSingleSelect || !$otherSelects.size()) &&
|
||||
$newNetwork.find('input[type=checkbox]').is(':unchecked')) {
|
||||
$otherSelects.find('input[type=checkbox]').attr('checked', false);
|
||||
if (isSingleSelect) {
|
||||
$select.siblings('.single-select:visible').find('input[type=checkbox]')
|
||||
.attr('checked', false);
|
||||
|
||||
$(this).closest('.select').find('input[type=radio]').click();
|
||||
}
|
||||
|
||||
if ((!$otherSelects.size()) &&
|
||||
$newNetwork.find('input[type=checkbox]').is(':unchecked')) {
|
||||
// Set as default
|
||||
$(this).closest('.select').find('input[type=radio]').click();
|
||||
}
|
||||
|
|
@ -144,6 +150,10 @@
|
|||
|
||||
$selects.append($select);
|
||||
|
||||
if (item._singleSelect) {
|
||||
$select.addClass('single-select');
|
||||
}
|
||||
|
||||
if (options.secondary) {
|
||||
var $secondary = $('<div>').addClass('secondary-input').append(
|
||||
$('<input>')
|
||||
|
|
@ -164,6 +174,11 @@
|
|||
$(this).closest('.select').siblings().find('input[type=checkbox]')
|
||||
.attr('checked', false);
|
||||
}
|
||||
|
||||
if ($select.hasClass('single-select')) {
|
||||
$select.siblings('.single-select:visible').find('input[type=checkbox]')
|
||||
.attr('checked', false);
|
||||
}
|
||||
})
|
||||
.after(
|
||||
$('<div>').addClass('name').html(options.secondary.desc)
|
||||
|
|
@ -614,7 +629,7 @@
|
|||
});
|
||||
|
||||
// 'No VPC' option
|
||||
$('<option>').attr('value', '-1').html('None').prependTo($vpcSelect);
|
||||
$('<option>').attr('value', '-1').html(_l('ui.listView.filters.all')).prependTo($vpcSelect);
|
||||
|
||||
$vpcSelect.val(-1);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue