mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 11:52:28 +01:00
Fix delete domain button in the UI to update only after job finishes (#2905)
When the “deleteDomain” command is sent via UI, the HTML is already updated assuming that the “deleteDomain” command will actually delete it. However, there are cases (domain with allocated resources) that will not allow ACS to remove the command; as a consequence, the UI will not be in sync with ACS state, which can lead to misunderstandings.
This commit is contained in:
parent
f36e0c77aa
commit
63094b2fbf
@ -69,11 +69,23 @@
|
||||
async: false,
|
||||
success: function(json) {
|
||||
var jid = json.deletedomainresponse.jobid;
|
||||
var wasDomainDeletedWithSuccess = false;
|
||||
$.ajax({
|
||||
url: createURL("queryAsyncJobResult&jobId=" + jid),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
wasDomainDeletedWithSuccess = json.queryasyncjobresultresponse.jobresultcode == 0;
|
||||
}
|
||||
});
|
||||
args.response.success({
|
||||
_custom: {
|
||||
jobId: jid
|
||||
}
|
||||
});
|
||||
if(!wasDomainDeletedWithSuccess){
|
||||
return;
|
||||
}
|
||||
|
||||
// Quick fix for proper UI reaction to delete domain
|
||||
var $item = $('.name.selected').closest('li');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user