incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject [1/44] git commit: refs/heads/marvin-refactor - Add new dropdowns to primary storage form
Date Mon, 04 Mar 2013 13:43:01 GMT
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/marvin-refactor
Commit: d0d6ba9781aa9328ccb621d0f15d07cd894d7a03
Parents: 18e496b
Author: Brian Federle <brian.federle@citrix.com>
Authored: Thu Feb 21 12:23:27 2013 -0800
Committer: Brian Federle <brian.federle@citrix.com>
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',


Mime
View raw message