@@ -3,25 +3,32 @@ import { invoke } from "@tauri-apps/api/core"
33import { Terminal } from "@xterm/xterm"
44import { FitAddon } from "@xterm/addon-fit"
55import { ClipboardAddon } from "@xterm/addon-clipboard"
6+ import { CodeEditor , Language } from "@patternfly/react-code-editor"
67import {
78 Button ,
8- Panel ,
9- PanelHeader ,
10- PanelMain ,
11- PanelMainBody ,
9+ Card ,
10+ CardBody ,
11+ CardHeader ,
12+ CardTitle ,
1213 PageSection ,
13- Split ,
14- SplitItem ,
14+ Flex ,
15+ FlexItem ,
1516 TextArea ,
1617 Toolbar ,
18+ ToolbarContent ,
1719 ToolbarItem ,
1820} from "@patternfly/react-core"
1921
2022import Page from "./Page"
21- import "../view/term/RunTerminal .css"
23+ import "./Run .css"
2224
2325export default function Run ( ) {
24- const [ input , setInput ] = useState ( "" )
26+ const [ input , setInput ] = useState ( `text:
27+ - text:
28+ - '{"key": "value"}'
29+ parser: json
30+ def: foo
31+ - \${ foo.key }` )
2532 const [ error , setError ] = useState ( false )
2633
2734 const ref = createRef < HTMLDivElement > ( )
@@ -34,7 +41,6 @@ export default function Run() {
3441 const term = new Terminal ( {
3542 fontFamily :
3643 '"Red Hat Mono", RedHatMono, "Courier New", Courier, monospace' ,
37- fontSize : 12 ,
3844 convertEol : true ,
3945 } )
4046 setTerm ( term )
@@ -77,49 +83,55 @@ export default function Run() {
7783
7884 return (
7985 < Page breadcrumb1 = "Run" >
80- < PageSection >
81- < Split hasGutter >
82- < SplitItem isFilled >
83- < Panel >
84- < PanelHeader > Program</ PanelHeader >
85- < PanelMain >
86- < PanelMainBody >
87- < TextArea
86+ < PageSection className = "pdl-run-page-section" >
87+ < Flex >
88+ < FlexItem flex = { { default : "flex_1" } } >
89+ < Card isPlain >
90+ < CardHeader className = "pdl-run-split-item-card-header" >
91+ < CardTitle > Program</ CardTitle >
92+ </ CardHeader >
93+ < CardBody className = "pdl-run-split-item-card-body" >
94+ < div style = { { height : "600px" } } >
95+ < CodeEditor
96+ options = { { fontSize : 16 } }
8897 aria-label = "text area to provide PDL program source"
89- validated = { ! ! error ? "error" : undefined }
90- value = { input }
91- style = { { height : "600px" } }
92- onChange = { ( _event , value ) => {
98+ code = { input }
99+ isDarkTheme
100+ isFullHeight
101+ language = "yaml"
102+ onChange = { ( value ) => {
93103 setError ( null )
94104 setInput ( value )
95105 term . clear ( )
96106 } }
97107 />
98- </ PanelMainBody >
99- </ PanelMain >
100- </ Panel >
101- </ SplitItem >
108+ </ div >
109+ </ CardBody >
110+ </ Card >
111+ </ FlexItem >
102112
103- < SplitItem >
104- < Panel >
105- < PanelHeader > Output </ PanelHeader >
106- < PanelMain >
107- < PanelMainBody >
108- < div
109- className = "pdl-run-terminal"
110- ref = { ref }
111- style = { { height : "600px" } }
112- />
113- </ PanelMainBody >
114- </ PanelMain >
115- </ Panel >
116- </ SplitItem >
117- </ Split >
113+ < FlexItem flex = { { default : "flex_1" } } >
114+ < Card isPlain >
115+ < CardHeader className = "pdl-run-split-item-card-header" >
116+ < CardTitle > Output </ CardTitle >
117+ </ CardHeader >
118+ < CardBody className = "pdl-run-split-item-card-body" >
119+ < div
120+ className = "pdl-run-terminal"
121+ ref = { ref }
122+ style = { { height : "600px" } }
123+ / >
124+ </ CardBody >
125+ </ Card >
126+ </ FlexItem >
127+ </ Flex >
118128
119129 < Toolbar >
120- < ToolbarItem >
121- < Button onClick = { run } > Run</ Button >
122- </ ToolbarItem >
130+ < ToolbarContent >
131+ < ToolbarItem >
132+ < Button onClick = { run } > Run</ Button >
133+ </ ToolbarItem >
134+ </ ToolbarContent >
123135 </ Toolbar >
124136 </ PageSection >
125137 </ Page >
0 commit comments