[Kimchi-devel] [PATCH] [Kimchi] For s390x hide VNC, PCI, Snapshot, Graphics and clone options

rajgupta at linux.vnet.ibm.com rajgupta at linux.vnet.ibm.com
Tue Sep 27 05:32:01 UTC 2016


From: Rajat Gupta <rajgupta at linux.vnet.ibm.com>

For s390x hide VNC, PCI, Snapshot, Graphics and clone options

Signed-off-by: Rajat Gupta <rajgupta at linux.vnet.ibm.com>
---
 ui/js/src/kimchi.guest_edit_main.js    | 4 ++++
 ui/js/src/kimchi.guest_main.js         | 8 ++++++++
 ui/js/src/kimchi.template_edit_main.js | 1 +
 ui/pages/template-edit.html.tmpl       | 4 ++--
 4 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/ui/js/src/kimchi.guest_edit_main.js b/ui/js/src/kimchi.guest_edit_main.js
index c3609c2..9669d08 100644
--- a/ui/js/src/kimchi.guest_edit_main.js
+++ b/ui/js/src/kimchi.guest_edit_main.js
@@ -1207,4 +1207,8 @@ kimchi.guest_edit_main = function() {
             }
         }
     };
+
+    if(kimchi.hostarch === s390xArch){
+        $('#guest-edit-window ul li a[data-id="form-guest-edit-pci"],a[data-id="form-guest-edit-snapshot"]').parent().hide();
+    }
 };
diff --git a/ui/js/src/kimchi.guest_main.js b/ui/js/src/kimchi.guest_main.js
index 34217e4..f1be019 100644
--- a/ui/js/src/kimchi.guest_main.js
+++ b/ui/js/src/kimchi.guest_main.js
@@ -20,6 +20,9 @@
 var guestFilterList;
 var listFiltered;
 
+//init s390x Architecture
+var s390xArch = 's390x';
+
 kimchi.sampleGuestObject = {
     "name": "",
     "uuid": "",
@@ -897,6 +900,11 @@ kimchi.listVmsAuto = function() {
                         }
                         $('#guests-root-container > .wok-mask').fadeOut(300, function() {
                         });
+                        //check if Architecture is s390x and hide VNC column
+                        if(kimchi.hostarch === s390xArch){
+                            $('#guests-root-container span.column-vnc').addClass('hidden');
+                            $('#guestList a[name="vm-clone"]').hide();
+                        }
                     } else {
                         $('.grid-control').addClass('hidden');
                         $('#guestListField').hide();
diff --git a/ui/js/src/kimchi.template_edit_main.js b/ui/js/src/kimchi.template_edit_main.js
index 7d7cce3..b1f5123 100644
--- a/ui/js/src/kimchi.template_edit_main.js
+++ b/ui/js/src/kimchi.template_edit_main.js
@@ -69,6 +69,7 @@ kimchi.template_edit_main = function() {
             $('input[name="' + prop + '"]', templateEditMain).val(value);
         }
         if(kimchi.hostarch == s390xArch){
+            $('.graphics', templateEditMain).hide();
             $('.console', templateEditMain).show();
             var consoleData = template.console ? template.console : '';
             $('#template-edit-console', templateEditMain).val(consoleData);
diff --git a/ui/pages/template-edit.html.tmpl b/ui/pages/template-edit.html.tmpl
index 9ccc664..10532be 100644
--- a/ui/pages/template-edit.html.tmpl
+++ b/ui/pages/template-edit.html.tmpl
@@ -70,7 +70,7 @@
                             <div class="template-edit-wrapper-label templ-edit-vm-image hide">
                                 <label for="template-edit-vmimage-textbox">$_("Image File")</label>
                             </div>
-                            <div class="template-edit-wrapper-label">
+                            <div class="template-edit-wrapper-label graphics">
                                 <label>$_("Graphics")</label>
                             </div>
                             <div class="template-edit-wrapper-label console" style="display:none">
@@ -104,7 +104,7 @@
                                 <input id="template-edit-vmimage-textbox"  class="form-control" name="vm-image" type="text" disabled="disabled" />
                                 <span class="fa fa-times form-control-feedback"></span>
                             </div>
-                            <div class="template-edit-wrapper-controls">
+                            <div class="template-edit-wrapper-controls graphics">
                                     <select id="template-edit-graphics" name="graphics" class="form-control"  />
                             </div>
                             <div class="template-edit-wrapper-controls console" style="display:none">
-- 
2.1.0




More information about the Kimchi-devel mailing list