From 109490c4064a8cd30fad3d627d78172b342e0d08 Mon Sep 17 00:00:00 2001 From: Pranav Saxena Date: Wed, 25 Jul 2012 03:11:30 +0530 Subject: [PATCH] TAGS feature implementation throughout CloudStack UI --- ui/scripts/instances.js | 2 ++ ui/scripts/network.js | 9 +++++++++ ui/scripts/storage.js | 5 +++++ ui/scripts/templates.js | 12 +++++++++--- 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js index 4b17c4ce285..04b83398ec4 100644 --- a/ui/scripts/instances.js +++ b/ui/scripts/instances.js @@ -1147,6 +1147,8 @@ id: { label: 'label.id' } } ], + + tags: cloudStack.api.tags({ resourceType: 'UserVm', contextId: 'instances' }), dataProvider: function(args) { $.ajax({ diff --git a/ui/scripts/network.js b/ui/scripts/network.js index ed122194b36..9ab049f8670 100644 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -814,6 +814,10 @@ } } ], + + tags: cloudStack.api.tags({ resourceType: 'Network', contextId: 'networks' }), + + dataProvider: function(args) { $.ajax({ url: createURL("listNetworks&id=" + args.context.networks[0].id + "&listAll=true"), //pass "&listAll=true" to "listNetworks&id=xxxxxxxx" for now before API gets fixed. @@ -1616,6 +1620,8 @@ vlanname: { label: 'label.vlan' } } ], + + tags: cloudStack.api.tags({ resourceType: 'PublicIpAddress', contextId: 'ipAddresses' }), dataProvider: function(args) { var items = args.context.ipAddresses; @@ -3039,6 +3045,9 @@ } ], + tags: cloudStack.api.tags({ resourceType: 'SecurityGroup', contextId: 'securityGroups' }), + + dataProvider: function(args) { $.ajax({ url: createURL("listSecurityGroups&id="+args.id), diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js index a51c815f4ae..ce85087bd7c 100644 --- a/ui/scripts/storage.js +++ b/ui/scripts/storage.js @@ -1000,6 +1000,9 @@ } ], + tags: cloudStack.api.tags({ resourceType: 'Volume', contextId: 'volumes' }), + + dataProvider: function(args) { $.ajax({ url: createURL("listVolumes&id=" + args.context.volumes[0].id), @@ -1265,6 +1268,8 @@ } ], + tags: cloudStack.api.tags({ resourceType: 'Snapshot', contextId: 'snapshots' }), + dataProvider: function(args) { $.ajax({ url: createURL("listSnapshots&id=" + args.context.snapshots[0].id), diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js index 5a13af9fc6f..34ac2a53b54 100644 --- a/ui/scripts/templates.js +++ b/ui/scripts/templates.js @@ -674,9 +674,12 @@ account: { label: 'label.account' }, created: { label: 'label.created', converter: cloudStack.converters.toLocalDate } } - ], + ], + + tags: cloudStack.api.tags({ resourceType: 'Template', contextId: 'templates' }), + - dataProvider: function(args) { + dataProvider: function(args) { var jsonObj = args.context.templates[0]; var apiCmd = "listTemplates&templatefilter=self&id=" + jsonObj.id; if(jsonObj.zoneid != null) @@ -818,6 +821,7 @@ } } }, + action: function(args) { var array1 = []; @@ -1188,8 +1192,10 @@ created: { label: 'label.created', converter: cloudStack.converters.toLocalDate } } ], + + tags: cloudStack.api.tags({ resourceType: 'ISO', contextId: 'isos' }), - dataProvider: function(args) { + dataProvider: function(args) { var jsonObj = args.context.isos[0]; var apiCmd = "listIsos&isofilter=self&id="+jsonObj.id; if(jsonObj.zoneid != null)