mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
CLOUDSTACK-3130: UI > VPC section - Enable Static NAT - Select VM for static NAT- show no VMs when no tier is selected.
This commit is contained in:
parent
fc93b68738
commit
774141a9dc
@ -2155,11 +2155,15 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if('vpc' in args.context) {
|
||||
if($tierSelect.size() && $tierSelect.val() != '-1' ){
|
||||
data.networkid = $tierSelect.val();
|
||||
}
|
||||
// if no tier is selected
|
||||
if($tierSelect.val() == '-1'){
|
||||
args.response.success({ data: null });
|
||||
return;
|
||||
}
|
||||
|
||||
if('vpc' in args.context) {
|
||||
$.extend(data, {
|
||||
networkid: $tierSelect.val(),
|
||||
vpcid: args.context.vpc[0].id
|
||||
});
|
||||
}
|
||||
|
||||
@ -471,73 +471,7 @@
|
||||
detailView: {
|
||||
isMaximized: true,
|
||||
name: 'Internal LB details',
|
||||
actions: {
|
||||
/*
|
||||
assignVm: {
|
||||
label: 'Assign VMs to Internal LB',
|
||||
messages: {
|
||||
notification: function(args) { return 'Assign VMs to Internal LB'; }
|
||||
},
|
||||
listView: $.extend(true, {}, cloudStack.sections.instances.listView, {
|
||||
type: 'checkbox',
|
||||
filters: false,
|
||||
dataProvider: function(args) {
|
||||
$.ajax({
|
||||
url: createURL('listVirtualMachines'),
|
||||
data: {
|
||||
networkid: args.context.networks[0].id,
|
||||
listAll: true
|
||||
},
|
||||
success: function(json) {
|
||||
var instances = json.listvirtualmachinesresponse.virtualmachine;
|
||||
|
||||
// Pre-select existing instances in LB rule
|
||||
$(instances).map(function(index, instance) {
|
||||
instance._isSelected = $.grep(
|
||||
args.context.internalLoadBalancers[0].loadbalancerinstance,
|
||||
|
||||
function(lbInstance) {
|
||||
return lbInstance.id == instance.id;
|
||||
}
|
||||
).length ? true : false;
|
||||
});
|
||||
|
||||
args.response.success({
|
||||
data: instances
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}),
|
||||
action: function(args) {
|
||||
var vms = args.context.instances;
|
||||
var array1 = [];
|
||||
for(var i = 0; i < vms.length; i++) {
|
||||
array1.push(vms[i].id);
|
||||
}
|
||||
var virtualmachineids = array1.join(',');
|
||||
|
||||
$.ajax({
|
||||
url: createURL('assignToLoadBalancerRule'),
|
||||
data: {
|
||||
id: args.context.internalLoadBalancers[0].id,
|
||||
virtualmachineids: virtualmachineids
|
||||
},
|
||||
dataType: 'json',
|
||||
async: true,
|
||||
success: function(data) {
|
||||
var jid = data.assigntoloadbalancerruleresponse.jobid;
|
||||
args.response.success({
|
||||
_custom: { jobId: jid }
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
notification: {
|
||||
poll: pollAsyncJobResult
|
||||
}
|
||||
},
|
||||
*/
|
||||
actions: {
|
||||
remove: {
|
||||
label: 'Delete Internal LB',
|
||||
messages: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user