On 09/19/2014 06:53 AM, Wen Wang wrote:
From: Wen Wang <wenwang(a)linux.vnet.ibm.com>
V1 -> V2:
Considering iSCSI and SCSI situation that we need to have the input box
disabled when choosing iSCSI and SCSI for storage pool and enable when
choosing others.
This patch fix the bug that value of "Disk(GB)" input box is changing
with the item of "Storage Pool" in "Templates" -->
"Actions" --> "Edit"
-->"Edit Templates" dialogue. This might be comfusing to user when
changing the "Storage Pool", "Disk(GB)" is changed with it without
even
notice. This might confuse the users and is not necessary. Solved by
removing the change.
Signed-off-by: Wen Wang <wenwang(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.template_edit_main.js | 7 -------
1 files changed, 0 insertions(+), 7 deletions(-)
diff --git a/ui/js/src/kimchi.template_edit_main.js
b/ui/js/src/kimchi.template_edit_main.js
index cb43091..8133878 100644
--- a/ui/js/src/kimchi.template_edit_main.js
+++ b/ui/js/src/kimchi.template_edit_main.js
@@ -131,13 +131,6 @@ kimchi.template_edit_main = function() {
kimchi.message.error(err.responseJSON.reason);
});
} else {
- if (origPool == storagepool) {
- // Previous disk size value
- $('input[name="disks"]',
templateEditForm).val(origDisks[0].size);
- } else {
- // Default disk size value
- $('input[name="disks"]', templateEditForm).val(10);
- }
The same I commented on previous patch:
If we don't update the disk size value when a no iSCSI nor SCSI device
is selected, the input box will contain the previous value which can be
not valid.
Example.
1. Select a dir pool
2. Disk size is set to 10Gb
3. Select a iSCSI volume
4. Disk size is set to 4GB
5. Select back the dir pool
6.a Disk size is still set to 4GB (*without* those 2 lines)
6.b Disk size turns back to 4GB (*with* the 2 lines)
From my view, the correct behavior is 6.b
$('input[name="disks"]',
templateEditForm).removeAttr('disabled');
}
});