This specific field adds very little to the user experience in
comparison with the effort required to mantain it. This patch
removes it from the UI, making the "Add a Storage Device to VM"
window simpler.
Backend support of specifying dev name is left as is because
it can be helpful in testing/debugging.
Signed-off-by: Daniel Henrique Barboza <danielhb(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.guest_storage_add.main.js | 7 +++----
ui/pages/guest-storage-add.html.tmpl | 17 ++++-------------
2 files changed, 7 insertions(+), 17 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..54ae748 100644
--- a/ui/js/src/kimchi.guest_storage_add.main.js
+++ b/ui/js/src/kimchi.guest_storage_add.main.js
@@ -28,7 +28,6 @@ kimchi.guest_storage_add_main = function() {
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 pathTextbox = $('input[name="path"]', storageAddForm);
var poolTextbox = $('input[name="pool"]', storageAddForm);
@@ -139,7 +138,7 @@ kimchi.guest_storage_add_main = function() {
};
$(submitButton).prop('disabled', true);
- $.each([nameTextbox, pathTextbox, poolTextbox, volTextbox], function(i, c) {
+ $.each([pathTextbox, poolTextbox, volTextbox], function(i, c) {
$(c).prop('disabled', true);
val = $(c).val()
if (val && val != '') {
@@ -150,7 +149,7 @@ kimchi.guest_storage_add_main = function() {
validateSpecifiedForm = validator[settings['type']];
if (!validateSpecifiedForm(settings)) {
$(submitButton).prop('disabled', false);
- $.each([submitButton, nameTextbox, pathTextbox, poolTextbox, volTextbox],
function(i, c) {
+ $.each([submitButton, pathTextbox, poolTextbox, volTextbox], function(i, c)
{
$(c).prop('disabled', false);
});
return false;
@@ -167,7 +166,7 @@ kimchi.guest_storage_add_main = function() {
result['responseJSON']['reason'];
kimchi.message.error(errText);
- $.each([submitButton, nameTextbox, pathTextbox, poolTextbox, volTextbox],
function(i, c) {
+ $.each([submitButton, pathTextbox, poolTextbox, volTextbox], function(i, c)
{
$(c).prop('disabled', false);
});
$(submitButton).removeClass('loading').text(i18n['KCHVMCD6002M']);
diff --git a/ui/pages/guest-storage-add.html.tmpl b/ui/pages/guest-storage-add.html.tmpl
index ca064fc..c991f42 100644
--- a/ui/pages/guest-storage-add.html.tmpl
+++ b/ui/pages/guest-storage-add.html.tmpl
@@ -29,16 +29,7 @@
<div class="content">
<form id="form-guest-storage-add">
<section class="form-section">
- <h2>1. $_("Device Name")</h2>
- <div class="field">
- <p class="text-help">
- $_("The name used to identify the device. If omitted, a name
will be chosen automatically.")
- </p>
- <input type="text" class="text"
name="dev" />
- </div>
- </section>
- <section class="form-section">
- <h2>2. $_("Device Type")</h2>
+ <h2>1. $_("Device Type")</h2>
<div class="field">
<p class="text-help">
$_("The device type. Currently, \"cdrom\" and
\"disk\" are supported.")
@@ -55,7 +46,7 @@
</section>
<div class="volume-section hidden">
<section class="form-section">
- <h2>4. $_("Storage Pool")</h2>
+ <h2>2. $_("Storage Pool")</h2>
<div class="field storage-field">
<p class="text-help">
$_("Storage pool which volume located in")
@@ -70,7 +61,7 @@
</div>
</section>
<section class="form-section">
- <h2>5. $_("Storage Volume")</h2>
+ <h2>3. $_("Storage Volume")</h2>
<div class="field storage-field">
<p class="text-help">
$_("Storage volume to be attached")
@@ -87,7 +78,7 @@
</div>
<div class="path-section">
<section class="form-section">
- <h2>4. $_("File Path")</h2>
+ <h2>2. $_("File Path")</h2>
<div class="field">
<p class="text-help">
$_("The ISO file path in the server for CDROM.")
--
1.8.3.1