[Kimchi-devel] [PATCH 2/3] Delete 'bus' selection from UI

lvroyce at linux.vnet.ibm.com lvroyce at linux.vnet.ibm.com
Fri Aug 1 08:19:26 UTC 2014


From: Royce Lv <lvroyce at linux.vnet.ibm.com>

Do not expose 'bus' selection in UI and let kimchi choose for them.

Signed-off-by: Royce Lv <lvroyce at linux.vnet.ibm.com>
---
 ui/js/src/kimchi.guest_storage_add.main.js | 28 ----------------------------
 ui/pages/guest-storage-add.html.tmpl       | 13 -------------
 2 files changed, 41 deletions(-)

diff --git a/ui/js/src/kimchi.guest_storage_add.main.js b/ui/js/src/kimchi.guest_storage_add.main.js
index 753b070..17cb991 100644
--- a/ui/js/src/kimchi.guest_storage_add.main.js
+++ b/ui/js/src/kimchi.guest_storage_add.main.js
@@ -19,21 +19,17 @@ kimchi.guest_storage_add_main = function() {
     var types = [{
         label: 'cdrom',
         value: 'cdrom',
-        bus: ['ide']
     },
     {
         label: 'disk',
         value: 'disk',
-        bus: ['virtio', 'ide']
     }];
     kimchi.select('guest-storage-type-list', types);
-    kimchi.select('guest-storage-bus-list', [{label: 'ide', value: 'ide'}]);
 
     var storageAddForm = $('#form-guest-storage-add');
     var submitButton = $('#guest-storage-button-add');
     var nameTextbox = $('input[name="dev"]', storageAddForm);
     var typeTextbox = $('input[name="type"]', storageAddForm);
-    var busTextbox = $('input[name="bus"]', storageAddForm);
     var pathTextbox = $('input[name="path"]', storageAddForm);
     var poolTextbox = $('input[name="pool"]', storageAddForm);
     var volTextbox = $('input[name="vol"]', storageAddForm);
@@ -59,18 +55,6 @@ kimchi.guest_storage_add_main = function() {
             $(poolTextbox).val("");
             $(volTextbox).val("");
         }
-
-        $.each(types, function(index, elem){
-            if (selectType == elem.value) {
-                var buses = new Array();
-                $.each(elem.bus, function (index, elem) {
-                    buses[index] = {label: elem, value: elem};
-                });
-                $('#guest-storage-bus').selectMenu("setData", buses);
-                $('#guest-storage-bus-label').text(buses[0].value);
-                $('#guest-storage-bus-type').val(buses[0].value);
-            }
-        });
     });
 
     kimchi.listStoragePools(function(result) {
@@ -122,17 +106,6 @@ kimchi.guest_storage_add_main = function() {
                 $(value).addClass('hidden');
             }
         });
-
-        $.each(types, function(index, elem){
-            if (selectType == elem.value) {
-                var buses = new Array();
-                $.each(elem.bus, function (index, elem) {
-                    buses[index] = {label: elem, value: elem};
-                });
-                $('#guest-storage-bus').selectMenu("setData", buses);
-                $('#guest-storage-bus-label').text(buses[0].value);
-            }
-        });
     });
 
     var validateCDROM = function(settings) {
@@ -163,7 +136,6 @@ kimchi.guest_storage_add_main = function() {
         var settings = {
             vm: kimchi.selectedGuest,
             type: typeTextbox.val(),
-            bus: busTextbox.val()
         };
 
         $(submitButton).prop('disabled', true);
diff --git a/ui/pages/guest-storage-add.html.tmpl b/ui/pages/guest-storage-add.html.tmpl
index 6574dcf..08bcd88 100644
--- a/ui/pages/guest-storage-add.html.tmpl
+++ b/ui/pages/guest-storage-add.html.tmpl
@@ -53,19 +53,6 @@
                     </div>
                 </div>
             </section>
-            <section class="form-section">
-                <h2>3. $_("Device Bus")</h2>
-                <div class="field">
-                    <div class="btn dropdown popable" id="guest-storage-bus">
-                        <input id="guest-storage-bus-type" name="bus" value='ide' type="hidden" />
-                        <span class="text" id="guest-storage-bus-label"></span>
-                        <span class="arrow"></span>
-                        <div class="popover">
-                            <ul class="select-list" id="guest-storage-bus-list" data-target="guest-storage-bus-type" data-label="guest-storage-bus-label"></ul>
-                        </div>
-                    </div>
-                </div>
-            </section>
             <div class="volume-section hidden">
                 <section class="form-section">
                     <h2>4. $_("Storage Pool")</h2>
-- 
1.8.3.2




More information about the Kimchi-devel mailing list