File tree Expand file tree Collapse file tree 3 files changed +30
-14
lines changed Expand file tree Collapse file tree 3 files changed +30
-14
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,13 @@ export default function Example() {
27
27
result = 'Processing...' ;
28
28
}
29
29
if ( jobData ) {
30
- result = < Result status = { jobData . status } output = { jobData . output } > </ Result > ;
30
+ result = (
31
+ < Result
32
+ status = { jobData . status }
33
+ stdout = { jobData . stdout }
34
+ stderr = { jobData . stderr }
35
+ > </ Result >
36
+ ) ;
31
37
}
32
38
33
39
return (
@@ -46,7 +52,8 @@ export default function Example() {
46
52
</ div >
47
53
</ div >
48
54
< button
49
- className = "bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"
55
+ type = "button"
56
+ className = "inline-flex items-center px-4 py-2 border border-transparent text-base leading-6 bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded transition ease-in-out duration-150"
50
57
onClick = { ( ) => {
51
58
mutate ( editorRef . current . getValue ( ) ) ;
52
59
} }
Original file line number Diff line number Diff line change @@ -2,14 +2,20 @@ import React from 'react';
2
2
3
3
interface LayoutProps {
4
4
status : string ;
5
- output ?: string ;
5
+ stdout ?: string ;
6
+ stderr ?: string ;
6
7
}
7
8
8
- const Result : React . FC < LayoutProps > = ( { status, output } ) => {
9
+ const Result : React . FC < LayoutProps > = ( { status, stdout , stderr } ) => {
9
10
return (
10
11
< div >
11
- < h2 > { status } </ h2 >
12
- < pre > { output } </ pre >
12
+ < b > Status: </ b >
13
+ { status }
14
+ < br />
15
+ < b > Stdout: </ b >
16
+ < pre > { stdout } </ pre >
17
+ < b > Stderr: </ b >
18
+ < pre > { stderr } </ pre >
13
19
</ div >
14
20
) ;
15
21
} ;
Original file line number Diff line number Diff line change @@ -52,15 +52,18 @@ function useProcessInterval({
52
52
const { isLoading, data } = useQuery (
53
53
[ 'processProgress' , token , processId ] ,
54
54
async ( ) => {
55
- const res : AxiosResponse < { status : string ; output : string } > =
56
- await axios . get (
57
- `${ process . env . REACT_APP_API_ENDPOINT } /submissions/${ processId } ` ,
58
- {
59
- headers : {
60
- Authorization : `Bearer ${ token } ` ,
61
- } ,
55
+ const res : AxiosResponse < {
56
+ status : string ;
57
+ stdout : string ;
58
+ stderr : string ;
59
+ } > = await axios . get (
60
+ `${ process . env . REACT_APP_API_ENDPOINT } /submissions/${ processId } ` ,
61
+ {
62
+ headers : {
63
+ Authorization : `Bearer ${ token } ` ,
62
64
} ,
63
- ) ;
65
+ } ,
66
+ ) ;
64
67
return res . data ;
65
68
} ,
66
69
{
You can’t perform that action at this time.
0 commit comments