mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 11:52:28 +01:00
Fix to make edit guest network details async
This commit is contained in:
parent
ed854ba221
commit
f253be7715
@ -258,36 +258,11 @@
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
var jobId = json.updatephysicalnetworkresponse.jobid;
|
||||
var timerKey = "updatePhysicalNetworkJob_"+jobId;
|
||||
$("body").everyTime(2000, timerKey, function() {
|
||||
$.ajax({
|
||||
url: createURL("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);
|
||||
if (result.jobstatus == 1) {
|
||||
var item = json.queryasyncjobresultresponse.jobresult.physicalnetwork;
|
||||
args.response.success({data:item});
|
||||
}
|
||||
else if (result.jobstatus == 2) {
|
||||
alert("updatePhysicalNetwork failed. Error: " + fromdb(result.jobresult.errortext));
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
|
||||
alert("updatePhysicalNetwork failed. Error: " + errorMsg);
|
||||
}
|
||||
});
|
||||
});
|
||||
args.response.success({ _custom: { jobId: jobId }});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
notification: { poll: pollAsyncJobResult }
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
_custom: notification._custom,
|
||||
poll: function(args) {
|
||||
var complete = args.complete;
|
||||
var notificationError = args.error;
|
||||
|
||||
notification.poll({
|
||||
_custom: args._custom,
|
||||
@ -34,14 +35,10 @@
|
||||
complete(args);
|
||||
},
|
||||
error: function(args) {
|
||||
if (args.message) {
|
||||
if (args.message) {
|
||||
cloudStack.dialog.notice({ message: args.message });
|
||||
}
|
||||
error($.extend(errorArgs, args));
|
||||
notificationError(args);
|
||||
|
||||
error($.extend(errorArgs, args));
|
||||
complete(args);
|
||||
}
|
||||
return cloudStack.dialog.error;
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -337,10 +334,11 @@
|
||||
_custom: $detailView.data('_custom'),
|
||||
context: $detailView.data('view-args').context,
|
||||
response: {
|
||||
success: function() {
|
||||
success: function(args) {
|
||||
var notificationArgs = {
|
||||
section: id,
|
||||
desc: 'Changed item properties'
|
||||
desc: 'Changed item properties',
|
||||
_custom: args._custom
|
||||
};
|
||||
|
||||
if (!action.notification) {
|
||||
@ -358,6 +356,10 @@
|
||||
|
||||
convertInputs($inputs);
|
||||
$loading.remove();
|
||||
}, [],
|
||||
function() {
|
||||
$loading.remove();
|
||||
$inputs.closest('.detail-view').find('.toolbar .refresh').click();
|
||||
}, []
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user