[Kimchi-devel] [PATCH v4 3/5] storagepool: rename and consolidate arguments of creating (front end)
Sheldon
shaohef at linux.vnet.ibm.com
Tue Dec 31 15:00:28 UTC 2013
Reviewed-by: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
On 12/31/2013 02:39 PM, Zhou Zheng Sheng wrote:
> 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 -> v3
> no change
>
> 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 = {
--
Thanks and best regards!
Sheldon Feng(冯少合)<shaohef at linux.vnet.ibm.com>
IBM Linux Technology Center
More information about the Kimchi-devel
mailing list