mirror of https://github.com/apache/cloudstack.git
cloudstack 3.0 UI - (1) to distinguish between getUpdatedItem() and getUpdatedData(), rename getUpdatedData() to getUpdatedItemWhenAsyncJobFails() since it's being called only when async job fails. (2) fix the space problem (tab size is not 2) from patch.
This commit is contained in:
parent
efc45f9ee9
commit
a7f3c4ba20
|
|
@ -537,7 +537,7 @@
|
|||
dataType: "json",
|
||||
success: function(json) {
|
||||
var jid = json.deployvirtualmachineresponse.jobid;
|
||||
var vmid = json.deployvirtualmachineresponse.id;
|
||||
var vmid = json.deployvirtualmachineresponse.id;
|
||||
args.response.success(
|
||||
{_custom:
|
||||
{jobId: jid,
|
||||
|
|
@ -550,18 +550,18 @@
|
|||
getActionFilter: function() {
|
||||
return vmActionfilter;
|
||||
},
|
||||
getUpdatedData: function() {
|
||||
var item;
|
||||
$.ajax({
|
||||
url: createURL("listVirtualMachines&id="+vmid),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
item = json.listvirtualmachinesresponse.virtualmachine[0];
|
||||
}
|
||||
});
|
||||
return item;
|
||||
}
|
||||
getUpdatedItemWhenAsyncJobFails: function() {
|
||||
var item;
|
||||
$.ajax({
|
||||
url: createURL("listVirtualMachines&id="+vmid),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
item = json.listvirtualmachinesresponse.virtualmachine[0];
|
||||
}
|
||||
});
|
||||
return item;
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -82,14 +82,14 @@ var pollAsyncJobResult = function(args) {
|
|||
}
|
||||
else if (result.jobstatus == 2) { // Failed
|
||||
var msg = (result.jobresult.errortext == null)? "": result.jobresult.errortext;
|
||||
if (args._custom.getUpdatedData != null && args._custom.getActionFilter != null) {
|
||||
args.error({message: msg, updatedData: args._custom.getUpdatedData(), actionFilter: args._custom.getActionFilter()});
|
||||
} else if (args._custom.getUpdatedData != null && args._custom.getActionFilter == null) {
|
||||
args.error({message: msg, updatedData: args._custom.getUpdatedData()});
|
||||
}
|
||||
else {
|
||||
args.error({message: msg});
|
||||
}
|
||||
if (args._custom.getUpdatedItemWhenAsyncJobFails != null && args._custom.getActionFilter != null) {
|
||||
args.error({message: msg, updatedData: args._custom.getUpdatedItemWhenAsyncJobFails(), actionFilter: args._custom.getActionFilter()});
|
||||
} else if (args._custom.getUpdatedItemWhenAsyncJobFails != null && args._custom.getActionFilter == null) {
|
||||
args.error({message: msg, updatedData: args._custom.getUpdatedItemWhenAsyncJobFails()});
|
||||
}
|
||||
else {
|
||||
args.error({message: msg});
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -93,17 +93,17 @@
|
|||
|
||||
// Error
|
||||
function(args) {
|
||||
if (args && args.updatedData) {
|
||||
if ($item.is(':visible') && !isHeader) {
|
||||
replaceItem(
|
||||
$item,
|
||||
args.updatedData,
|
||||
args.actionFilter
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$item.remove();
|
||||
}
|
||||
if (args && args.updatedData) {
|
||||
if ($item.is(':visible') && !isHeader) {
|
||||
replaceItem(
|
||||
$item,
|
||||
args.updatedData,
|
||||
args.actionFilter
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$item.remove();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue