Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native viewer #6574

Merged
merged 1 commit into from
Jan 11, 2020
Merged

Native viewer #6574

merged 1 commit into from
Jan 11, 2020

Conversation

gekorob
Copy link
Member

@gekorob gekorob commented Dec 24, 2019

Show native viewer button for redhat providers and allow
connection file to be downloaded after requiring it via task

related to BZ:
https://bugzilla.redhat.com/show_bug.cgi?id=1451594

Depends on:

@gekorob
Copy link
Member Author

gekorob commented Dec 24, 2019

@miq_bot add_label wip


def disabled?
begin
@record.validate_native_viewer_support
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this calling something from the provider's API, because then it can heavily affect the performance. cc @agrare

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry, didn't see the wip 😕

Copy link
Member Author

@gekorob gekorob Dec 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skateman this call is similar to the one that is doing vmware VRMC button, it's only to test if ems is not nil and state is 'on'. No call to external provider.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please feel free to suggest modifications

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW Merry Christmas 'cause I realized that midnight has passed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okkay, I'm gonna dig into these. Happy new year!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks and Happy new year also to you and the team

@skateman
Copy link
Member

@miq-bot add_label wip

@miq-bot miq-bot changed the title Native viewer [WIP] Native viewer Dec 24, 2019
@miq-bot miq-bot added the wip label Dec 24, 2019
@skateman
Copy link
Member

skateman commented Jan 3, 2020

What about naming it a more universal Native Console instead of Native Viewer Console? That way we might be able to extend it to other providers in the future without introducing provider-specific features. Also it's shorter 😉 what do you think?

@gekorob
Copy link
Member Author

gekorob commented Jan 3, 2020

Hi @skateman, yes absolutely. I have to admit that I tried several namings, and before it was Native Console. So yes, no problem to change to that. When I'll back to work I'll change to NativeConsole

@gekorob
Copy link
Member Author

gekorob commented Jan 3, 2020

@skateman, may I ask also to check where I manage the task_complete?
https://github.com/gekorob/manageiq-ui-classic/blob/4cc30e5b47cce2656e2c897809d1a3a8f4f2fadf/app/controllers/vm_remote.rb#L134-L138

I'm passing the task_id to the method that is executing the send_data
https://github.com/gekorob/manageiq-ui-classic/blob/4cc30e5b47cce2656e2c897809d1a3a8f4f2fadf/app/controllers/vm_remote.rb#L28-L34

The price is to execute two times a MiqTask.find but I wanted to avoid passing the Base64 encoded console file as parameter.
Is there another way to do that?

Show native viewer button for redhat providers and allow
connection file (usually named console.vv) to be dowloaded after
requiring via task
@gekorob gekorob force-pushed the rfe/native_viewer branch from 4cc30e5 to 4503228 Compare January 7, 2020 16:37
@miq-bot
Copy link
Member

miq-bot commented Jan 7, 2020

Checked commit gekorob@4503228 with ruby 2.5.5, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0
5 files checked, 0 offenses detected
Everything looks fine. 🍪

@gekorob
Copy link
Member Author

gekorob commented Jan 7, 2020

@skateman I changed from Native Viewer Console to Native Console as you suggested. Also changed in manageiq core and in the provider.

@gekorob
Copy link
Member Author

gekorob commented Jan 7, 2020

@miq-bot remove_label wip

@miq-bot miq-bot changed the title [WIP] Native viewer Native viewer Jan 7, 2020
@miq-bot miq-bot removed the wip label Jan 7, 2020
end

def native_console_task_complete
miq_task = MiqTask.find(params[:task_id])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need to search for the MiqTask here, as far as I see, it's just "validation" which could be done in the next step when opening the window.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it's only to test if the task has results. You're right I'll try to move it in the launch_native_console so we can remove the first find.

),
button(
:vm_native_console,
'pficon pficon-screen fa-lg',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@epwinchell maybe we need a different icon for this, your call.

@skateman
Copy link
Member

skateman commented Jan 8, 2020

For the first look, the code looks fine, with some minor things. Maybe we want to extend this into the Service UI, cc @martinpovolny and @himdel if we want that (but my guess is yes). I can help you with that.

@gekorob
Copy link
Member Author

gekorob commented Jan 8, 2020

@skateman do you have suggestions for the i18n messages?
I think I have to add it in the core PR (ManageIQ/manageiq#19675).
Is it right?

@mzazrivec
Copy link
Contributor

do you have suggestions for the i18n messages? I think I have to add it in the core PR

Which messages are we talking about here?

@gekorob
Copy link
Member Author

gekorob commented Jan 8, 2020

I was thinking at strings related to the button:

        button(
          :vm_native_console,
          'pficon pficon-screen fa-lg',
          N_('Open a native console for this VM'),
          N_('Native Console'),
          :keepSpinner => true,
          :url         => "native_console",
          :klass       => ApplicationHelper::Button::VmNativeConsole
        ),

'cause Native Console didn't exists before as a button.
I'm quite new to the ui part, sorry

@skateman
Copy link
Member

skateman commented Jan 8, 2020

AFAIK you don't have to do more than you did, the N_ call should take care of the translation. But @mzazrivec can tell you more about this.

@gekorob
Copy link
Member Author

gekorob commented Jan 8, 2020

Great thx a lot, so I'll leave it like this

@miq-bot miq-bot requested a review from epwinchell January 8, 2020 15:52
@epwinchell
Copy link
Contributor

@gekorob Could you post a screenshot? Thanks


def disabled?
begin
@record.validate_native_console_support
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you confirm that thisvalidate_native_console_support only talks to the database? (it does not do any time consuming operation and does to try to access the VM or talk to a provider).

Thx!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gekorob
Copy link
Member Author

gekorob commented Jan 8, 2020

Sure @epwinchell, in the drop down list, native console has the same icon of the other console. I thought it was ok, but if you have another one I can refer to that.

native_console

Tell me if is it ok for you.
Thx a lot

Copy link
Contributor

@epwinchell epwinchell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gekorob Thanks. It looks good. We'll keep it simple.

@skateman
Copy link
Member

skateman commented Jan 9, 2020

Gonna test this

Copy link
Member

@skateman skateman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Seal of Approval

@martinpovolny martinpovolny merged commit 8e67de8 into ManageIQ:master Jan 11, 2020
@martinpovolny martinpovolny self-assigned this Jan 11, 2020
@martinpovolny martinpovolny added this to the Sprint 128 Ending Jan 20, 2020 milestone Jan 11, 2020
@skateman
Copy link
Member

@martinpovolny there is a pending core PR

@simaishi
Copy link
Contributor

simaishi commented Oct 6, 2020

Backported to ivanchuk via #7372

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants