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

consoles: Some redesign #1972

Closed
wants to merge 7 commits into from

Conversation

mvollmer
Copy link
Member

@mvollmer mvollmer commented Jan 13, 2025

Because why not?  The expanded console allows startig stopping the
machine.
This is done by always having a VNC console, and letting it show the
"Add" button when there is no VNC display.
Since VNC has its own launch button now.

Use a custom design for the Spice launcher so that we can add things
like the "Replace" button.
So that people can edit them, or replace them, etc.
@mvollmer mvollmer force-pushed the consoles-experiment branch from 38c6464 to f77c723 Compare January 13, 2025 11:35
import { Dropdown, DropdownItem, DropdownList } from "@patternfly/react-core/dist/esm/components/Dropdown";
import { MenuToggle } from "@patternfly/react-core/dist/esm/components/MenuToggle";
import { Divider } from "@patternfly/react-core/dist/esm/components/Divider";
import { Split, SplitItem } from "@patternfly/react-core/dist/esm/layouts/Split/index.js";
import { EmptyState, EmptyStateBody, EmptyStateFooter } from "@patternfly/react-core/dist/esm/components/EmptyState";

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import EmptyStateFooter.
@martinpitt
Copy link
Member

Some random thoughts while watching the video:

  • Let's present VNC port -1 as "automatic" or "default" in the selector.
  • Showing the listening address in the "VNC: ..." below the console is too misleading IMHO. It could say something like "VNC: hostname:port (listening on 127.0.0.1)", with replacing "hostname" with what cockpit is connected to (I think we can get this information somehow)
  • The "Launch viewer" button is very kaputt.. Since Firefox 134 it just downloads a file with a completely random name and no extension, and I think chromium is no better (called "download"). If that is hard to fix (I didn't check), let's drop that button; but then again, how hard can it be to give the download a proper file name? (I know, famous last words)
  • Nice idea to add the "Replace SPICE devices" to the spice console table row!
  • What happened to the instructions how to install a viewer? We don't need/want them any more?

@mvollmer mvollmer mentioned this pull request Jan 14, 2025
7 tasks
@mvollmer
Copy link
Member Author

mvollmer commented Jan 14, 2025

Some random thoughts while watching the video:

  • Let's present VNC port -1 as "automatic" or "default" in the selector.

In the dialogs? Yes, absolutely.

  • Showing the listening address in the "VNC: ..." below the console is too misleading IMHO. It could say something like "VNC: hostname:port (listening on 127.0.0.1)", with replacing "hostname" with what cockpit is connected to (I think we can get this information somehow)

Yeah, but if the listen port is 127.0.0.1 for example, then telling people to connect to "dev.mvo.lan" isn't helping, no?

I think the best advice we can give is to run virt-viewer -c qemu+ssh://<host>/system <machine>. This will tunnel the VNC traffic over SSH.

  • The "Launch viewer" button is very kaputt.. Since Firefox 134 it just downloads a file with a completely random name and no extension, and I think chromium is no better (called "download"). If that is hard to fix (I didn't check), let's drop that button; but then again, how hard can it be to give the download a proper file name? (I know, famous last words)

It works for me (if the network is setup properly and the listening address works for connecting as the client). Firefox will download the file and you can click on it in the dropdown that opens. That will open the viewer.

  • Nice idea to add the "Replace SPICE devices" to the spice console table row!

Alright, I wasn't sure! :-)

  • What happened to the instructions how to install a viewer? We don't need/want them any more?

I can't say. I got lazy and didn't add them in my experiments, but we probably should keep them.

@martinpitt
Copy link
Member

  • Showing the listening address in the "VNC: ..." below the console is too misleading IMHO. It could say something like "VNC: hostname:port (listening on 127.0.0.1)", with replacing "hostname" with what cockpit is connected to (I think we can get this information somehow)

Yeah, but if the listen port is 127.0.0.1 for example, then telling people to connect to "dev.mvo.lan" isn't helping, no?
I think the best advice we can give is to run virt-viewer -c qemu+ssh://<host>/system <machine>. This will tunnel the VNC traffic over SSH.

Right. I think we should handle this specially -- with "0.0.0.0" or something else (rare, and benefit of the doubt) we give "cockpit-hostname:port", and with 127.0.0.1 the ssh tunneling. That should cover the common cases?

It works for me (if the network is setup properly and the listening address works for connecting as the client). Firefox will download the file and you can click on it in the dropdown that opens. That will open the viewer.

Ah, that works even with these totally random file names? nice! I thought they had to be called *.vv.

@mvollmer
Copy link
Member Author

  • Showing the listening address in the "VNC: ..." below the console is too misleading IMHO. It could say something like "VNC: hostname:port (listening on 127.0.0.1)", with replacing "hostname" with what cockpit is connected to (I think we can get this information somehow)

Yeah, but if the listen port is 127.0.0.1 for example, then telling people to connect to "dev.mvo.lan" isn't helping, no?
I think the best advice we can give is to run virt-viewer -c qemu+ssh://<host>/system <machine>. This will tunnel the VNC traffic over SSH.

Right. I think we should handle this specially -- with "0.0.0.0" or something else (rare, and benefit of the doubt) we give "cockpit-hostname:port", and with 127.0.0.1 the ssh tunneling. That should cover the common cases?

I guess... We also need to use the right address in the *.vv file, but that can't do SSH tunneling... but it's of course much better to get a "connection refused" error for the correct address than to connect to 127.0.0.1 and maybe pick up the console of the wrong machine.

@garrett
Copy link
Member

garrett commented Jan 14, 2025

Firstly: I'm ecstatic that you're working on this in general! This is excellent.

However, I don't understand what this PR is trying to do...

  1. This doesn't look like the mockups for the "new" design (it's several years old at this point in time) of the console.
  2. It doesn't fix any of the issues, such as having .vv on the filename (which was a regression, as it used to have it) so the file actually works; we need to specify the filename to the "download" attribute to the anchor.
  3. It also doesn't automatically adjust the firewall to allow non-localhosts to actually connect (so it's actually useful for our users, as it isn't at all right now, and won't be until we finally add firewall integration).
  4. Spice is no longer supported, so it shouldn't be in the UI.
  5. We shouldn't have a dropdown for selecting tabs; they should be "tabs" of some sort... in this case, the toggle group component, which does support overflow in case there are too many serial text connections... although in most cases, there will be 1 or perhaps 2, not 15 or 150. Dropdowns should generally not be used for selection unless there are 5 or more items and/or it is indeterminate with no other method that would work better. And dropdowns should never be used to change the view of a content; there are tabs and tab-like components which are better used instead.

What we need to do instead:

  • Set aside some time to talk about what we need to do in the Machines page, as it has sat around mainly dormant for years, aside from fixups here and there. We can do some of this at the F2F.
  • Dust off the mockups from years ago and retool them to address what we want to do in the Machines page.
  • Actually fix the desktop viewer... or even consider removing it, if we don't want to actually make it work. Right now, it no longer has the correct file, so there's no association (so it does nothing), relies on a deprecated viewer (IIRC), and doesn't work for remote machines. In real life, nobody really runs Cockpit locally; it's meant for remote servers, so this feature has never worked. We can make it work, but we should decide to fix and finish the implementation, if so.
  • Fix the expand action so people can actually get use more real estate for their connection, instead of dealing with a scaled down view with a bunch of stuff around it.

Current state of the mockups... they still need work; we need to discuss it and decide what to do with various features, but here they are right now:

Machines-Console

Machines-Console-noVNC

There are other parts to the mockups too (showing extended information for remote connections, configuring the port, etc.), but they heavily need more work (as they were made before we dropped SPICE, for example). These are old designs done to address needs that people who use Cockpit Machines actually have, as a "quick" response to the issues they encountered. They were intended to get the ball rolling and to have a conversation about how to fix Cockpit Machines, but I haven't focused on them, as nobody actually picked them up until now.

I'm super happy you're thinking about this and working on this, but we need to make sure we don't "put the cart before the horse". We need to have a dicussion about what is needed, figure out how it should all fit together, work on a design, make new mockups to address this, and then implement it. (Part of the problem of the Machines page right now is that it's a hodgepodge of various features shoved together over the years, with small updates here and there on top; we need to fix it and make it more cohesive and address the various conceptual and implementation issues.)

@martinpitt
Copy link
Member

Spice is no longer supported, so it shouldn't be in the UI.

Clarification: It isn't supported in RHEL 9/10. Everywhere else (Fedora/Debian/Arch/Ubuntu) it still is.

@mvollmer
Copy link
Member Author

However, I don't understand what this PR is trying to do...

This was just me digging into c-machines consoles in general, and trying to figure out how to make progress with the stuff in #1795, without introducing all the bugs it has right now.

Before doing this, I wasn't really aware how broken the "Launch viewer" button actually is, I have to admit.

@mvollmer
Copy link
Member Author

  1. This doesn't look like the mockups for the "new" design (it's several years old at this point in time) of the console.

Not yet :-) Thanks for clarifying how multiple serial consoles should be handled.

@garrett
Copy link
Member

garrett commented Jan 15, 2025

Clarification: It isn't supported in RHEL 9/10. Everywhere else (Fedora/Debian/Arch/Ubuntu) it still is.

From what I previously understood: The primary developers of SPICE was Red Hat, and Red Hat decided to stop actively developing it. (Being packaged and shipped in a distro is not the same thing as supported either commercially or by a community of coders, of course. Just because it exists in a distribution doesn't mean it's being developed or maintained, or "supported" in any sense of the word.)

There are a handful of repos at https://gitlab.freedesktop.org/spice/?sort=latest_activity_desc that have had updates as of weeks and months ago, at least. While SPICE is already rather feature complete, I do see some bugfixes in a few repos over the past few years. So that's great to see!

@garrett
Copy link
Member

garrett commented Jan 15, 2025

Not yet :-) Thanks for clarifying how multiple serial consoles should be handled.

That's definitely a way. It's assuming there will generally be 1, and if there's more than one, add numbers to the tab, and that there's some kind of overflow in PF.

I would like for us to make the widget larger, and that would provide more space too.

How many serial consoles will VMs typically have? 1? More?

@mvollmer
Copy link
Member Author

I want to start over with this. Thanks for all the comments, I'll not forget them.

@mvollmer mvollmer closed this Jan 16, 2025
@mvollmer
Copy link
Member Author

How many serial consoles will VMs typically have? 1? More?

0 to 1, I would say.

@garrett
Copy link
Member

garrett commented Jan 16, 2025

I want to start over with this. Thanks for all the comments, I'll not forget them.

Thanks for making this PR! It's rekindled and moved the conversation along for all of us! 👍

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

Successfully merging this pull request may close these issues.

3 participants