[Kimchi-devel] [PATCH] Bug 440 Fix

huoyuxin at linux.vnet.ibm.com huoyuxin at linux.vnet.ibm.com
Mon Sep 22 07:14:21 UTC 2014


From: Yu Xin Huo <huoyuxin at linux.vnet.ibm.com>

2 Issues:
1. In menu widget, it handle the passin params incorrectly.
2. Filter out storage pools without any available volume.

Signed-off-by: Yu Xin Huo <huoyuxin at linux.vnet.ibm.com>
---
 ui/js/src/kimchi.guest_storage_add.main.js |    2 +-
 ui/js/widgets/select-menu.js               |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/ui/js/src/kimchi.guest_storage_add.main.js b/ui/js/src/kimchi.guest_storage_add.main.js
index a8c5acb..6e01d3e 100644
--- a/ui/js/src/kimchi.guest_storage_add.main.js
+++ b/ui/js/src/kimchi.guest_storage_add.main.js
@@ -61,7 +61,7 @@ kimchi.guest_storage_add_main = function() {
         var options = [];
         if (result && result.length) {
             $.each(result, function(index, storagePool) {
-                if ((storagePool.state=="active") && (storagePool.type !== 'kimchi-iso')) {
+                if ((storagePool.state=="active") && (storagePool.type !== 'kimchi-iso') && storagePool.nr_volumes) {
                     options.push({
                         label: storagePool.name,
                         value: storagePool.name
diff --git a/ui/js/widgets/select-menu.js b/ui/js/widgets/select-menu.js
index ad53200..c4b0209 100644
--- a/ui/js/widgets/select-menu.js
+++ b/ui/js/widgets/select-menu.js
@@ -36,8 +36,10 @@
             var selectedClass = 'active';
             var itemTag = 'li';
             var item;
+            that.listControl.find('li').remove();
+            that.label.text("");
+            that.target.val("");
             if (options.length > 0) {
-                that.listControl.find('li').remove();
                 $.each(options, function(index, option) {
                     item = $('<' + itemTag + '>' + option.label +'</' + itemTag + '>');
                     item.data('value', option.value);
@@ -58,8 +60,6 @@
                         that.target.change();
                     }
                 });
-            } else {
-                kimchi.message.error.code('KCHAPI6006E');
             }
         },
 
-- 
1.7.1




More information about the Kimchi-devel mailing list