Skip to content

Commit 9f564fc

Browse files
author
Jessica Wang
committed
CLOUDSTACK-747: internal LB in VPC - internalLB detailView - implement Delete Internal LB action.
1 parent 5435495 commit 9f564fc

1 file changed

Lines changed: 38 additions & 7 deletions

File tree

ui/scripts/vpc.js

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -433,9 +433,7 @@
433433
}
434434
);
435435
}
436-
});
437-
438-
args.response.success();
436+
});
439437
},
440438
notification: {
441439
poll: pollAsyncJobResult
@@ -444,12 +442,12 @@
444442
},
445443

446444
detailView: {
447-
name: 'Internal Lb details',
445+
name: 'Internal LB details',
448446
actions: {
449447
assignVm: {
450-
label: 'Assign VMs to LB',
448+
label: 'Assign VMs to Internal LB',
451449
messages: {
452-
notification: function(args) { return 'Assign VM to internal LB rule'; }
450+
notification: function(args) { return 'Assign VMs to Internal LB'; }
453451
},
454452
listView: $.extend(true, {}, cloudStack.sections.instances.listView, {
455453
type: 'checkbox',
@@ -509,7 +507,40 @@
509507
notification: {
510508
poll: pollAsyncJobResult
511509
}
512-
}
510+
},
511+
remove: {
512+
label: 'Delete Internal LB',
513+
messages: {
514+
confirm: function(args) {
515+
return 'Please confirm you want to delete Internal LB';
516+
},
517+
notification: function(args) {
518+
return 'Delete Internal LB';
519+
}
520+
},
521+
action: function(args) {
522+
var data = {
523+
id: args.context.internalLoadBalancers[0].id
524+
};
525+
$.ajax({
526+
url: createURL('deleteLoadBalancer'),
527+
data: data,
528+
async: true,
529+
success: function(json) {
530+
var jid = json.deleteloadbalancerresponse.jobid;
531+
args.response.success({
532+
_custom: { jobId: jid }
533+
});
534+
},
535+
error: function(data) {
536+
args.response.error(parseXMLHttpResponse(data));
537+
}
538+
});
539+
},
540+
notification: {
541+
poll: pollAsyncJobResult
542+
}
543+
}
513544
},
514545
tabs: {
515546
details: {

0 commit comments

Comments
 (0)