|
|
@@ -1,5 +1,5 @@
|
|
|
import React from "react";
|
|
|
-import {Divider} from "antd";
|
|
|
+import {Collapse, Divider} from "antd";
|
|
|
import axios from "axios";
|
|
|
import {BACKEND_URL} from "../config";
|
|
|
|
|
|
@@ -28,15 +28,25 @@ class TaskList extends React.Component {
|
|
|
render() {
|
|
|
return (
|
|
|
<div>
|
|
|
- {
|
|
|
- this.props.tasks.map(x => (
|
|
|
- <>
|
|
|
- <h4>{x}</h4>
|
|
|
- <h4>结果: {JSON.stringify(this.state.details[x])}</h4>
|
|
|
- <Divider/>
|
|
|
- </>
|
|
|
- ))
|
|
|
- }
|
|
|
+ <Collapse style={{height: "40%", width: "80%", margin: "0 auto", marginTop: 30}}>
|
|
|
+ {
|
|
|
+ this.props.tasks.map(x => {
|
|
|
+
|
|
|
+ const details = this.state.details[x]
|
|
|
+
|
|
|
+ if (details === undefined) {
|
|
|
+ return <></>;
|
|
|
+ }
|
|
|
+
|
|
|
+ return (
|
|
|
+ <Collapse.Panel header={"任务 ID: " + x} key={x}>
|
|
|
+ <p>状态: {details.status}</p>
|
|
|
+ <p>结果: {JSON.stringify(details.data)}</p>
|
|
|
+ </Collapse.Panel>
|
|
|
+ )
|
|
|
+ })
|
|
|
+ }
|
|
|
+ </Collapse>
|
|
|
</div>
|
|
|
);
|
|
|
}
|