Adam,
can you please modify the "Memory" lable in edit window ??
Change from "Memory" to "Memory (MB)" ... then we avoid user mistakes
when he updates the number
Rodrigo
On 04/07/2014 03:30 PM, Adam King wrote:
Update the edit VM form to use the new form extensions.
Enable the cpu and memory fields to be edited.
Signed-off-by: Adam King <rak(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.guest_edit_main.js | 10 ++--------
ui/pages/guest-edit.html.tmpl | 12 +++++-------
2 files changed, 7 insertions(+), 15 deletions(-)
diff --git a/ui/js/src/kimchi.guest_edit_main.js b/ui/js/src/kimchi.guest_edit_main.js
index 9375c51..4758dc0 100644
--- a/ui/js/src/kimchi.guest_edit_main.js
+++ b/ui/js/src/kimchi.guest_edit_main.js
@@ -80,9 +80,7 @@ kimchi.guest_edit_main = function() {
var initContent = function(guest) {
guest['icon'] = guest['icon'] || 'images/icon-vm.png';
- for ( var prop in guest) {
- $('input[name="' + prop + '"]',
guestEditForm).val(guest[prop]);
- }
+ $('#form-guest-edit-general').fillWithObject(guest);
refreshCDROMs();
@@ -116,11 +114,7 @@ kimchi.guest_edit_main = function() {
var submitForm = function(event) {
$(saveButton).prop('disabled', true);
- var editableFields = [ 'name' ];
- var data = {};
- $.each(editableFields, function(i, field) {
- data[field] = $('#form-guest-edit [name="' + field +
'"]').val();
- });
+ var data=$('#form-guest-edit-general').serializeObject();
kimchi.updateVM(kimchi.selectedGuest, data, function() {
kimchi.listVmsAuto();
kimchi.window.close();
diff --git a/ui/pages/guest-edit.html.tmpl b/ui/pages/guest-edit.html.tmpl
index 804fc39..bf7ea56 100644
--- a/ui/pages/guest-edit.html.tmpl
+++ b/ui/pages/guest-edit.html.tmpl
@@ -59,8 +59,7 @@
<input
id="guest-edit-cores-textbox"
name="cpus"
- type="text"
- disabled="disabled" />
+ type="text" />
</div>
</div>
<div>
@@ -72,8 +71,7 @@
<div class="guest-edit-wrapper-controls">
<input id="guest-edit-memory-textbox"
name="memory"
- type="text"
- disabled="disabled" />
+ type="text" />
</div>
</div>
<div>
@@ -98,7 +96,7 @@
<div>
<button id="guest-edit-attach-cdrom-button"
class="guest-edit-cdrom-button attach"
- title="$_("Attach")">
+ title='$_("Attach")'>
</button>
</div>
</fieldset>
@@ -124,11 +122,11 @@
value="{path}" readonly="readonly" />
<button class="guest-edit-cdrom-button replace"
data-vm="{vm}" data-dev="{dev}"
- title="$_("Replace")">
+ title='$_("Replace")'>
</button>
<button class="guest-edit-cdrom-button detach"
data-vm="{vm}" data-dev="{dev}"
- title="$_("Detach")">
+ title='$_("Detach")'>
</button>
</div>
</div>