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/ui-cisco-asa1000v-support to b1f6d89
Date Thu, 09 May 2013 22:32:39 GMT
Updated Branches:
  refs/heads/ui-cisco-asa1000v-support 04be0cdec -> b1f6d8914


CLOUDSTACK-1816: Cisco VNMC ASA1000v - UI - Infrastructure menu - network service providers
- populate provider detailView.


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

Branch: refs/heads/ui-cisco-asa1000v-support
Commit: b1f6d8914154114fe5c70618a7618d9dd0419df0
Parents: 04be0cd
Author: Jessica Wang <jessicawang@apache.org>
Authored: Thu May 9 15:31:25 2013 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Thu May 9 15:31:25 2013 -0700

----------------------------------------------------------------------
 ui/modules/infrastructure/infrastructure.js        |   23 ++++++++++-
 .../vnmcNetworkProvider/vnmcNetworkProvider.js     |   30 +++++++++++----
 ui/scripts/system.js                               |    3 +-
 3 files changed, 44 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b1f6d891/ui/modules/infrastructure/infrastructure.js
----------------------------------------------------------------------
diff --git a/ui/modules/infrastructure/infrastructure.js b/ui/modules/infrastructure/infrastructure.js
index dae797e..4111aa5 100644
--- a/ui/modules/infrastructure/infrastructure.js
+++ b/ui/modules/infrastructure/infrastructure.js
@@ -33,12 +33,29 @@
 
         $(window).bind('cloudStack.system.serviceProviders.makeHarcodedArray', function(event,
data) {
           var nspHardcodingArray = data.nspHardcodingArray;
-          var selectedZoneObj = data.selectedZoneObj;          
-          if(selectedZoneObj.networktype == "Advanced"){
+          var selectedZoneObj = data.selectedZoneObj;   
+          var selectedPhysicalNetworkObj = data.selectedPhysicalNetworkObj;
+          if(selectedZoneObj.networktype == "Advanced"){      
+            var selectedProviderObj = {};
+            $.ajax({
+              url: createURL('listNetworkServiceProviders'),
+              data: {
+                name: id, //e.g. 'CiscoVnmc'
+                physicalnetworkid: selectedPhysicalNetworkObj.id      
+              },
+              async: false,
+              success: function(json){  
+                var items = json.listnetworkserviceprovidersresponse.networkserviceprovider;
+                if(items != null && items.length > 0) {
+                  selectedProviderObj = items[0];
+                }
+              }
+            });
+           
             nspHardcodingArray.push({
               id: id,
               name: name,
-              state: state
+              state: selectedProviderObj.state
             });
           } 
         });

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b1f6d891/ui/modules/vnmcNetworkProvider/vnmcNetworkProvider.js
----------------------------------------------------------------------
diff --git a/ui/modules/vnmcNetworkProvider/vnmcNetworkProvider.js b/ui/modules/vnmcNetworkProvider/vnmcNetworkProvider.js
index acd0056..cecf56c 100644
--- a/ui/modules/vnmcNetworkProvider/vnmcNetworkProvider.js
+++ b/ui/modules/vnmcNetworkProvider/vnmcNetworkProvider.js
@@ -274,16 +274,30 @@
               name: { label: 'label.name' }
             },
             {
-              state: { label: 'label.state' }
+              state: { label: 'label.state' }, 
+              id: { label: 'label.id' },
+              servicelist: {
+                label: 'Services',
+                converter: function(args){                  
+                  return args.join(', ');
+                }
+              }
             }
           ],
-          dataProvider: function(args) {
-            args.response.success({
+          dataProvider: function(args) {            
+            $.ajax({
+              url: createURL('listNetworkServiceProviders'),
               data: {
-                name: 'VNMC Devices',
-                state: 'Disabled'
+                name: 'CiscoVnmc',
+                physicalnetworkid: args.context.physicalNetworks[0].id   
+              },              
+              success: function(json){                  
+                var items = json.listnetworkserviceprovidersresponse.networkserviceprovider;
+                if(items != null && items.length > 0) {   
+                  args.response.success({ data: items[0] });                  
+                }
               }
-            });
+            });                 
           }
         }
       }
@@ -297,9 +311,9 @@
     });
     
     module.infrastructure.networkServiceProvider({
-      id: 'vnmc',
+      id: 'CiscoVnmc',
       name: 'Cisco VNMC',
-      state: 'Disabled',
+      //state: 'Disabled', //don't know state until log in and visit Infrastructure menu
> zone detail > physical network > network service providers
       listView: vnmcListView,
 
       detailView: vnmcProviderDetailView

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b1f6d891/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 81fda3a..0164e21 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -12145,7 +12145,8 @@
 
     $(window).trigger('cloudStack.system.serviceProviders.makeHarcodedArray', {
       nspHardcodingArray: nspHardcodingArray,
-      selectedZoneObj: selectedZoneObj
+      selectedZoneObj: selectedZoneObj,
+      selectedPhysicalNetworkObj: selectedPhysicalNetworkObj
     });
 
 		if(selectedZoneObj.networktype == "Basic") {


Mime
View raw message