[PATCH V2] [Kimchi] Introducing Console for edit template module under virtualization

From: Rajat Gupta <rajgupta@linux.vnet.ibm.com> V2 : Corrected Indentation V1 : Introducing Console for edit template module under virtualization Note: This patch is dependent on following subjected patches 1.Introducing s390x UI Interfaces module for Edit Template under virtualization 2.Introducing s390x UI Interfaces module for Edit Guest under virtualization 3.Introducing s390x UI Storage module for Edit Template under virtualization 4.Introducing s390x UI Storage module for Edit Guest under virtualization Signed-off-by: Rajat Gupta <rajgupta@linux.vnet.ibm.com> --- ui/js/src/kimchi.template_edit_main.js | 13 ++++++++++++- ui/pages/template-edit.html.tmpl | 10 ++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/ui/js/src/kimchi.template_edit_main.js b/ui/js/src/kimchi.template_edit_main.js index a2032cc..466ae70 100644 --- a/ui/js/src/kimchi.template_edit_main.js +++ b/ui/js/src/kimchi.template_edit_main.js @@ -62,6 +62,12 @@ kimchi.template_edit_main = function() { } $('input[name="' + prop + '"]', templateEditMain).val(value); } + if(kimchi.hostarch == s390xArch){ + $('.console', templateEditMain).show(); + var consoleData = template.console ? template.console : ''; + $('#template-edit-console', templateEditMain).val(consoleData); + $('#template-edit-console').selectpicker(); + } $('#template-edit-memory-textbox').val(template.memory.current); $('#template-edit-max-memory-textbox').val(template.memory.maxmemory); @@ -356,7 +362,12 @@ kimchi.template_edit_main = function() { $('.modal input[type="checkbox"]').prop('disabled', true); $('.modal select').prop('disabled', true); $('.modal .selectpicker').addClass('disabled'); - var editableFields = ['name', 'memory', 'graphics', 'max-memory']; + if(kimchi.hostarch === s390xArch){ + var editableFields = ['name', 'memory', 'graphics', 'max-memory', 'console']; + }else { + var editableFields = ['name', 'memory', 'graphics', 'max-memory']; + } + var data = {}; var disks = $('.template-tab-body .item', '#form-template-storage'); var disksForUpdate = new Array(); diff --git a/ui/pages/template-edit.html.tmpl b/ui/pages/template-edit.html.tmpl index 6cac885..14f6cfa 100644 --- a/ui/pages/template-edit.html.tmpl +++ b/ui/pages/template-edit.html.tmpl @@ -73,6 +73,9 @@ <div class="template-edit-wrapper-label"> <label>$_("Graphics")</label> </div> + <div class="template-edit-wrapper-label console" style="display:none"> + <label>$_("Console")</label> + </div> </div> <div class="form-template-inline-wrapper"> <div class="template-edit-wrapper-controls"> @@ -104,6 +107,13 @@ <div class="template-edit-wrapper-controls"> <select id="template-edit-graphics" name="graphics" class="form-control" /> </div> + <div class="template-edit-wrapper-controls console" style="display:none"> + <select id="template-edit-console" name="console" class="form-control"> + <option value=""></option> + <option value="sclp">$_("sclp")</option> + <option value="virtio">$_("virtio")</option> + </select> + </div> </div> </form> </div> -- 2.1.0
participants (2)
-
Aline Manera
-
rajgupta@linux.vnet.ibm.com