[Kimchi-devel] [PATCH v5 3/5] storagepool: rename and consolidate arguments of creating (front-end)

Zhou Zheng Sheng zhshzhou at linux.vnet.ibm.com
Thu Jan 2 09:58:14 UTC 2014


As we are adding support to new type of storage pool, the current naming
scheme of the storage pool creating arguments should be rearranged to be
more extendable. This patch renames some arguments and consolidates the
argument of the same purposes as follow.

nfsserver -> source.host
nfspath -> source.path
devices -> source.devices

This patch contains the front end changes of the consolidation work. It
just changes the formData transferred to kimchi backend, and leaves the
templates and other related scripts untouched.

v2 -> v5
  No changes

Signed-off-by: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
---
 ui/js/src/kimchi.storagepool_add_main.js | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/ui/js/src/kimchi.storagepool_add_main.js b/ui/js/src/kimchi.storagepool_add_main.js
index b31610a..a154933 100644
--- a/ui/js/src/kimchi.storagepool_add_main.js
+++ b/ui/js/src/kimchi.storagepool_add_main.js
@@ -148,14 +148,21 @@ kimchi.addPool = function(event) {
         if (poolType === 'dir') {
             formData.path = $('#pathId').val();
         } else if (poolType === 'logical') {
+            var source = {};
             if (!$.isArray(formData.devices)) {
                 var deviceObj = [];
                 deviceObj[0] =  formData.devices;
-                formData.devices = deviceObj;
+                source.devices = deviceObj;
+            } else {
+                source.devices = formData.devices;
             }
+            delete formData.devices;
+            formData.source = source;
         } else {
-            formData.nfspath = $('#nfspathId').val();
-            formData.nfsserver = $('#nfsserverId').val();
+            var source = {};
+            source.path = $('#nfspathId').val();
+            source.host = $('#nfsserverId').val();
+            formData.source = source;
         }
         if (poolType === 'logical') {
             var settings = {
-- 
1.7.11.7




More information about the Kimchi-devel mailing list