Add new dropdowns to primary storage form Adds the following new fields, to support targeted storage pool:
-Scope drop-down (zone/cluster/host) -Host list drop-down Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/d0d6ba97 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/d0d6ba97 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/d0d6ba97 Branch: refs/heads/master Commit: d0d6ba9781aa9328ccb621d0f15d07cd894d7a03 Parents: 18e496b Author: Brian Federle <[email protected]> Authored: Thu Feb 21 12:23:27 2013 -0800 Committer: Brian Federle <[email protected]> Committed: Thu Feb 21 12:23:27 2013 -0800 ---------------------------------------------------------------------- ui/scripts/system.js | 37 +++++++++++++++++++++++++++++++++++++ 1 files changed, 37 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d0d6ba97/ui/scripts/system.js ---------------------------------------------------------------------- diff --git a/ui/scripts/system.js b/ui/scripts/system.js index e51bf90..3c52442 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -8695,6 +8695,20 @@ createForm: { title: 'label.add.primary.storage', fields: { + scope: { + label: 'label.scope', + select: function(args) { + var scope = [ + { id: 'zone-wide', description: _l('label.zone.wide') }, + { id: 'cluster', description: _l('label.cluster') }, + { id: 'host', description: _l('label.host') } + ]; + + args.response.success({ + data: scope + }); + } + }, zoneid: { label: 'Zone', docID: 'helpPrimaryStorageZone', @@ -8768,6 +8782,29 @@ } }, + hostId: { + label: 'label.host', + validation: { required: true }, + dependsOn: 'clusterId', + select: function(args) { + $.ajax({ + url: createURL('listHosts'), + data: { + clusterid: args.clusterId + }, + success: function(json) { + var hosts = json.listhostsresponse.host ? + json.listhostsresponse.host : [] + args.response.success({ + data: $.map(hosts, function(host) { + return { id: host.id, description: host.name } + }) + }); + } + }); + } + }, + name: { label: 'label.name', docID: 'helpPrimaryStorageName',
