CLOUDSTACK-4700: UI > Instances > Reset VM action > if the template from which vm is created is password-enabled, pop up "Password hsa been reset to xxxxxxx" dialog.

This commit is contained in:
Jessica Wang 2013-09-18 11:39:37 -07:00
parent bf6a5ff023
commit 9b81c91e31
2 changed files with 25 additions and 15 deletions

View File

@ -605,6 +605,12 @@
},
notification: function(args) {
return 'Reset VM';
},
complete: function(args) {
if (args.password != null && args.password.length > 0)
return 'Password has been reset to ' + args.password;
else
return null;
}
},
@ -613,24 +619,26 @@
url: createURL("restoreVirtualMachine&virtualmachineid=" + args.context.instances[0].id),
dataType: "json",
async: true,
success: function(json) {
var item = json.restorevmresponse;
args.response.success({
data: item
});
success: function(json) {
var jid = json.restorevmresponse.jobid;
args.response.success({
_custom: {
jobId: jid,
getUpdatedItem: function(json) {
return json.queryasyncjobresultresponse.jobresult.virtualmachine;
},
getActionFilter: function() {
return vmActionfilter;
}
}
});
}
});
},
notification: {
poll: function(args) {
args.complete({
data: {
state: 'Stopped'
}
});
}
poll: pollAsyncJobResult
}
},

View File

@ -223,9 +223,11 @@
}
if (messages.complete) {
cloudStack.dialog.notice({
message: messages.complete(args2.data)
});
if( messages.complete(args2.data) != null && messages.complete(args2.data).length > 0) {
cloudStack.dialog.notice({
message: messages.complete(args2.data)
});
}
}
if (additional && additional.complete) additional.complete($.extend(true, args, {
$detailView: $detailView