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 36ec16e
Date Fri, 06 Jun 2014 22:18:56 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master ea196a4ff -> 36ec16e4f


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/36ec16e4
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/36ec16e4
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/36ec16e4

Branch: refs/heads/master
Commit: 36ec16e4f51a40a856c85f8b7c05587d5cd91842
Parents: ea196a4
Author: Jessica Wang <jessicawang@apache.org>
Authored: Fri Jun 6 15:15:11 2014 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Fri Jun 6 15:18:46 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/36ec16e4/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/36ec16e4/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;


Mime
View raw message