mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-9228: Network update with mistmatch in services require forced option
Added a confirmation dialog box to check whether to make force update or not. The dialog appears only for the Admin. Only admin can make force update. The new dialog appears after the first CIDR unchanged confirmation dialog.
This commit is contained in:
parent
13bfdd71e6
commit
c1bc47c10b
|
|
@ -1965,6 +1965,7 @@ var dictionary = {"ICMP.code":"ICMP Code",
|
|||
"message.confirm.enable.provider":"Please confirm that you would like to enable this provider",
|
||||
"message.confirm.enable.vnmc.provider":"Please confirm you would like to enable the VNMC provider.",
|
||||
"message.confirm.enable.vpc.offering":"Are you sure you want to enable this VPC offering?",
|
||||
"message.confirm.force.update":"Do you want to make a force update?",
|
||||
"message.confirm.join.project":"Please confirm you wish to join this project.",
|
||||
"message.confirm.migrate.volume":"Do you want to migrate this volume?",
|
||||
"message.confirm.refresh.blades":"Please confirm that you want to refresh blades.",
|
||||
|
|
|
|||
|
|
@ -965,53 +965,15 @@
|
|||
if (args.context.networks[0].type == "Isolated") { //Isolated network
|
||||
cloudStack.dialog.confirm({
|
||||
message: 'message.confirm.current.guest.CIDR.unchanged',
|
||||
action: function() { //"Yes" button is clicked
|
||||
$.extend(data, {
|
||||
changecidr: false
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: createURL('updateNetwork'),
|
||||
data: data,
|
||||
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
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
action: function() { //"Yes" button is clicked
|
||||
getForcedInfoAndUpdateNetwork(data);
|
||||
},
|
||||
cancelAction: function() { //"Cancel" button is clicked
|
||||
$.extend(data, {
|
||||
changecidr: true
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: createURL('updateNetwork'),
|
||||
data: data,
|
||||
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
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
getForcedInfoAndUpdateNetwork(data);
|
||||
}
|
||||
});
|
||||
return;
|
||||
|
|
@ -6735,4 +6697,79 @@
|
|||
return data;
|
||||
}
|
||||
|
||||
function getForcedInfoAndUpdateNetwork(data) {
|
||||
if (isAdmin()) {
|
||||
cloudStack.dialog.confirm({
|
||||
message: "message.confirm.force.update",
|
||||
action: function() {
|
||||
$.extend(data, {
|
||||
forced: true
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: createURL('updateNetwork'),
|
||||
async: false,
|
||||
data: data,
|
||||
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() {
|
||||
$.ajax({
|
||||
url: createURL('updateNetwork'),
|
||||
async: false,
|
||||
data: data,
|
||||
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
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
$.ajax({
|
||||
url: createURL('updateNetwork'),
|
||||
async: false,
|
||||
data: data,
|
||||
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
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
})(cloudStack, jQuery);
|
||||
|
|
|
|||
Loading…
Reference in New Issue