1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-16 22:50:10 +03:00

B #5525: Fix VNTemplate AR update (#1459)

(cherry picked from commit fa3a7ecebed944e7234522698046699679cb5800)
This commit is contained in:
Frederick Borges 2021-09-15 16:51:10 +02:00 committed by Tino Vazquez
parent 81e274b593
commit 2f8e33ed3d
No known key found for this signature in database
GPG Key ID: 14201E424D02047E
5 changed files with 14 additions and 14 deletions

View File

@ -64,7 +64,6 @@ define(function(require) {
call: OpenNebulaResource.update,
callback: function(req) {
// Reset the wizard
Sunstone.getDialog(ADD_AR_DIALOG_ID).hide();
Sunstone.getDialog(ADD_AR_DIALOG_ID).reset();
Sunstone.runAction("VNTemplate.show",req.request.data[0]);
@ -77,7 +76,6 @@ define(function(require) {
call: OpenNebulaResource.update,
callback: function(req) {
// Reset the wizard
Sunstone.getDialog(UPDATE_AR_DIALOG_ID).hide();
Sunstone.getDialog(UPDATE_AR_DIALOG_ID).reset();
Sunstone.runAction("VNTemplate.show",req.request.data[0]);

View File

@ -99,9 +99,7 @@ define(function(require) {
delete that.element.TEMPLATE.AR_POOL;
Sunstone.runAction('VNTemplate.add_ar', that.vntmplId, TemplateUtils.templateToString(that.element.TEMPLATE));
})
.on("submit", function(ev) {
ev.preventDefault();
return false;
});
}

View File

@ -133,11 +133,10 @@ define(function(require) {
$("#ar_list_datatable", that.context).DataTable().columns.adjust().draw();
$("#ar_list_datatable tbody tr:last", that.context).attr("ar", data.AR_ID);
Sunstone.getDialog(DIALOG_ID).hide();
})
.on("submit", function(ev) {
ev.preventDefault();
Sunstone.getDialog(DIALOG_ID).hide();
});
$("#instantiate_add_ar_ar_type_ip4", context).prop('checked', true);

View File

@ -79,15 +79,19 @@ define(function(require) {
})
.on('formvalid.zf.abide', function(ev, frm) {
var data = that.arTab.retrieve();
data['AR_ID'] = that.arId;
for (i in that.element.TEMPLATE.AR) {
if ( that.element.TEMPLATE.AR[i].AR_ID == that.arId ) {
that.element.TEMPLATE.AR[i] = data;
break;
if (Array.isArray(that.element.TEMPLATE.AR)){
for (i in that.element.TEMPLATE.AR) {
if ( that.element.TEMPLATE.AR[i].AR_ID == that.arId ) {
that.element.TEMPLATE.AR[i] = data;
break;
}
}
}
else {
that.element.TEMPLATE.AR = data;
}
delete that.element.TEMPLATE.AR_POOL;
@ -97,6 +101,7 @@ define(function(require) {
})
.on("submit", function(ev) {
ev.preventDefault();
Sunstone.getDialog(DIALOG_ID).hide();
}
);
}

View File

@ -72,7 +72,7 @@ define(function(require) {
}
function _hide() {
this.dialogElement.foundation("close");
this.dialogElement.foundation("close");
}
function _reset() {