You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by pr...@apache.org on 2013/05/04 10:12:04 UTC

git commit: updated refs/heads/master to 63f3ccd

Updated Branches:
  refs/heads/master 870d21c43 -> 63f3ccd4d


CLOUDSTACK-2160:Refresh button functionality for security groups and statistics tab


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

Branch: refs/heads/master
Commit: 63f3ccd4dfc835581305bb57c0878861106dcfe6
Parents: 870d21c
Author: Isaac Chiang <is...@gmail.com>
Authored: Sat May 4 13:41:02 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Sat May 4 13:41:02 2013 +0530

----------------------------------------------------------------------
 ui/scripts/instances.js |   26 +++++++++++++++++++++-----
 1 files changed, 21 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/63f3ccd4/ui/scripts/instances.js
----------------------------------------------------------------------
diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js
index ab9d606..1b89d4f 100644
--- a/ui/scripts/instances.js
+++ b/ui/scripts/instances.js
@@ -1618,7 +1618,16 @@
               }
             ],
             dataProvider: function(args) {
-              args.response.success({data: args.context.instances[0].securitygroup});
+             // args.response.success({data: args.context.instances[0].securitygroup});
+                  $.ajax({
+                   url:createURL("listVirtualMachines&details=secgrp&id=" + args.context.instances[0].id),
+                   dataType: "json",
+                   async:true,	
+                   success:function(json) {
+                     args.response.success({data: json.listvirtualmachinesresponse.virtualmachine[0].securitygroup});	
+                }
+	
+              });
             }
           },
 					
@@ -1634,15 +1643,22 @@
               networkkbswrite: { label: 'label.network.write' }
             },
             dataProvider: function(args) {
-              var jsonObj = args.context.instances[0];
-              args.response.success({
+              $.ajax({
+                url:createURL("listVirtualMachines&details=stats&id=" + args.context.instances[0].id),
+                dataType: "json",	
+                async:true,
+                success:function(json) {
+                var jsonObj = json.listvirtualmachinesresponse.virtualmachine[0];
+               args.response.success({
                 data: {
                   totalCPU: jsonObj.cpunumber + " x " + cloudStack.converters.convertHz(jsonObj.cpuspeed),
                   cpuused: jsonObj.cpuused,
                   networkkbsread: (jsonObj.networkkbsread == null)? "N/A": cloudStack.converters.convertBytes(jsonObj.networkkbsread * 1024),
                   networkkbswrite: (jsonObj.networkkbswrite == null)? "N/A": cloudStack.converters.convertBytes(jsonObj.networkkbswrite * 1024)
-                }
-              });
+                  }
+                });
+              }
+             });
             }
           }
         }