mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-10 01:17:40 +03:00
parent
0784385caf
commit
acba29efc2
@ -180,6 +180,9 @@ define(function(require) {
|
||||
context.off("click", 'button#rm_ar_button');
|
||||
context.on("click", 'button#rm_ar_button', function(){
|
||||
var ar_id = $(this).attr('ar_id');
|
||||
var ar_list = Array.isArray(that.element.TEMPLATE.AR)
|
||||
? that.element.TEMPLATE.AR
|
||||
: [that.element.TEMPLATE.AR]
|
||||
|
||||
Sunstone.getDialog(CONFIRM_DIALOG_ID).setParams({
|
||||
//header :
|
||||
@ -187,16 +190,15 @@ define(function(require) {
|
||||
body : Locale.tr("This will delete all the addresses in this range"),
|
||||
//question :
|
||||
submit : function(){
|
||||
var obj = {ar_id: ar_id};
|
||||
|
||||
for (i in that.element.TEMPLATE.AR) {
|
||||
if ( that.element.TEMPLATE.AR[i].AR_ID == ar_id ) {
|
||||
that.element.TEMPLATE.AR.splice(i, 1);
|
||||
for (var i=0; i<ar_list.length; i++){
|
||||
if (ar_id == i){
|
||||
delete ar_list[i]
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
delete that.element.TEMPLATE.AR_POOL;
|
||||
that.element.TEMPLATE.AR = ar_list
|
||||
that.element.TEMPLATE.AR_POOL = ar_list
|
||||
|
||||
Sunstone.runAction('VNTemplate.remove_ar', that.element.ID, TemplateUtils.templateToString(that.element.TEMPLATE));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user