From b94715b8b3c66a05ddddecdc15c6117629b8fab5 Mon Sep 17 00:00:00 2001 From: Brian McLaughlin Date: Tue, 29 Aug 2017 09:36:12 -0400 Subject: [PATCH 1/2] Enable Cockpit console for RHOS provider https://bugzilla.redhat.com/show_bug.cgi?id=1451655 --- .../cloud/instance_operations_button_group_mixin.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/helpers/application_helper/toolbar/cloud/instance_operations_button_group_mixin.rb b/app/helpers/application_helper/toolbar/cloud/instance_operations_button_group_mixin.rb index 5ae409eb234..f5627b85b58 100644 --- a/app/helpers/application_helper/toolbar/cloud/instance_operations_button_group_mixin.rb +++ b/app/helpers/application_helper/toolbar/cloud/instance_operations_button_group_mixin.rb @@ -114,6 +114,15 @@ def self.included(included_class) N_('VM Console'), :url => "html5_console", :klass => ApplicationHelper::Button::VmVncConsole), + included_class.button( + :cockpit_console, + 'pficon pficon-screen fa-lg', + N_('Open a new browser window with Cockpit for this VM. This requires that Cockpit is pre-configured on the VM.'), + N_('Web Console'), + # :image => "cockpit", + :url => "launch_cockpit", + :klass => ApplicationHelper::Button::CockpitConsole + ), ] ), ]) From 8deca8e75cba29cdff83d5003ebe1c557e46ccc8 Mon Sep 17 00:00:00 2001 From: Brian McLaughlin Date: Wed, 30 Aug 2017 13:54:52 -0400 Subject: [PATCH 2/2] Refactoring https://bugzilla.redhat.com/show_bug.cgi?id=1450109 https://bugzilla.redhat.com/show_bug.cgi?id=1451655 --- app/controllers/vm_remote.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/vm_remote.rb b/app/controllers/vm_remote.rb index 65cb8467c06..6b1932656e5 100644 --- a/app/controllers/vm_remote.rb +++ b/app/controllers/vm_remote.rb @@ -12,7 +12,7 @@ def launch_cockpit vm = identify_record(params[:id], VmOrTemplate) if vm.supports_launch_cockpit? - javascript_open_window(vm.cockpit_url) + javascript_open_window(vm.cockpit_url.to_s) else javascript_flash(:text => vm.unsupported_reason(:launch_cockpit), :severity => :error, :spinner_off => true) end