diff --git a/src/common.tsx b/src/common.tsx index a3f6772..5a94c2d 100644 --- a/src/common.tsx +++ b/src/common.tsx @@ -17,6 +17,7 @@ import MenuItem from '@mui/material/MenuItem'; import MenuList from '@mui/material/MenuList'; import { Permission } from "./actions"; import TerminalComponent from "./terminal"; +import ReactDOM from "react-dom/client"; export const apiAuthenticatedContext: Context<[boolean, Dispatch]> = createContext([false, (value: boolean) => {}] as [boolean, Dispatch]) @@ -264,6 +265,16 @@ export function ActionItem(p: { action: ActionInfo, identifierSubstring?: string setFormData(args.formData) } + function createTerminal(websocket: string){ + const window = open('', '', 'width=800 height=600')! + window.document.write('
') + + const root = ReactDOM.createRoot( + window.document.getElementById('root') as HTMLElement + ); + root.render() + } + return (<>
+ return
}; export default TerminalComponent;