cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jessicaw...@apache.org
Subject git commit: updated refs/heads/master to 9b81c91
Date Wed, 18 Sep 2013 18:42:26 GMT
Updated Branches:
  refs/heads/master bf6a5ff02 -> 9b81c91e3


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.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9b81c91e
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9b81c91e
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9b81c91e

Branch: refs/heads/master
Commit: 9b81c91e316b08c8fbcb3446fa4f900da8ee8bb8
Parents: bf6a5ff
Author: Jessica Wang <jessicawang@apache.org>
Authored: Wed Sep 18 11:39:37 2013 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Wed Sep 18 11:42:14 2013 -0700

----------------------------------------------------------------------
 ui/scripts/instances.js             | 32 ++++++++++++++++++++------------
 ui/scripts/ui/widgets/detailView.js |  8 +++++---
 2 files changed, 25 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9b81c91e/ui/scripts/instances.js
----------------------------------------------------------------------
diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js
index 20d3d9a..cf8aca5 100644
--- a/ui/scripts/instances.js
+++ b/ui/scripts/instances.js
@@ -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
                         }
 
                     },

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9b81c91e/ui/scripts/ui/widgets/detailView.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/detailView.js b/ui/scripts/ui/widgets/detailView.js
index 3a59d41..0e975e4 100644
--- a/ui/scripts/ui/widgets/detailView.js
+++ b/ui/scripts/ui/widgets/detailView.js
@@ -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


Mime
View raw message