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/4.2 to 39e6e7f
Date Mon, 08 Jul 2013 18:58:21 GMT
Updated Branches:
  refs/heads/4.2 c6961ef65 -> 39e6e7f09


CLOUDSTACK-3093: UI - Infrastructure menu - zone detail - physical network - network service
providers - Internal LB VM - add migrate, view console action.


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

Branch: refs/heads/4.2
Commit: 39e6e7f09ce575cf4a84b3dcdbba71c8c2e8f4bb
Parents: c6961ef
Author: Jessica Wang <jessicawang@apache.org>
Authored: Tue Jul 2 14:57:27 2013 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Mon Jul 8 11:58:08 2013 -0700

----------------------------------------------------------------------
 ui/scripts/system.js | 94 ++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 93 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/39e6e7f0/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 64134e2..3daea63 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -3060,7 +3060,95 @@
                         notification: {
                           poll: pollAsyncJobResult
                         }
-                      }            
+                      },
+                     
+                      migrate: {
+                        label: 'Migrate LB VM',
+                        createForm: {
+                          title: 'Migrate LB VM',                          
+                          fields: {
+                            hostId: {
+                              label: 'label.host',
+                              validation: { required: true },
+                              select: function(args) {
+                                $.ajax({
+                                  url: createURL("listHosts&VirtualMachineId=" + args.context.internallbinstances[0].id),
+                                  dataType: "json",
+                                  async: true,
+                                  success: function(json) {
+                                    var hostObjs = json.listhostsresponse.host;
+                                    var items = [];
+                                    $(hostObjs).each(function() {
+                                      items.push({id: this.id, description: (this.name +
" (" + (this.suitableformigration? "Suitable": "Not Suitable") + ")")});
+                                    });
+                                    args.response.success({data: items});
+                                  }
+                                });
+                              },
+                              error: function(XMLHttpResponse) {
+                                var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
+                                args.response.error(errorMsg);
+                              }
+                            }
+                          }
+                        },
+                        messages: {
+                          notification: function(args) {
+                            return 'Migrate LB VM';
+                          }
+                        },
+                        action: function(args) {
+                          $.ajax({
+                            url: createURL("migrateSystemVm&hostid=" + args.data.hostId
+ "&virtualmachineid=" + args.context.internallbinstances[0].id),
+                            dataType: "json",
+                            async: true,
+                            success: function(json) {
+                              var jid = json.migratesystemvmresponse.jobid;
+                              args.response.success({
+                                _custom: {
+                                  jobId: jid,
+                                  getUpdatedItem: function(json) {
+                                    //return json.queryasyncjobresultresponse.jobresult.systemvminstance;
   //not all properties returned in systemvminstance                                   
+                                    $.ajax({
+                                      url: createURL("listInternalLoadBalancerVMs&id="
+ json.queryasyncjobresultresponse.jobresult.systemvminstance.id),
+                                      dataType: "json",
+                                      async: false,
+                                      success: function(json) {                         
             
+                                        var items = json.listinternallbvmssresponse.internalloadbalancervm;
+                                        if(items != null && items.length > 0)
{
+                                          return items[0];
+                                        }
+                                      }
+                                    });
+                                  },
+                                  getActionFilter: function() {
+                                    return internallbinstanceActionfilter;
+                                  }
+                                }
+                              });
+                            }
+                          });
+                        },
+                        notification: {
+                          poll: pollAsyncJobResult
+                        }
+                      },
+
+                      viewConsole: {
+                        label: 'label.view.console',
+                        action: {
+                          externalLink: {
+                            url: function(args) {
+                              return clientConsoleUrl + '?cmd=access&vm=' + args.context.internallbinstances[0].id;
+                            },
+                            title: function(args) {
+                              return args.context.internallbinstances[0].id.substr(0,8);
 //title in window.open() can't have space nor longer than 8 characters. Otherwise, IE browser
will have error.
+                            },
+                            width: 820,
+                            height: 640
+                          }
+                        }
+                      }
                     },
                     tabs: {
                       details: {
@@ -14797,6 +14885,10 @@
 
     if (jsonObj.state == 'Running') {
       allowedActions.push("stop");
+            
+      allowedActions.push("viewConsole");
+      if (isAdmin())
+        allowedActions.push("migrate");
     }
     else if (jsonObj.state == 'Stopped') {
       allowedActions.push("start");      


Mime
View raw message