CLOUDSTACK-747: UI - Internal LB detailView - Assigned VMs tab - implement Remove from LB action.

This commit is contained in:
Jessica Wang 2013-06-05 13:43:51 -07:00
parent ee5f3d7266
commit bea3f44144

View File

@ -607,6 +607,7 @@
title: 'Assigned VMs',
multiple: true,
listView: {
id: 'assignedVms',
fields: {
name: { label: 'label.name' },
ipaddress: { label: 'label.ip.address' }
@ -622,6 +623,38 @@
args.response.success({ data: item.loadbalancerinstance });
}
});
},
actions: {
remove: {
label: 'remove VM from load balancer',
addRow: 'false',
messages: {
confirm: function(args) {
return 'Please confirm you want to remove VM from load balancer';
},
notification: function(args) {
return 'remove VM from load balancer';
}
},
action: function(args) {
$.ajax({
url: createURL('removeFromLoadBalancerRule'),
data: {
id: args.context.internalLoadBalancers[0].id,
virtualmachineids: args.context.assignedVms[0].id
},
success: function(json) {
var jid = json.removefromloadbalancerruleresponse.jobid;
args.response.success({
_custom: { jobId: jid }
});
}
});
},
notificaton: {
poll: pollAsyncJobResult
}
}
}
}
}