mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 10:32:34 +01:00
deletePortForwardingRule API has been changed from sync to async. This is corresponding UI change.
This commit is contained in:
parent
68727778ba
commit
a0828d7ad8
@ -1186,18 +1186,53 @@ function portForwardingJsonToTemplate(jsonObj, $template) {
|
|||||||
var $spinningWheel = $rowContainer.find("#spinning_wheel");
|
var $spinningWheel = $rowContainer.find("#spinning_wheel");
|
||||||
$spinningWheel.find("#description").text("Revoking....");
|
$spinningWheel.find("#description").text("Revoking....");
|
||||||
$spinningWheel.show();
|
$spinningWheel.show();
|
||||||
$.ajax({
|
|
||||||
data: createURL("command=deletePortForwardingRule&id="+fromdb(jsonObj.id)),
|
$.ajax({
|
||||||
dataType: "json",
|
data: createURL("command=deletePortForwardingRule&id="+fromdb(jsonObj.id)),
|
||||||
success: function(json) {
|
dataType: "json",
|
||||||
$template.find("#state").text("Revoked");
|
success: function(json) {
|
||||||
$spinningWheel.hide();
|
var jobId = json.deleteportforwardingruleresponse.jobid;
|
||||||
|
var timerKey = "asyncJob_" + jobId;
|
||||||
|
$("body").everyTime(
|
||||||
|
10000,
|
||||||
|
timerKey,
|
||||||
|
function() {
|
||||||
|
$.ajax({
|
||||||
|
data: createURL("command=queryAsyncJobResult&jobId="+jobId),
|
||||||
|
dataType: "json",
|
||||||
|
success: function(json) {
|
||||||
|
var result = json.queryasyncjobresultresponse;
|
||||||
|
if (result.jobstatus == 0) {
|
||||||
|
return; //Job has not completed
|
||||||
|
} else {
|
||||||
|
$("body").stopTime(timerKey);
|
||||||
|
$spinningWheel.hide();
|
||||||
|
if (result.jobstatus == 1) { // Succeeded
|
||||||
|
$template.slideUp("slow", function() {
|
||||||
|
$(this).remove();
|
||||||
|
});
|
||||||
|
} else if (result.jobstatus == 2) { // Failed
|
||||||
|
$("#dialog_error").text("Revoking port forwarding rule failed.").dialog("open");
|
||||||
|
//$("#dialog_error").text(fromdb(???)).dialog("open");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(XMLHttpResponse) {
|
||||||
|
$("body").stopTime(timerKey);
|
||||||
|
$spinningWheel.hide();
|
||||||
|
handleError(XMLHttpResponse);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
0
|
||||||
|
);
|
||||||
},
|
},
|
||||||
error: function(XMLHttpResponse) {
|
error: function(XMLHttpResponse) {
|
||||||
handleError(XMLHttpResponse);
|
$spinningWheel.hide();
|
||||||
$spinningWheel.hide();
|
handleError(XMLHttpResponse);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user