From 729a35c6961dda8454cc0cf04530749c6975fa6d Mon Sep 17 00:00:00 2001 From: BradHacker <harkerbd@gmail.com> Date: Mon, 10 Feb 2025 18:35:25 -0500 Subject: [PATCH 1/2] Add warning to openstack serial console component --- .../components/console/openstack/serial.tsx | 22 ++++++++++++++++++- ui/src/pages/console/index.tsx | 6 ++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/ui/src/components/console/openstack/serial.tsx b/ui/src/components/console/openstack/serial.tsx index 75b1244..0cccb45 100644 --- a/ui/src/components/console/openstack/serial.tsx +++ b/ui/src/components/console/openstack/serial.tsx @@ -2,6 +2,8 @@ import { useEffect } from 'react' import { useXTerm } from 'react-xtermjs' import { FitAddon } from '@xterm/addon-fit' import { WebLinksAddon } from '@xterm/addon-web-links' +import { Box, Typography } from '@mui/material' +import { WarningAmber } from '@mui/icons-material' import '@xterm/xterm/css/xterm.css' @@ -77,5 +79,23 @@ export default function OpenStackSerial({ } }, [term, consoleUrl]) - return <div ref={termRef} style={{ width: '100%', height: '100%' }}></div> + return ( + <Box + sx={{ + width: '100%', + flexGrow: '1', + display: 'flex', + flexDirection: 'column', + }} + > + <Typography + sx={{ color: '#ea9a97', display: 'flex', gap: 1, padding: 1 }} + > + <WarningAmber /> Warning: Only one user can use the serial console at a + time. Additional users will see a blank console until the first + disconnects. + </Typography> + <div ref={termRef} style={{ flexGrow: '1' }}></div> + </Box> + ) } diff --git a/ui/src/pages/console/index.tsx b/ui/src/pages/console/index.tsx index c791af3..2187f16 100644 --- a/ui/src/pages/console/index.tsx +++ b/ui/src/pages/console/index.tsx @@ -404,6 +404,7 @@ export const ConsolePage: React.FC = (): React.ReactElement => { return ( <Container + maxWidth={false} component="main" sx={{ p: 2, @@ -436,7 +437,10 @@ export const ConsolePage: React.FC = (): React.ReactElement => { flexDirection: 'column', }} > - <Typography variant="h5"> + <Typography + variant="h5" + sx={{ display: 'flex', alignItems: 'center' }} + > <FiberManualRecord sx={{ height: '1rem', -- GitLab From 41c742cd2a84e55c81d4518519997610fd7f8750 Mon Sep 17 00:00:00 2001 From: BradHacker <harkerbd@gmail.com> Date: Mon, 10 Feb 2025 18:38:49 -0500 Subject: [PATCH 2/2] Set go version in go.mod properly --- go.mod | 3 +-- go.sum | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 9a4ce6d..bdf12a2 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/BradHacker/compsole -go 1.23.0 +go 1.23 toolchain go1.23.3 @@ -99,5 +99,4 @@ require ( google.golang.org/protobuf v1.35.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect ) diff --git a/go.sum b/go.sum index 7e9731b..a8b2556 100644 --- a/go.sum +++ b/go.sum @@ -1238,7 +1238,5 @@ nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYm rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= sourcegraph.com/sourcegraph/appdash-data v0.0.0-20151005221446-73f23eafcf67/go.mod h1:L5q+DGLGOQFpo1snNEkLOJT2d1YTW66rWNzatr3He1k= -- GitLab