mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
bug 13554: network menu - network page - Edit network - if network type is Isolated and network offering is changed, pop up a dialog box "Do you want to keep the current guest network CIDR unchanged?". Choosing Yes button will send "changecidr=false" to updateNetwork API. Choosing Cancel button will send "changecidr=true" to updateNetwork API.
This commit is contained in:
parent
0625839920
commit
d1e6e84451
@ -348,32 +348,80 @@
|
||||
var array1 = [];
|
||||
array1.push("&name=" + todb(args.data.name));
|
||||
array1.push("&displaytext=" + todb(args.data.displaytext));
|
||||
|
||||
//args.data.networkofferingid is null when networkofferingid field is hidden
|
||||
if(args.data.networkofferingid != null && args.data.networkofferingid != args.context.networks[0].networkofferingid)
|
||||
array1.push("&networkofferingid=" + todb(args.data.networkofferingid));
|
||||
|
||||
|
||||
//args.data.networkdomain is null when networkdomain field is hidden
|
||||
if(args.data.networkdomain != null && args.data.networkdomain != args.context.networks[0].networkdomain)
|
||||
array1.push("&networkdomain=" + todb(args.data.networkdomain));
|
||||
|
||||
$.ajax({
|
||||
url: createURL("updateNetwork&id=" + args.context.networks[0].id + array1.join("")),
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
var jid = json.updatenetworkresponse.jobid;
|
||||
args.response.success(
|
||||
{_custom:
|
||||
{jobId: jid,
|
||||
getUpdatedItem: function(json) {
|
||||
var item = json.queryasyncjobresultresponse.jobresult.network;
|
||||
return {data: item};
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
//args.data.networkofferingid is null when networkofferingid field is hidden
|
||||
if(args.data.networkofferingid != null && args.data.networkofferingid != args.context.networks[0].networkofferingid) {
|
||||
array1.push("&networkofferingid=" + todb(args.data.networkofferingid));
|
||||
|
||||
if(args.context.networks[0].type == "Isolated") { //Isolated network
|
||||
cloudStack.dialog.confirm({
|
||||
message: 'Do you want to keep the current guest network CIDR unchanged?',
|
||||
action: function() { //"Yes" button is clicked
|
||||
array1.push("&changecidr=false");
|
||||
$.ajax({
|
||||
url: createURL("updateNetwork&id=" + args.context.networks[0].id + array1.join("")),
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
var jid = json.updatenetworkresponse.jobid;
|
||||
args.response.success(
|
||||
{_custom:
|
||||
{jobId: jid,
|
||||
getUpdatedItem: function(json) {
|
||||
var item = json.queryasyncjobresultresponse.jobresult.network;
|
||||
return {data: item};
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
cancelAction: function() { //"Cancel" button is clicked
|
||||
array1.push("&changecidr=true");
|
||||
$.ajax({
|
||||
url: createURL("updateNetwork&id=" + args.context.networks[0].id + array1.join("")),
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
var jid = json.updatenetworkresponse.jobid;
|
||||
args.response.success(
|
||||
{_custom:
|
||||
{jobId: jid,
|
||||
getUpdatedItem: function(json) {
|
||||
var item = json.queryasyncjobresultresponse.jobresult.network;
|
||||
return {data: item};
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: createURL("updateNetwork&id=" + args.context.networks[0].id + array1.join("")),
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
var jid = json.updatenetworkresponse.jobid;
|
||||
args.response.success(
|
||||
{_custom:
|
||||
{jobId: jid,
|
||||
getUpdatedItem: function(json) {
|
||||
var item = json.queryasyncjobresultresponse.jobresult.network;
|
||||
return {data: item};
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
notification: {
|
||||
poll: pollAsyncJobResult
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user