rdesktop^2
bunsenstraat 1 year ago
parent 15d1a0189c
commit a2d511d445
  1. 4
      apps/1test/src/remix/ui/remix-ui-xterm.tsx
  2. 7
      apps/1test/src/remix/ui/remix-ui-xterminals.tsx

@ -16,10 +16,6 @@ const RemixUiXterm = (props: RemixUiXtermProps) => {
const { plugin, pid, send, data, timeStamp } = props const { plugin, pid, send, data, timeStamp } = props
const xtermRef = React.useRef(null) const xtermRef = React.useRef(null)
useEffect(() => {
console.log('remix-ui-xterm', pid)
}, [timeStamp])
useEffect(() => { useEffect(() => {
console.log('remix-ui-xterm ref', xtermRef.current) console.log('remix-ui-xterm ref', xtermRef.current)
props.setTerminalRef(pid, xtermRef.current) props.setTerminalRef(pid, xtermRef.current)

@ -19,17 +19,12 @@ export const RemixUiXterminals = (props: RemixUiXterminalsProps) => {
useEffect(() => { useEffect(() => {
plugin.on('xterm', 'loaded', async () => { plugin.on('xterm', 'loaded', async () => {
console.log('xterms loaded')
}) })
plugin.on('xterm', 'data', async (data: string, pid: number) => { plugin.on('xterm', 'data', async (data: string, pid: number) => {
console.log('xterm data', data, pid)
writeToTerminal(data, pid) writeToTerminal(data, pid)
}) })
plugin.on('xterm', 'close', async (pid: number) => { plugin.on('xterm', 'close', async (pid: number) => {
console.log('xterm close', pid)
setTerminals(prevState => { setTerminals(prevState => {
return prevState.filter(xtermState => xtermState.pid !== pid) return prevState.filter(xtermState => xtermState.pid !== pid)
}) })
@ -52,13 +47,11 @@ export const RemixUiXterminals = (props: RemixUiXterminalsProps) => {
}, [terminals]) }, [terminals])
const send = (data: string, pid: number) => { const send = (data: string, pid: number) => {
console.log('send', data)
plugin.call('xterm', 'keystroke', data, pid) plugin.call('xterm', 'keystroke', data, pid)
} }
const createTerminal = async () => { const createTerminal = async () => {
const pid = await plugin.call('xterm', 'createTerminal') const pid = await plugin.call('xterm', 'createTerminal')
console.log('pid', pid)
setTerminals(prevState => { setTerminals(prevState => {
return [...prevState, { return [...prevState, {

Loading…
Cancel
Save