@@ -4,7 +4,7 @@ import DebugModal from "@components/modal/DebugModal";
44import Rest from "@rest/Rest.tsx" ;
55import { Table } from "react-bootstrap" ;
66import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" ;
7- import { faSearch } from "@fortawesome/free-solid-svg-icons" ;
7+ import { faSearch , faEdit } from "@fortawesome/free-solid-svg-icons" ;
88import { Link } from "react-router-dom" ;
99import dayjs from "dayjs" ;
1010import Loading from "@components/Loading" ;
@@ -33,25 +33,55 @@ const ExecutionsPage = () => {
3333 < tr >
3434 < th > ID</ th >
3535 < th > Started</ th >
36+ < th > Completed</ th >
3637 < th > Modules Executed</ th >
38+ < th > Status</ th >
39+ < th > Function Name</ th >
40+ < th > Script Name</ th >
3741 < th > Action</ th >
42+ < th > Edit</ th >
3843 </ tr >
3944 </ thead >
4045 < tbody style = { { textAlign : "center" } } >
4146 { data
4247 . filter ( ( v ) => v !== null )
4348 . map ( ( data , key ) => {
44- const executionId = data . id . split ( "/" ) . pop ( ) ;
49+ const executionId = data . id ? .split ( "/" ) . pop ( ) ?? "—" ;
4550 return (
4651 < tr key = { key } >
47- < td > { executionId } </ td >
48- < td > { dayjs ( data . has_pipepline_execution_date ) . format ( "YYYY-MM-DD HH:mm:ss.SSS" ) } </ td >
49- < td > { data . has_module_executions . length } </ td >
52+ < td >
53+ < span
54+ style = { { cursor : "pointer" , color : "#007bff" , textDecoration : "underline" } }
55+ onClick = { ( ) => openJsonInNewTab ( data ) }
56+ title = "Открыть JSON"
57+ >
58+ { executionId }
59+ </ span >
60+ </ td >
61+ < td >
62+ { data . has_pipepline_execution_date
63+ ? dayjs ( data . has_pipepline_execution_date ) . format ( "YYYY-MM-DD HH:mm:ss.SSS" )
64+ : "—" }
65+ </ td >
66+ < td >
67+ { data . has_pipeline_execution_finish_date
68+ ? dayjs ( data . has_pipeline_execution_finish_date ) . format ( "YYYY-MM-DD HH:mm:ss.SSS" )
69+ : "—" }
70+ </ td >
71+ < td > { data . has_module_executions ?. length ?? 0 } </ td >
72+ < td > { data . has_pipeline_execution_status ?? "STARTED" } </ td >
73+ < td > { data . has_executed_function_name ?? "—" } </ td >
74+ < td > { data . has_pipeline_name ?? "—" } </ td >
5075 < td >
5176 < Link to = { `/execution?id=${ executionId } ` } >
5277 < FontAwesomeIcon icon = { faSearch } />
5378 </ Link >
5479 </ td >
80+ < td >
81+ < Link to = { `/script?file=${ data . has_executed_function_script_path } ` } >
82+ < FontAwesomeIcon icon = { faEdit } />
83+ </ Link >
84+ </ td >
5585 </ tr >
5686 ) ;
5787 } ) }
@@ -61,4 +91,12 @@ const ExecutionsPage = () => {
6191 ) ;
6292} ;
6393
94+ const openJsonInNewTab = ( jsonData ) => {
95+ const jsonString = JSON . stringify ( jsonData , null , 2 ) ;
96+ const newWindow = window . open ( ) ;
97+ newWindow . document . open ( ) ;
98+ newWindow . document . write ( "<html><body><pre>" + jsonString + "</pre></body></html>" ) ;
99+ newWindow . document . close ( ) ;
100+ } ;
101+
64102export default ExecutionsPage ;
0 commit comments