-
Notifications
You must be signed in to change notification settings - Fork 84
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: Redesign #2008
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
a192cf0
to
5c63980
Compare
The move to PF6 makes this more important. React-console 6.0.0 uses inline CSS and generated class names, both of which is problematic for us. |
5c63980
to
aeb7548
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.
if (app.startsWith("cockpit+=")) { | ||
address = app.substr(9); |
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.
.catch(ex => onAddErrorNotification({ | ||
text: cockpit.format(_("Failed to add text console 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.
} | ||
|
||
export function useStateObject(constructor, deps, comps) { | ||
const state = useObject(constructor, obj => obj.close(), deps || [], comps); |
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.
Except the console.
- Remove "isClickable" and "isSelectable" from all Cards. Only two of our cards are actually clickable, and they contain buttons which conflicts with the "isClickable" property. For those, we remove all card clickability and force people to click on the buttons only. This gives all Cards a border. - Remove the border of the "main" Cards of a page by making them "plain". This is the lists of VMs, storage pools, and networks.
This is unsatisfying because of the way react-console styles itself now: - It generates class names at run time. - It inserts <style> elements into the DOM, which would force us to open up our Content-Security-Policy via "style-src-elem 'unsafe-inline'". Instead, we have a copy of their CSS in our code. That way, we can also apply some bug fixes more cleanly. We should stop using react-console eventually.
So that we have a single place to style them.
They should extend to the edges of the card, not have a line after the last row, but do have a line after the header.
45f1f50
to
cf185c5
Compare
cf185c5
to
4858e67
Compare
- 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.
4858e67
to
2d97cff
Compare
Design: #2074
Demo: https://www.youtube.com/watch?v=Y3Q3QcBU8vs
Questions:
The demo has outdated placements of some UI elements to get more space for the expanded console (and to follow the original mockup more closely):
Up-to-date screenshots: