You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ki...@apache.org on 2012/10/17 10:50:11 UTC
[8/50] [abbrv] git commit: cloudstack UI - advanced search - instance
page - add name field, zone dropdown, tag key field, tag value field.
cloudstack UI - advanced search - instance page - add name field, zone dropdown, tag key field, tag value field.
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/92864aa0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/92864aa0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/92864aa0
Branch: refs/heads/regions
Commit: 92864aa023e217ef09ae0f30dc2661f7dea6c9e8
Parents: 56496a2
Author: Jessica Wang <je...@citrix.com>
Authored: Tue Oct 2 16:46:51 2012 -0700
Committer: Jessica Wang <je...@citrix.com>
Committed: Tue Oct 2 16:47:55 2012 -0700
----------------------------------------------------------------------
ui/scripts/instances.js | 29 +++++++++++++++++++++++++++++
ui/scripts/ui/widgets/listView.js | 4 ++--
2 files changed, 31 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/92864aa0/ui/scripts/instances.js
----------------------------------------------------------------------
diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js
index 6eb18eb..725c1b3 100644
--- a/ui/scripts/instances.js
+++ b/ui/scripts/instances.js
@@ -56,7 +56,36 @@
}
}
},
+
+ advSearchFields: {
+ name: { label: 'Name' },
+ zoneid: {
+ label: 'Zone',
+ select: function(args) {
+ $.ajax({
+ url: createURL('listZones'),
+ data: {
+ listAll: true
+ },
+ success: function(json) {
+ var zones = json.listzonesresponse.zone;
+ args.response.success({
+ data: $.map(zones, function(zone) {
+ return {
+ id: zone.id,
+ description: zone.name
+ };
+ })
+ });
+ }
+ });
+ }
+ },
+ tagKey: { label: 'Tag Key' },
+ tagValue: { label: 'Tag Value' }
+ },
+
// List view actions
actions: {
// Add instance wizard
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/92864aa0/ui/scripts/ui/widgets/listView.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/listView.js b/ui/scripts/ui/widgets/listView.js
index 111a799..d341d55 100644
--- a/ui/scripts/ui/widgets/listView.js
+++ b/ui/scripts/ui/widgets/listView.js
@@ -675,10 +675,10 @@
var $searchBar = $('<div></div>').addClass('search-bar reduced hide').appendTo($search);
$searchBar.append('<input type="text" />');
$search.append('<div id="basic_search" class="button search"></div>');
- /*
+
if(listViewData.advSearchFields != null)
$search.append('<div id="advanced_search" class="button search"></div>');
- */
+
return $search.appendTo($toolbar);
};