-
Notifications
You must be signed in to change notification settings - Fork 87
consoles: Redesign #2008
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
base: main
Are you sure you want to change the base?
consoles: Redesign #2008
Conversation
69dcfd9
to
77c4eb9
Compare
77c4eb9
to
0fe5bbc
Compare
f65bf5f
to
ace6a87
Compare
165110f
to
4f73613
Compare
5137d12
to
8128512
Compare
a363668
to
ae64118
Compare
ae64118
to
111442f
Compare
111442f
to
1edb67d
Compare
5c2254e
to
caadd56
Compare
7768ef7
to
d05b72a
Compare
But this would mean we need to find a different place for the "resize & scale" settings, which are important in fullscreen. |
d05b72a
to
56162ff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First round of reviews done I think. Also answering some questions from the PR body:
- Where should the "send key" and "disconnect" actions go?
Disconnect should be outside of the dropdown. Any dropdowns that have like 1 or 2 items we shouldn't have a dropdown either, unless it's an overflow menu (overkill for this PR). As for the ellipsis I'm wondering if there is a better icon to use just for "send key"
- Is the (?) button plus popover ok?
Yeah might be fine. Trying to think of an alternative but not sure atm.
The buttons need spacing between them. Button group should have default padding available as a field.
- Is it ok to completely ignore spice when there is vnc?
No clue, someone else would have to answer pros and cons of this.
- How should the expanded view look?
Current is fine for maximizing space. But we should in future PR fix this.. I don't like how the page loses all the spacing, border, and border radius. I'd want to figure out how to make the page work with a fullscreen-like mode - but that's something we've talked about at lengths before (out of scope for this I think, too much work)
if (password.length > 8) { | ||
setPasswordError(_("Password must be 8 characters or less.")); | ||
field_errors += 1; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be explained why
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, the reason is probably a limitation in the VNC protocol itself... If I remove this check here, the error from virt-xml is
ERROR unsupported configuration: VNC password is 21 characters long, only 8 permitted
So I don't know what we could say here that would be helpful...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about just VNC protocol requires 8 characters or less.
or something in that regard
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's say "VNC protocol only allows 8 characters or less" to make it sound more like a unfortunate technology restriction, ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's say "VNC protocol only allows 8 characters or less" to make it sound more like a unfortunate technology restriction, ok?
This isn't true actually. The RFC says:
The client encrypts the challenge with DES, using a password supplied
by the user as the key. To form the key, the password is truncated
to eight characters, or padded with null bytes on the right.
So technically, the protocol allows passwords longer than 8 characters...
It should be possible to first escape from the console view, then hit escape to get out of the fullscreen mode and reset everything |
- A ToggleGroup in the Card header is used to switch consoles - The console switcher is also there for shut-off machines. This gives us a place for type-specific actions that also make sense for a shut-off machine, like editing VNC server settings. - The DesktopViewer is gone, but there is a footer with a "Launch viewer" button and a "How to connect" popover. - Actions for the Graphics and Serial consoles are collected into kebab menus. - The expanded console has less UI around it, and it keeps the type that was active in the collapsed view. Instead of the breadcrumb it has a "Collapse" button. - When there is no actual console for a given type, there is now a EmptyState component where you can enable it. - It is possible to change VNC server settings via the "How to connect" popup. - The SPICE console invites you to replace it with VNC. - The size of the expanded console is now always controlled by the browser window and never overflows in height. - The VncConsole has been imported from @patternfly/react-console and stripped down.
Doesn't that move the (?) too far away from the button that it applies to? I think the problem is that we get the grey focus background here... I have changed it to use the new |
Where would the "Disconnect" button go exactly? "Disconnect" is not a very common or important action, and I think we need not make it prominent. There is now also less horizontal space since the console selector has moved into the header and is now a row of toggle buttons. We might get this situation, potentially, but super rarely: We have a lot of dropdowns with one or two items in them, such as for removing disks or network interfaces: One could argue that this is appropriate since "Remove" is a destructive action and it should just sit there on the page (even if it has a confirmation dialog, of course). But we are not consistent with that.
Yes, I had a look but couldn't find any. |
Font Awesome has one: https://fontawesome.com/v5/icons/keyboard?s=solid And we have the CSS for, but apparently not the font, or something. Inspector looks good: but it renders as a missing glyph: I know nothing about web and fonts. |
Factored common code out from VNC and Spice. Added download icon to button, since it downloads a file. If we ever support opening vnc:// or spice:// URLs, we would use a different icon (or no icon) Used new InfoPopover for the RemoteViewerInfo.
I have reverted my recent change and made it look more PF6y again:
Yes, I'll prepare a PR. I think a "full browser" VNC console would be nice and seems quite within reach. |
I'd say it's either this or having a Tooltip component with a hover state for the button that shows the info. Spacing is important between buttons even if the padding does increase. It makes everything more uniform too
Okay if there is going to be multiple terminals you can switch to and not just 2 then we should revisit this in the future, out of scope for this PR at this point. When it becomes a lot of options, having a tab selection might not be the best way to switch either. Remove is also not part of send keys itself so it is in a weird state to be in the dropdown there. Expand/Collapse button is on the right and serves as actions surrounding the console, so we can have Remove together with that (next to it). A good rule of thumb is that when something approaches 3 items it should probably go into a dropdown menu to reduce clutter.
Ah yeah.. we explicitly remove FontAwesome in Cockpit atm. We can check in a future PR
If you get to it make it a rough draft in case I have drastic suggestions. I think it might be difficult to get good :D |
56162ff
to
5f9703d
Compare
This doesn't really matter since we ignore TypeScript errors in JavaScript files.
Added helper texts to describe requirements up front. Validate input when text inputs are blurred.
Also, non-numeric port values get their dedicated validation error.
@Venefilyn, for me the "Edit VNC settings" dialog is in the "non guided" part of Cockpit. It's there if you really need it, but otherwise it is best ignored. The "non guided" parts, in my view, don't need to be explained well. Does that make sense to you? It means we don't need to polish the error messages and behavior a lot. I have tried to make it clearer that people are leaving the "guided" parts by changing the label of the button to "Edit VNC settings (advanced)": The password helper texts also are more scary: |
Yes, agreed. I think it is very rare that people have more than one text console. I think we can ignore this case for now. I'll pull "Disconnect" out of the dropdown and try to find a SVG keyboard icon that we can use. |
45da00b
to
405cdb1
Compare
Now they look like previous: "Disconnect" is a secondary button, "Send key" is a menu.
405cdb1
to
418cf49
Compare
// a pending shutdown. | ||
// | ||
if (inactive_vnc.port != "-1" && active_vnc.port != inactive_vnc.port) | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added line is not executed by any test.
return true; | ||
|
||
if (active_vnc.password != inactive_vnc.password) | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added line is not executed by any test.
repeaterID = '', | ||
vncLogging = 'warn', | ||
consoleContainerId, | ||
onDisconnected = () => {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added line is not executed by any test.
(e) => { | ||
onSecurityFailure(e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 2 added lines are not executed by any test.
}, [rfb, _onDisconnected, _onSecurityFailure]); | ||
|
||
const connect = React.useCallback(() => { | ||
const protocol = encrypt ? 'wss' : 'ws'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added line is not executed by any test.
{ applyError && | ||
<ModalError dialogError={applyError} dialogErrorDetail={applyErrorDetail} /> | ||
} | ||
<Form onSubmit={e => e.preventDefault()} isHorizontal> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added line is not executed by any test.
.catch(ex => onAddErrorNotification({ | ||
text: cockpit.format(_("Failed to send key Ctrl+Alt+$0 to VM $1"), keyName, vm.name), | ||
detail: ex.message, | ||
resourceId: vm.id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 4 added lines are not executed by any test.
{ state.connected | ||
? <VncConsole | ||
host={window.location.hostname} | ||
port={window.location.port || (encrypt ? '443' : '80')} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added line is not executed by any test.
encrypt={encrypt} | ||
shared | ||
credentials={this.credentials} | ||
vncLogging={ window.debugging?.includes("vnc") ? 'debug' : 'warn' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added line is not executed by any test.
.catch(ex => onAddErrorNotification({ | ||
text: cockpit.format(_("Failed to add VNC to VM $0"), vm.name), | ||
detail: ex.message, | ||
resourceId: vm.id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 4 added lines are not executed by any test.
Oh no, the tests have entered flake town... |
COCKPIT-1225
Demo: https://www.youtube.com/watch?v=PHHoSxs70Ho
<MoreInformationInstallVariant os="SLE, openSUSE" content="sudo zypper install virt-viewer" />
.