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 99f0cdd
Date Wed, 08 May 2013 21:50:57 GMT
Updated Branches:
  refs/heads/ui-cisco-asa1000v-support 6323b2e71 -> 99f0cdd0d


CLOUDSTACK-1816: Cisco VNMC ASA1000v - UI - implement Add CiscoASA1000v action.


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

Branch: refs/heads/ui-cisco-asa1000v-support
Commit: 99f0cdd0d9d8de8f82d8f7ce12f98bce2a8915d8
Parents: 6323b2e
Author: Jessica Wang <jessicawang@apache.org>
Authored: Wed May 8 14:50:15 2013 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Wed May 8 14:50:15 2013 -0700

----------------------------------------------------------------------
 ui/modules/vnmcAsa1000v/vnmcAsa1000v.js            |  103 ++++++++++++--
 .../vnmcNetworkProvider/vnmcNetworkProvider.js     |    7 +-
 2 files changed, 89 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/99f0cdd0/ui/modules/vnmcAsa1000v/vnmcAsa1000v.js
----------------------------------------------------------------------
diff --git a/ui/modules/vnmcAsa1000v/vnmcAsa1000v.js b/ui/modules/vnmcAsa1000v/vnmcAsa1000v.js
index 10fe3ef..3b92d2d 100644
--- a/ui/modules/vnmcAsa1000v/vnmcAsa1000v.js
+++ b/ui/modules/vnmcAsa1000v/vnmcAsa1000v.js
@@ -22,22 +22,95 @@
       listView: {
         id: 'asa1000vDevices',
         fields: {
-          name: { label: 'label.name' },
-          ipaddress: { label: 'label.ip.address' },
-          state: { label: 'label.state', indicator: {
-            'Enabled': 'on',
-            'Disabled': 'off'
-          }}
+          hostname: { label: 'label.host' },
+          insideportprofile: { label: 'Inside Port Profile' }
         },
-        dataProvider: function(args) {
-          args.response.success({
-            data: [
-              { name: 'asadevice1', ipaddress: '192.168.1.12', state: 'Enabled' },
-              { name: 'asadevice2', ipaddress: '192.168.1.13', state: 'Disabled' },
-              { name: 'asadevice3', ipaddress: '192.168.1.14', state: 'Enabled' }
-            ]
-          });
-        }
+        dataProvider: function(args) {          
+          $.ajax({
+            url: createURL('listCiscoAsa1000vResources'),
+            data: {
+              physicalnetworkid: args.context.physicalNetworks[0].id
+            },
+            success: function(json){   
+              var items = json.listCiscoAsa1000vResources["null"]; //waiting for Koushik
to fix object name to be "CiscoAsa1000vResource" instead of "null"
+              //var items = json.listCiscoAsa1000vResources.CiscoAsa1000vResource;   
+              args.response.success({ data: items });            
+            }
+          }); 
+        },
+        
+        actions: {
+          add: {
+            label: 'Add CiscoASA1000v',
+            messages: {             
+              notification: function(args) {
+                return 'Add CiscoASA1000v';
+              }
+            },
+            createForm: {
+              title: 'Add CiscoASA1000v',
+              fields: {
+                hostname: {
+                  label: 'label.host',                
+                  validation: { required: true }
+                },
+                insideportprofile: {
+                  label: 'Inside Port Profile',                
+                  validation: { required: true },
+                  defaultValue: 'in-asa'
+                },
+                clusterid: {
+                  label: 'label.cluster',                   
+                  validation: { required: true },
+                  select: function(args){                    
+                    $.ajax({
+                      url: createURL('listClusters'),
+                      data: {
+                        zoneid: args.context.zones[0].id
+                      },                      
+                      success: function(json) {                        
+                        var objs = json.listclustersresponse.cluster;
+                        var items = [];
+                        if(objs != null) {
+                          for(var i = 0; i < objs.length; i++){
+                            items.push({id: objs[i].id, description: objs[i].name});
+                          }
+                        }     
+                        args.response.success({data: items});
+                      }
+                    });
+                  }
+                }            
+              }
+            },
+            action: function(args) {              
+              var data = {
+                physicalnetworkid: args.context.physicalNetworks[0].id,
+                hostname: args.data.hostname,
+                insideportprofile: args.data.insideportprofile,
+                clusterid: args.data.clusterid
+              };
+              
+              $.ajax({
+                url: createURL('addCiscoAsa1000vResource'),
+                data: data,
+                success: function(json){
+                  var item = json.addCiscoAsa1000vResource.CiscoAsa1000vResource;
+                  args.response.success({data: item});
+                },
+                error: function(data) {
+                  args.response.error(parseXMLHttpResponse(data));
+                }               
+              });
+              
+            },            
+            notification: {
+              poll: function(args) {
+                args.complete();
+              }
+            }
+          }
+        }        
       }
     });
   };

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/99f0cdd0/ui/modules/vnmcNetworkProvider/vnmcNetworkProvider.js
----------------------------------------------------------------------
diff --git a/ui/modules/vnmcNetworkProvider/vnmcNetworkProvider.js b/ui/modules/vnmcNetworkProvider/vnmcNetworkProvider.js
index 220a0b9..135cefa 100644
--- a/ui/modules/vnmcNetworkProvider/vnmcNetworkProvider.js
+++ b/ui/modules/vnmcNetworkProvider/vnmcNetworkProvider.js
@@ -38,12 +38,7 @@
         add: {
           label: 'Add VNMC device',
 
-          messages: {
-            /*
-            confirm: function(args) {
-              return 'Add VNMC device';
-            },
-            */
+          messages: {           
             notification: function(args) {
               return 'Add VNMC device';
             }


Mime
View raw message