You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by je...@apache.org on 2014/06/07 00:18:09 UTC

git commit: updated refs/heads/4.4-forward to e9ebe6e

Repository: cloudstack
Updated Branches:
  refs/heads/4.4-forward d991e3786 -> e9ebe6e22


CLOUDSTACK-6852: UI - modules - (1) add new shared function addExtraPropertiesIfDrModuleIncluded(). (2) add DR fields to Instances detailView.


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

Branch: refs/heads/4.4-forward
Commit: e9ebe6e22e1db5104ed9a0f50de17c14c6b6fc28
Parents: d991e37
Author: Jessica Wang <je...@apache.org>
Authored: Fri Jun 6 15:15:11 2014 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Fri Jun 6 15:17:51 2014 -0700

----------------------------------------------------------------------
 ui/scripts/instances.js       |  3 +++
 ui/scripts/sharedFunctions.js | 26 ++++++++++++++++++++++++++
 2 files changed, 29 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e9ebe6e2/ui/scripts/instances.js
----------------------------------------------------------------------
diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js
index d219e6d..cda531e 100644
--- a/ui/scripts/instances.js
+++ b/ui/scripts/instances.js
@@ -1878,6 +1878,9 @@
                                             jsonObj.xenserverToolsVersion61plus = false;
                                     }
                                     
+                                    //if DR module is included                                   
+                                    addExtraPropertiesIfDrModuleIncluded(jsonObj, "UserVM");
+                                                                        
                                     args.response.success({
                                         actionFilter: vmActionfilter,
                                         data: jsonObj

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e9ebe6e2/ui/scripts/sharedFunctions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js
index 445351a..5672820 100644
--- a/ui/scripts/sharedFunctions.js
+++ b/ui/scripts/sharedFunctions.js
@@ -1175,6 +1175,32 @@ function listViewDataProvider(args, data, options) {
     return data;
 }
 
+var addExtraPropertiesIfDrModuleIncluded = function(jsonObj, resourceType) {      
+    if (drModuleIncluded) {
+        $.ajax({
+            url: createURL("listResourceDetails"),
+            data: {
+                resourceid: jsonObj.id,
+                resourcetype: resourceType
+            },
+            async: false,
+            success: function(json) {    
+                var drFieldNameArray = [];
+                var resourcedetails = json.listresourcedetailsresponse.resourcedetail;
+                if (resourcedetails != undefined) {
+                    for (var i = 0; i < resourcedetails.length; i++) {                                                        
+                        if (resourcedetails[i].key.indexOf("DR_") > -1) {     
+                            drFieldNameArray.push(resourcedetails[i].key);
+                            jsonObj[resourcedetails[i].key] = resourcedetails[i].value;                                                                                                                   
+                        }
+                    }
+                }                  
+                jsonObj["drFieldNameArray"] = drFieldNameArray;
+            }
+        });
+    }    
+}
+
 //used by infrastructure page and network page
 var addExtraPropertiesToGuestNetworkObject = function(jsonObj) {
     jsonObj.networkdomaintext = jsonObj.networkdomain;