[Kimchi-devel] [PATCH V2] Guest disk hot plug UI
Yu Xin Huo
huoyuxin at linux.vnet.ibm.com
Tue Oct 28 09:57:05 UTC 2014
On 10/24/2014 11:07 AM, Wen Wang wrote:
> From: Wen Wang <wenwang at linux.vnet.ibm.com>
>
> V1 -> V2:
> Enable CDROM hot plug including detaching.
>
> Enable users add and detach disk when vm is running.
>
> Signed-off-by: Wen Wang <wenwang at linux.vnet.ibm.com>
> ---
> ui/js/src/kimchi.guest_edit_main.js | 29 +++++++++++------------------
> 1 files changed, 11 insertions(+), 18 deletions(-)
>
> diff --git a/ui/js/src/kimchi.guest_edit_main.js b/ui/js/src/kimchi.guest_edit_main.js
> index 030e112..82aeeb6 100644
> --- a/ui/js/src/kimchi.guest_edit_main.js
> +++ b/ui/js/src/kimchi.guest_edit_main.js
> @@ -57,17 +57,12 @@ kimchi.guest_edit_main = function() {
> text: false
> });
>
> - if(kimchi.thisVMState != "running") {
> - $('.detach', container).button({
> - icons: {
> - primary: 'ui-icon-trash'
> - },
> - text: false
> - });
> -
> - } else {
> - $('.detach', container).remove();
> - }
> + $('.detach', container).button({
> + icons: {
> + primary: 'ui-icon-trash'
> + },
> + text: false
> + });
>
> $('.save', container).button({
> icons: {
> @@ -443,14 +438,8 @@ kimchi.guest_edit_main = function() {
> guest['icon'] = guest['icon'] || 'images/icon-vm.png';
> $('#form-guest-edit-general').fillWithObject(guest);
> kimchi.thisVMState = guest['state'];
> -
> refreshCDROMs();
> - if(kimchi.thisVMState === "running") {
> - $("#form-guest-edit-general input").prop("disabled", "disabled");
> - $("#guest-edit-attach-cdrom-button").remove();
> - $("#form-guest-edit-interface .header button").remove();
> - } else {
> - $('#guest-edit-attach-cdrom-button').button({
> + $('#guest-edit-attach-cdrom-button').button({
> icons: {
> primary: "ui-icon-plusthick"
> },
> @@ -459,6 +448,10 @@ kimchi.guest_edit_main = function() {
> event.preventDefault();
> kimchi.window.open("guest-storage-add.html");
> });
> + if(kimchi.thisVMState === "running") {
> + $("#form-guest-edit-general input").prop("disabled", "disabled");
'disabled' is a boolean type.
http://api.jquery.com/prop/
> + $("#form-guest-edit-interface .header button").remove();
> + } else {
> $("#action-button-container").removeClass("hidden");
> }
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/kimchi-devel/attachments/20141028/3d9bb1c6/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: icaddcee.png
Type: image/png
Size: 2737 bytes
Desc: not available
URL: <http://lists.ovirt.org/pipermail/kimchi-devel/attachments/20141028/3d9bb1c6/attachment.png>
More information about the Kimchi-devel
mailing list