[PATCH] [Kimchi] Bugfix 804: Disable connect vnc when VM is powered off

- When a VM is powered off, the option to connect to its vnc should not be displayed under the actions menu otherwise users will get errors. Signed-off-by: Jose Ricardo Ziviani <joserz@linux.vnet.ibm.com> --- ui/js/src/kimchi.guest_main.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/js/src/kimchi.guest_main.js b/ui/js/src/kimchi.guest_main.js index bfd62a8..83ee3f0 100644 --- a/ui/js/src/kimchi.guest_main.js +++ b/ui/js/src/kimchi.guest_main.js @@ -652,7 +652,8 @@ kimchi.createGuestLi = function(vmObject, prevScreenImage, openMenu) { var consoleActions = guestActions.find("[name=vm-console]"); var consoleLinkActions = result.find(".vnc-link"); - if ((vmObject.graphics['type'] == 'vnc') || (vmObject.graphics['type'] == 'spice')) { + if (((vmObject.graphics['type'] == 'vnc') || (vmObject.graphics['type'] == 'spice')) + && (!vmPoweredOffBool)) { consoleActions.on("click", function(event) { event.preventDefault(); kimchi.openVmConsole(event); -- 1.9.1

Reviewed-By: Lucio Correia <luciojhc@linux.vnet.ibm.com> On 16-02-2016 11:02, Jose Ricardo Ziviani wrote:
- When a VM is powered off, the option to connect to its vnc should not be displayed under the actions menu otherwise users will get errors.
Signed-off-by: Jose Ricardo Ziviani <joserz@linux.vnet.ibm.com> --- ui/js/src/kimchi.guest_main.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ui/js/src/kimchi.guest_main.js b/ui/js/src/kimchi.guest_main.js index bfd62a8..83ee3f0 100644 --- a/ui/js/src/kimchi.guest_main.js +++ b/ui/js/src/kimchi.guest_main.js @@ -652,7 +652,8 @@ kimchi.createGuestLi = function(vmObject, prevScreenImage, openMenu) { var consoleActions = guestActions.find("[name=vm-console]"); var consoleLinkActions = result.find(".vnc-link");
- if ((vmObject.graphics['type'] == 'vnc') || (vmObject.graphics['type'] == 'spice')) { + if (((vmObject.graphics['type'] == 'vnc') || (vmObject.graphics['type'] == 'spice')) + && (!vmPoweredOffBool)) { consoleActions.on("click", function(event) { event.preventDefault(); kimchi.openVmConsole(event);
-- Lucio Correia Software Engineer IBM LTC Brazil

Applied. Thanks. Regards, Aline Manera
participants (3)
-
Aline Manera
-
Jose Ricardo Ziviani
-
Lucio Correia