Skip to content

Commit 21a6271

Browse files
committed
VPC UI, internal LB: Fix assignedVMs actions
1 parent 88a62ab commit 21a6271

1 file changed

Lines changed: 50 additions & 29 deletions

File tree

ui/scripts/vpc.js

Lines changed: 50 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,6 @@
605605

606606
assignedVms: {
607607
title: 'Assigned VMs',
608-
multiple: true,
609608
listView: {
610609
id: 'assignedVms',
611610
fields: {
@@ -625,11 +624,12 @@
625624
});
626625
},
627626
actions: {
628-
add: {
627+
add: {
629628
label: 'Assign VMs',
630-
messages: {
629+
messages: {
631630
notification: function(args) { return 'Assign VMs'; }
632631
},
632+
needsRefresh: true,
633633
listView: $.extend(true, {}, cloudStack.sections.instances.listView, {
634634
type: 'checkbox',
635635
filters: false,
@@ -688,36 +688,57 @@
688688
notification: {
689689
poll: pollAsyncJobResult
690690
}
691-
},
692-
693-
remove: {
694-
label: 'remove VM from load balancer',
695-
addRow: 'false',
696-
messages: {
697-
confirm: function(args) {
698-
return 'Please confirm you want to remove VM from load balancer';
691+
}
692+
},
693+
detailView: {
694+
actions: {
695+
remove: {
696+
label: 'remove VM from load balancer',
697+
addRow: 'false',
698+
messages: {
699+
confirm: function(args) {
700+
return 'Please confirm you want to remove VM from load balancer';
701+
},
702+
notification: function(args) {
703+
return 'remove VM from load balancer';
704+
}
705+
},
706+
action: function(args) {
707+
$.ajax({
708+
url: createURL('removeFromLoadBalancerRule'),
709+
data: {
710+
id: args.context.internalLoadBalancers[0].id,
711+
virtualmachineids: args.context.assignedVms[0].id
712+
},
713+
success: function(json) {
714+
var jid = json.removefromloadbalancerruleresponse.jobid;
715+
args.response.success({
716+
_custom: { jobId: jid }
717+
});
718+
}
719+
});
699720
},
700-
notification: function(args) {
701-
return 'remove VM from load balancer';
721+
notificaton: {
722+
poll: pollAsyncJobResult
702723
}
703-
},
704-
action: function(args) {
705-
$.ajax({
706-
url: createURL('removeFromLoadBalancerRule'),
707-
data: {
708-
id: args.context.internalLoadBalancers[0].id,
709-
virtualmachineids: args.context.assignedVms[0].id
724+
}
725+
},
726+
tabs: {
727+
details: {
728+
title: 'label.details',
729+
fields: [
730+
{
731+
name: { label: 'label.name' }
710732
},
711-
success: function(json) {
712-
var jid = json.removefromloadbalancerruleresponse.jobid;
713-
args.response.success({
714-
_custom: { jobId: jid }
715-
});
733+
{
734+
ipaddress: { label: 'label.ip.address' }
716735
}
717-
});
718-
},
719-
notificaton: {
720-
poll: pollAsyncJobResult
736+
],
737+
dataProvider: function(args) {
738+
setTimeout(function() {
739+
args.response.success({ data: args.context.assignedVms[0] });
740+
});
741+
}
721742
}
722743
}
723744
}

0 commit comments

Comments
 (0)