fix VNC terminal

This commit is contained in:
2022-03-03 09:42:45 -05:00
parent c2dde042b7
commit 4e32048cca
2 changed files with 5 additions and 6 deletions
+4 -5
View File
@@ -11,7 +11,7 @@ const BlackBox = styled("div", {
}); });
const Monospace = styled("pre", { const Monospace = styled("pre", {
display: "block", display: "inline",
margin: 0, margin: 0,
lineHeight: 1.75, lineHeight: 1.75,
fontSize: "0.925em", fontSize: "0.925em",
@@ -25,6 +25,7 @@ const Underscore = styled("span", {
display: "inline-block", display: "inline-block",
verticalAlign: "text-bottom", verticalAlign: "text-bottom",
width: "10px", width: "10px",
margin: "0 4px",
borderBottom: "2px solid #cccccc", borderBottom: "2px solid #cccccc",
// blink every second for 0.4s // blink every second for 0.4s
@@ -34,12 +35,10 @@ const Underscore = styled("span", {
export type TerminalProps = ComponentProps<typeof BlackBox>; export type TerminalProps = ComponentProps<typeof BlackBox>;
// a DOS-style terminal box with dynamic text // a DOS-style terminal box with dynamic text
const Terminal = forwardRef(function Terminal({ ...rest }: TerminalProps, ref: Ref<HTMLSpanElement>) { const Terminal = forwardRef(function Terminal({ ...rest }: TerminalProps, ref: Ref<HTMLPreElement>) {
return ( return (
<BlackBox {...rest}> <BlackBox {...rest}>
<Monospace> <Monospace ref={ref} /> <Underscore />
<span ref={ref} /> <Underscore />
</Monospace>
</BlackBox> </BlackBox>
); );
}); });
+1 -1
View File
@@ -49,7 +49,7 @@ const VNC = ({ server }: VNCProps) => {
const [loaded, setLoaded] = useState(false); const [loaded, setLoaded] = useState(false);
// DOS-style box for text // DOS-style box for text
const terminalRef = useRef<HTMLSpanElement>(null); const terminalRef = useRef<HTMLPreElement>(null);
// the actual connection and virtual screen (injected by noVNC when it's ready) // the actual connection and virtual screen (injected by noVNC when it's ready)
const rfbRef = useRef(null); const rfbRef = useRef(null);