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.
---
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