cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [22/28] git commit: updated refs/heads/master to 35164fd
Date Mon, 13 May 2013 18:11:10 GMT
CLOUDSTACK-1816: Cisco VNMC ASA1000v - implement Delete VNMC Resource action.


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

Branch: refs/heads/master
Commit: ea4cb0e988bc09145cde9c5e6d62c84bb21e76da
Parents: b73156a
Author: Jessica Wang <jessicawang@apache.org>
Authored: Thu May 9 13:20:02 2013 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Thu May 9 13:20:02 2013 -0700

----------------------------------------------------------------------
 .../vnmcNetworkProvider/vnmcNetworkProvider.js     |  107 +++++++++------
 1 files changed, 67 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ea4cb0e9/ui/modules/vnmcNetworkProvider/vnmcNetworkProvider.js
----------------------------------------------------------------------
diff --git a/ui/modules/vnmcNetworkProvider/vnmcNetworkProvider.js b/ui/modules/vnmcNetworkProvider/vnmcNetworkProvider.js
index 82a5a3e..acd0056 100644
--- a/ui/modules/vnmcNetworkProvider/vnmcNetworkProvider.js
+++ b/ui/modules/vnmcNetworkProvider/vnmcNetworkProvider.js
@@ -195,10 +195,74 @@
             }
           }
         }
-      }
+      },
+      
+      detailView: {
+        name: 'CiscoVNMC resource details',
+        actions: {    
+          remove: {
+            label: 'delete CiscoVNMC resource',
+            messages: {
+              confirm: function(args) {
+                return 'Please confirm you want to delete CiscoVNMC resource';
+              },
+              notification: function(args) {
+                return 'delete CiscoVNMC resource';
+              }
+            },
+            action: function(args) {                               
+              $.ajax({
+                url: createURL('deleteCiscoVnmcResource'),
+                data: {
+                  resourceid: args.context.vnmcDevices[0].resourceid
+                },                   
+                success: function(json) {
+                  args.response.success();
+                },
+                error: function(data) {
+                  args.response.error(parseXMLHttpResponse(data));
+                }
+              });
+            },
+            notification: {
+              poll: function(args) {
+                args.complete();
+              }
+            }
+          }
+        },
+
+        tabs: {
+          details: {
+            title: 'label.details',            
+            fields: [
+             {
+               resourcename: { label: 'Resource Name' }
+             },
+             {   
+               resourceid: { label: 'Resource ID'},
+               provider: { label: 'Provider' },
+               RESOURCE_NAME: { label: 'Resource Name'}
+             }
+           ],
+           dataProvider: function(args) {   
+             $.ajax({
+               url: createURL('listCiscoVnmcResources'),
+               data: {
+                 resourceid: args.context.vnmcDevices[0].resourceid
+               },
+               success: function(json){                    
+                 var item = json.listCiscoVnmcResources.CiscoVnmcResource[0]; 
+                 args.response.success({ data: item });            
+               }
+             });   
+            }    
+          }
+        }
+      }       
     };
 
-    var vnmcProviderDetailView = vnmcListView.detailView = {
+    var vnmcProviderDetailView = {
       id: 'vnmcProvider',
       label: 'VNMC',
       viewAll: vnmcDeviceViewAll,
@@ -224,44 +288,7 @@
         }
       }
     };
-
-    var vnmcDeviceDetailView = {
-      tabs: {
-        details: {
-          title: 'label.details',
-          fields: [
-            {
-              resourcename: { label: 'Resource Name' }
-            },
-            {   
-              resourceid: { label: 'Resource ID'},
-              provider: { label: 'Provider' },
-              RESOURCE_NAME: { label: 'Resource Name'}
-            }
-          ],
-          dataProvider: function(args) {           
-            $.ajax({
-              url: createURL('listCiscoVnmcResources'),
-              data: {
-                resourceid: args.context.vnmcDevices[0].id
-              },
-              success: function(json){   
-                var item = json.listCiscoVnmcResources.CiscoVnmcResource[0]; 
-                args.response.success({
-                  data: item
-                });            
-              }
-            });  
-            
-            
-            args.response.success({
-              data: args.context.vnmcDevices[0]
-            });
-          }
-        }
-      }
-    };
-    
+   
     module.pluginAPI.extend({
       addDevice: function(device) {
         cloudStack.sections.system.subsections[device.id] = device;


Mime
View raw message