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

Added NoVNC console page #956

Merged
merged 12 commits into from
Jun 5, 2019
Merged

Added NoVNC console page #956

merged 12 commits into from
Jun 5, 2019

Conversation

bond95
Copy link
Contributor

@bond95 bond95 commented Feb 15, 2019

Fixes: #490
Fixes: #966

  • Refactored Mike's code
  • Fixed console page
  • Improved NoVNC component
  • Changed ConsoleConfirmationModal architecture
  • Added Loader component
  • Added console info modal

Patterfly-react PR: patternfly/patternfly-react#1402

image

image

image

image

image

Copy link

@lwrigh lwrigh left a comment

Choose a reason for hiding this comment

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

The updates are looking good! My one comment is on adding the external link icon next to the console types that open up in a new window.
screen shot 2019-02-18 at 9 46 33 am

@lwrigh
Copy link

lwrigh commented Feb 18, 2019

What do you guys think about the possibility of adding a full screen button into the console page? We could place it in the lower right hand corner of the console screen.

@gregsheremeta
Copy link
Contributor

What do you guys think about the possibility of adding a full screen button into the console page? We could place it in the lower right hand corner of the console screen.

I'm not sure the novnc component supports full screen mode. @bond95 ?

@bond95
Copy link
Contributor Author

bond95 commented Feb 18, 2019

@gregsheremeta well, yeah, component doesn't have any props for it, but it doesn't mean that we can't add it. But I think it would be better to do in separate PR.

@gregsheremeta
Copy link
Contributor

@gregsheremeta well, yeah, component doesn't have any props for it, but it doesn't mean that we can't add it. But I think it would be better to do in separate PR.

Agree. I was just wondering if novnc supports it at all.

@bond95
Copy link
Contributor Author

bond95 commented Feb 20, 2019

@lwrigh added icons
image

@lwrigh
Copy link

lwrigh commented Feb 21, 2019

@lwrigh added icons
image

Looks good to me 👍

Copy link
Member

@sjd78 sjd78 left a comment

Choose a reason for hiding this comment

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

First pass - mostly questions and some nit-picks. I'll take a deeper look later.

@sjd78
Copy link
Member

sjd78 commented Feb 21, 2019

@bond95, @gregsheremeta - Try opening a VNC browser console and leave it open for awhile. Seems to crash my tab every time, I just haven't been able to time it out consistently.

Update: And now I've had a VNC console to a command line session open without errors for >4 hours. 🤷‍♂️

@sjd78
Copy link
Member

sjd78 commented Feb 22, 2019

@lwrigh, @gregsheremeta, @bond95 - Thoughts on the breadcrumb title? Right now it is the VM's console ID. Maybe just the word "Console" instead?

screenshot-localhost-3000-2019 02 21-22-49-22

@sjd78
Copy link
Member

sjd78 commented Feb 22, 2019

@gregsheremeta - Thought ... this could probably be adapted to webadmin via ui-extensions without all that much extra work.

@lwrigh
Copy link

lwrigh commented Feb 22, 2019

@lwrigh, @gregsheremeta, @bond95 - Thoughts on the breadcrumb title? Right now it is the VM's console ID. Maybe just the word "Console" instead?

screenshot-localhost-3000-2019 02 21-22-49-22

Just having 'Console' as the third breadcrumb makes sense to me.

sjd78
sjd78 previously requested changes Feb 22, 2019
Copy link
Member

@sjd78 sjd78 left a comment

Choose a reason for hiding this comment

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

Overall the structure looks good and works well enough.

A few general comments:

  • The way the ConsoleConfirmationModal is tightly tied to the redux store seems to work but seems very unique to this component. Feels a bit over complicated, but I don't have any specific suggestions on how to simplify it.

  • For the customized version of @patterfly/react-console, it would be helpful to do 2 things:

    • Put the custom code in a distinct folder like src/patternfly-overrides and refernce it there. That will make it a lot more obvious as to where the code came from and that it could be replace in future by an updated component.
    • Put comments in the components you needed to change summarizing what you needed to add or change. That will help simplify the review/verification. (I had to look at the sources in the patternfly-react repo and visually compare differences to see what was tweaked for web-ui).
  • Using the React portal to push the VNC toolbar to the right place is great work! It would be nice to adopt that style for all the page toolbars so they don't have to be tied in via the routes.

@bond95 bond95 dismissed sjd78’s stale review February 22, 2019 15:59

Fixed comments, moved VncConsole to src/react-console

@sjd78 sjd78 self-requested a review February 27, 2019 18:23
@sjd78
Copy link
Member

sjd78 commented Feb 27, 2019

@bond95 - Need to be rebased after #967 merged.

Copy link
Member

@sjd78 sjd78 left a comment

Choose a reason for hiding this comment

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

Very close. Only a few style updates and localization work are still needed.

if (!toolbarContainer) {
return toolbar
}
return document.getElementById(toolbarContainer) &&
Copy link
Member

Choose a reason for hiding this comment

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

It would be more appropriate for toolbarContainer to already be a createPortal compatible element by now...probably passed in as a component already.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually I don't see big difference, but I prefer more this way, because in this case props more clear and easier to read.

Copy link
Member

Choose a reason for hiding this comment

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

I haven't seen any other patternfly-react or react-bootstrap code do containers/portals this way. The component always accepts another element to use as the target.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to what I saw, patternfly-react has both id and element, so user can choose which one to use, and it seems to me better solution.

Copy link
Member

Choose a reason for hiding this comment

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

I looked again and found exactly 1 instance of getElementById use in a component in patternfly-react. That use actually looks for a component in one param (scrollable) and if it isn't there, uses a different param (scrollableElementId). Either way, it's up to Marek in the patternfly-react patch to approve what will be integrated with react-console and ultimately adopted here.

Copy link
Contributor

Choose a reason for hiding this comment

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

feel free to get his opinion now ...

path={proxyTicket}
host={websocket.get('host')}
port={websocket.get('port')}
toolbarContainer='vm-console-toolbar-sendkeys'
Copy link
Member

Choose a reason for hiding this comment

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

Grab the DOM element directly here instead of passing in the element id. Don't make the VncConsole component have to do any work fetching. Make it easy by passing in the element that can be the portal target for the container.

@sjd78
Copy link
Member

sjd78 commented Feb 28, 2019

@bond95, @gregsheremeta, @lwrigh - FYI, an easy way to tell if you got all of the strings into the translation bundle is to run the app with the dummy locale. A script will generate a dummy locale for you that surrounds all of the english with some arrows. No arrows on a piece of text means the text is data or needs to be localized.

  yarn intl:dummy

Then open the app with the locale on the URL:

   http://localhost:3000?locale=aa

For example:
screenshot-localhost-3000-2019 02 28-13-10-54

@bond95 bond95 requested a review from sjd78 March 1, 2019 13:18
@sjd78
Copy link
Member

sjd78 commented Mar 1, 2019

@bond95 - I'm still getting #966 when I try to connect to a console of a VM that is powering up.

Copy link
Member

@sjd78 sjd78 left a comment

Choose a reason for hiding this comment

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

3 issues to address remain:

@sjd78
Copy link
Member

sjd78 commented Apr 30, 2019

@bond95 , @leistnerova - How is this PR looking? Latest round of code changes look ok. Does it just need another round of testing?

@leistnerova
Copy link
Collaborator

I'll do a quick test of last changes, not the whole testing.

@leistnerova
Copy link
Collaborator

ci build please

@bond95
Copy link
Contributor Author

bond95 commented May 6, 2019

@sjd78 @lwrigh WDYT?

Screenshot 2019-05-06 at 11 07 46

@lwrigh
Copy link

lwrigh commented May 6, 2019

I would suggest changing the text to read, "Cannot connect to websocket proxy server. Please check your websocket proxy certificate or ask your administrator for help. For further information please refer to the console manual(linked). Press the 'Connect' button to reconnect to the console.".

@bond95
Copy link
Contributor Author

bond95 commented May 7, 2019

@lwrigh Done
Screenshot 2019-05-07 at 11 18 00

@lwrigh
Copy link

lwrigh commented May 7, 2019

Nice looks good to me!

@leistnerova
Copy link
Collaborator

LGTM

@sjd78
Copy link
Member

sjd78 commented May 9, 2019

Just noticed while redoing a demo video: At least on Chrome, if you click directly from the console to the details in the breadcrumbs, the charts on the details page don't render:
ezgif com-video-to-gif

My best guess is that c3 gets broken somewhere when you don't explicitly click the disconnect button. Eventually my browser tab (Chrome) will straight crash as well.

@bond95, @lwrigh, @leistnerova - Can you guys reproduce?
@sgratch, @michalskrivanek - Punt to an issue or resolve in this PR (assuming it can be reproduced)?

@bond95
Copy link
Contributor Author

bond95 commented May 10, 2019

@bond95, @lwrigh, @leistnerova - Can you guys reproduce?

@sjd78 Unfortunately, no, everything works fine for me in Chrome Version 73.0.3683.86 (Official Build).
Peek 2019-05-10 11-23

@sjd78
Copy link
Member

sjd78 commented May 15, 2019

@sgratch, @michalskrivanek - Punt to an issue or resolve in this PR (assuming it can be reproduced)?

I'll do some additional testing permutations (Chrome on a Mac connecting to dev server web-ui and connecting to web-ui installed to my dev ovirt-engine instance). If it still comes up, I'll log a separate issue. I'm ok with merging this as-is.

@bond95
Copy link
Contributor Author

bond95 commented May 15, 2019

I'll do some additional testing permutations (Chrome on a Mac connecting to dev server web-ui and connecting to web-ui installed to my dev ovirt-engine instance). If it still comes up, I'll log a separate issue. I'm ok with merging this as-is.

Great, thank you.

@leistnerova
Copy link
Collaborator

@sjd78 I also did not reproduce is, tested in Chrome 74.0 on Fedora

@sjd78
Copy link
Member

sjd78 commented May 17, 2019

@sgratch, @michalskrivanek - Punt to an issue or resolve in this PR (assuming it can be reproduced)?

I'll do some additional testing permutations (Chrome on a Mac connecting to dev server web-ui and connecting to web-ui installed to my dev ovirt-engine instance). If it still comes up, I'll log a separate issue. I'm ok with merging this as-is.

I tested Chrome 74.0 on Mac against the web-ui dev server and against web-ui installed to my dev ovirt-engine and was able to reproduce the c3 no charts problem and the browser tab crashing problem. The tab appears to crash because of a massive memory leak. I also tested with Firefox on fedora against my dev ovirt-engine with web-ui installed and recreated the memory leak there. Firefox's tab doesn't crash as politely as the Chrome tab.

Here is a video of the Chrome 74.0 on Mac C3 fail followed by memory leak and tab crash:
https://youtu.be/ZrOGGyPQpPA

@leistnerova
Copy link
Collaborator

It seems I have the reproduction steps:

  1. have running VM
  2. check browser console, go back to VM detail
  3. Shutdown with Force (normal shutdown seems to work)
  4. Run VM again
  5. go to browser console, wait a while
  6. when going back to VM detail, charts already loaded
  7. go to browser console, back to detail
  8. charts broken

It doesn't happen 100%, but mostly. Reproduced in Google Chrome 74.0 and also Firefox 66.0

@michalskrivanek
Copy link
Member

@leistnerova thanks! @sjd78 does the console code terminate properly when VM is shut down? if not...could be novnc bug or our code around it. Generally as soon as VM is down the console should die with it.

@bond95
Copy link
Contributor Author

bond95 commented May 29, 2019

@leistnerova thanks! @sjd78 does the console code terminate properly when VM is shut down? if not...could be novnc bug or our code around it. Generally as soon as VM is down the console should die with it.

Console code must be terminated with VmConsole component. When user go to detail page from console page, VmConsole is unmounting and console terminate as well. According to my experiments problem can be in charts, because this bug cause frequent update of charts, which can be cause of growing memory usage.

@sgratch
Copy link
Member

sgratch commented Jun 4, 2019

@bond95 @sjd78 if both #966 and #490 is handled by this PR then can we please merge this as discussed and open a new issue for #956 (comment) ?

@bond95
Copy link
Contributor Author

bond95 commented Jun 5, 2019

@sgratch yes, of course, I'll merge this.

@bond95 bond95 merged commit 3f38ef0 into oVirt:master Jun 5, 2019
gerrit-ovirt-org pushed a commit to oVirt/ovirt-engine-nodejs-modules that referenced this pull request Nov 4, 2021
Pull Request: oVirt/ovirt-web-ui#956

Change-Id: I9fefb7a09922c3ad05908be70850a89b5017782f
Signed-off-by: Scott J Dickerson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Flag: Needs QE needs testing by QE team before merging PR and closing issue Flag: Needs UI review Needs UI designer to review screenshots before merging PR and closing issue Status: ON_QA status ON_QA (currently being tested)
Projects
None yet
7 participants