Skip to content

Commit d03fb2a

Browse files
author
Jessica Wang
committed
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.
1 parent 8197f1f commit d03fb2a

3 files changed

Lines changed: 32 additions & 32 deletions

File tree

‎ui/scripts/instances.js‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@
541541
dataType: "json",
542542
success: function(json) {
543543
var jid = json.deployvirtualmachineresponse.jobid;
544-
var vmid = json.deployvirtualmachineresponse.id;
544+
var vmid = json.deployvirtualmachineresponse.id;
545545
args.response.success(
546546
{_custom:
547547
{jobId: jid,
@@ -554,18 +554,18 @@
554554
getActionFilter: function() {
555555
return vmActionfilter;
556556
},
557-
getUpdatedData: function() {
558-
var item;
559-
$.ajax({
560-
url: createURL("listVirtualMachines&id="+vmid),
561-
dataType: "json",
562-
async: false,
563-
success: function(json) {
564-
item = json.listvirtualmachinesresponse.virtualmachine[0];
565-
}
566-
});
567-
return item;
568-
}
557+
getUpdatedItemWhenAsyncJobFails: function() {
558+
var item;
559+
$.ajax({
560+
url: createURL("listVirtualMachines&id="+vmid),
561+
dataType: "json",
562+
async: false,
563+
success: function(json) {
564+
item = json.listvirtualmachinesresponse.virtualmachine[0];
565+
}
566+
});
567+
return item;
568+
}
569569
}
570570
}
571571
);

‎ui/scripts/sharedFunctions.js‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,14 @@ var pollAsyncJobResult = function(args) {
8686
}
8787
else if (result.jobstatus == 2) { // Failed
8888
var msg = (result.jobresult.errortext == null)? "": result.jobresult.errortext;
89-
if (args._custom.getUpdatedData != null && args._custom.getActionFilter != null) {
90-
args.error({message: msg, updatedData: args._custom.getUpdatedData(), actionFilter: args._custom.getActionFilter()});
91-
} else if (args._custom.getUpdatedData != null && args._custom.getActionFilter == null) {
92-
args.error({message: msg, updatedData: args._custom.getUpdatedData()});
93-
}
94-
else {
95-
args.error({message: msg});
96-
}
89+
if (args._custom.getUpdatedItemWhenAsyncJobFails != null && args._custom.getActionFilter != null) {
90+
args.error({message: msg, updatedData: args._custom.getUpdatedItemWhenAsyncJobFails(), actionFilter: args._custom.getActionFilter()});
91+
} else if (args._custom.getUpdatedItemWhenAsyncJobFails != null && args._custom.getActionFilter == null) {
92+
args.error({message: msg, updatedData: args._custom.getUpdatedItemWhenAsyncJobFails()});
93+
}
94+
else {
95+
args.error({message: msg});
96+
}
9797
}
9898
}
9999
},

‎ui/scripts/ui/widgets/listView.js‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -97,17 +97,17 @@
9797

9898
// Error
9999
function(args) {
100-
if (args && args.updatedData) {
101-
if ($item.is(':visible') && !isHeader) {
102-
replaceItem(
103-
$item,
104-
args.updatedData,
105-
args.actionFilter
106-
);
107-
}
108-
} else {
109-
$item.remove();
110-
}
100+
if (args && args.updatedData) {
101+
if ($item.is(':visible') && !isHeader) {
102+
replaceItem(
103+
$item,
104+
args.updatedData,
105+
args.actionFilter
106+
);
107+
}
108+
} else {
109+
$item.remove();
110+
}
111111
}
112112
);
113113
}

0 commit comments

Comments
 (0)