File tree Expand file tree Collapse file tree 3 files changed +61
-0
lines changed
Expand file tree Collapse file tree 3 files changed +61
-0
lines changed Original file line number Diff line number Diff line change 1+ .terminal-container {
2+ width : 100% ;
3+ height : 100% ;
4+ display : flex ;
5+ flex-direction : column ;
6+ overflow : hidden ;
7+ }
8+
9+ .terminal-iframe {
10+ flex : 1 ;
11+ background-color : #1e1e1e ;
12+ height : 100% ;
13+ width : 100% ;
14+ border : 0px !important ;
15+ overflow : hidden ;
16+ border-bottom-left-radius : var (--embeddable-radius );
17+ border-bottom-right-radius : var (--embeddable-radius );
18+ }
Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+ import { useWorkspaceState } from '../../api/hooks' ;
3+ import type { NonDeleted , ExcalidrawEmbeddableElement } from '@atyrode/excalidraw/element/types' ;
4+ import type { AppState } from '@atyrode/excalidraw/types' ;
5+ import './Terminal.scss' ;
6+
7+ interface TerminalProps {
8+ element : NonDeleted < ExcalidrawEmbeddableElement > ;
9+ appState : AppState ;
10+ excalidrawAPI ?: any ;
11+ }
12+
13+ export const Terminal : React . FC < TerminalProps > = ( {
14+ element,
15+ appState,
16+ excalidrawAPI
17+ } ) => {
18+ const { data : workspaceState } = useWorkspaceState ( ) ;
19+
20+ const getTerminalUrl = ( ) => {
21+ if ( ! workspaceState ) {
22+ return 'https://terminal.example.dev' ;
23+ }
24+
25+ return `${ workspaceState . base_url } /@${ workspaceState . username } /${ workspaceState . workspace_id } .${ workspaceState . agent } /terminal` ;
26+ } ;
27+
28+ const terminalUrl = getTerminalUrl ( ) ;
29+
30+ return (
31+ < div className = "terminal-container" >
32+ < iframe
33+ className = "terminal-iframe"
34+ src = { terminalUrl }
35+ title = "Terminal"
36+ />
37+ </ div >
38+ ) ;
39+ } ;
40+
41+ export default Terminal ;
Original file line number Diff line number Diff line change 22export * from './controls/ControlButton' ;
33export * from './controls/StateIndicator' ;
44export * from './containers/Dashboard' ;
5+ export * from './containers/Terminal' ;
56export * from './buttons' ;
67export * from './editors' ;
78
89// Default exports
910export { default as ControlButton } from './controls/ControlButton' ;
1011export { default as StateIndicator } from './controls/StateIndicator' ;
1112export { default as Dashboard } from './containers/Dashboard' ;
13+ export { default as Terminal } from './containers/Terminal' ;
You can’t perform that action at this time.
0 commit comments