Commit a87517cf authored by Lijiao's avatar Lijiao Committed by fishyds
Browse files

Add download button (#332)

parent 8f7dfc88
import * as React from 'react'; import * as React from 'react';
import axios from 'axios'; import axios from 'axios';
import { Row, Col } from 'antd'; import { Row, Col, Button } from 'antd';
import { MANAGER_IP } from '../static/const'; import { MANAGER_IP } from '../static/const';
import { import {
Experiment, TableObj, Experiment, TableObj,
...@@ -31,6 +31,7 @@ interface SessionState { ...@@ -31,6 +31,7 @@ interface SessionState {
bestAccuracy: string; bestAccuracy: string;
accNodata: string; accNodata: string;
trialNumber: TrialNumber; trialNumber: TrialNumber;
downBool: boolean;
} }
class Overview extends React.Component<{}, SessionState> { class Overview extends React.Component<{}, SessionState> {
...@@ -81,7 +82,8 @@ class Overview extends React.Component<{}, SessionState> { ...@@ -81,7 +82,8 @@ class Overview extends React.Component<{}, SessionState> {
runTrial: 0, runTrial: 0,
unknowTrial: 0, unknowTrial: 0,
totalCurrentTrial: 0 totalCurrentTrial: 0
} },
downBool: false
}; };
} }
...@@ -263,6 +265,9 @@ class Overview extends React.Component<{}, SessionState> { ...@@ -263,6 +265,9 @@ class Overview extends React.Component<{}, SessionState> {
} }
downExperimentContent = () => { downExperimentContent = () => {
this.setState(() => ({
downBool: true
}));
axios axios
.all([ .all([
axios.get(`${MANAGER_IP}/experiment`), axios.get(`${MANAGER_IP}/experiment`),
...@@ -307,6 +312,9 @@ class Overview extends React.Component<{}, SessionState> { ...@@ -307,6 +312,9 @@ class Overview extends React.Component<{}, SessionState> {
eventMouse.initEvent('click', false, false); eventMouse.initEvent('click', false, false);
downTag.dispatchEvent(eventMouse); downTag.dispatchEvent(eventMouse);
} }
this.setState(() => ({
downBool: false
}));
} }
})); }));
} }
...@@ -389,14 +397,28 @@ class Overview extends React.Component<{}, SessionState> { ...@@ -389,14 +397,28 @@ class Overview extends React.Component<{}, SessionState> {
accNodata, accNodata,
status, status,
trialNumber, trialNumber,
bestAccuracy bestAccuracy,
downBool
} = this.state; } = this.state;
return ( return (
<div className="overview"> <div className="overview">
{/* status and experiment block */} {/* status and experiment block */}
<Row className="basicExperiment"> <Row>
<Title1 text="Experiment" icon="11.png" /> <Row className="exbgcolor">
<Col span={4}><Title1 text="Experiment" icon="11.png" /></Col>
<Col span={4}>
<Button
type="primary"
className="changeBtu download"
onClick={this.downExperimentContent}
disabled={downBool}
>
<span>Download</span>
<img src={require('../static/img/icon/download.png')} alt="icon" />
</Button>
</Col>
</Row>
<BasicInfo trialProfile={trialProfile} status={status} /> <BasicInfo trialProfile={trialProfile} status={status} />
</Row> </Row>
<Row className="overMessage"> <Row className="overMessage">
......
...@@ -52,7 +52,7 @@ class BasicInfo extends React.Component<BasicInfoProps, {}> { ...@@ -52,7 +52,7 @@ class BasicInfo extends React.Component<BasicInfoProps, {}> {
</Col> </Col>
<Col span={8} className="padItem basic"> <Col span={8} className="padItem basic">
<p>LogPath</p> <p>LogPath</p>
<div className="logPath"> <div className="nowrap">
<Tooltip placement="top" title={trialProfile.logDir}> <Tooltip placement="top" title={trialProfile.logDir}>
{trialProfile.logDir} {trialProfile.logDir}
</Tooltip> </Tooltip>
......
...@@ -23,7 +23,7 @@ class TrialInfo extends React.Component<TrialInfoProps, {}> { ...@@ -23,7 +23,7 @@ class TrialInfo extends React.Component<TrialInfoProps, {}> {
clusterMetaData: tiralProInfo.clusterMetaData ? tiralProInfo.clusterMetaData : undefined clusterMetaData: tiralProInfo.clusterMetaData ? tiralProInfo.clusterMetaData : undefined
}); });
return ( return (
<div style={{ paddingLeft: 20 }}> <div className="profile">
<pre> <pre>
{JSON.stringify(showProInfo[0], null, 4)} {JSON.stringify(showProInfo[0], null, 4)}
</pre> </pre>
......
...@@ -49,9 +49,6 @@ table { ...@@ -49,9 +49,6 @@ table {
border-collapse: collapse; border-collapse: collapse;
border-spacing: 0; border-spacing: 0;
} }
pre{
overflow: hidden;
}
@font-face { @font-face {
font-family: 'Segoe'; font-family: 'Segoe';
src: url('./static/font/SegoePro-Regular.ttf'); src: url('./static/font/SegoePro-Regular.ttf');
......
.logpath{ .logpath{
margin-bottom: 10px;
margin-left: 10px; margin-left: 10px;
.logName{ .logName{
......
...@@ -44,3 +44,36 @@ ...@@ -44,3 +44,36 @@
.main{ .main{
margin: 9px 0; margin: 9px 0;
} }
.profile{
padding: 0 20px;
pre{
overflow: inherit;
}
}
.exbgcolor {
background: #b3b3b3;
.download{
height: 30px;
border: 1px solid #fff;
border-radius: 0;
margin-top: 4px;
span{
font-family: 'Segoe';
font-size: 16px;
line-height: 30px;
}
img{
height: 16px;
margin-left: 10px;
margin-top: -6px;
}
}
}
.exbgcolor .download:hover{
border: 1px solid #fff;
}
\ No newline at end of file
...@@ -74,9 +74,9 @@ ...@@ -74,9 +74,9 @@
.mess{ .mess{
margin: 10px 0; margin: 10px 0;
} }
/*
.ant-tooltip-inner{ .ant-tooltip-inner{
white-space: nowrap;
min-width: 300px; min-width: 300px;
} }
*/
...@@ -89,6 +89,8 @@ pre.hyperpar{ ...@@ -89,6 +89,8 @@ pre.hyperpar{
text-align: left; text-align: left;
line-height: 18px; line-height: 18px;
font-size: 14px; font-size: 14px;
overflow: hidden;
margin-bottom: 10px;
} }
/* the position of the pagination */ /* the position of the pagination */
......
/* status bgcolor */
/*
.commonStyle{
border-radius: 3px;
color: white;
}
.RUNNING{
padding: 3px 8px;
background: #3c8dbc;
}
.FAILED{
padding: 3px 24px;
background: #dd4b39;
}
.USER_CANCELED{
padding: 3px 8px;
background: #FF4500;
}
.SUCCEEDED{
padding: 3px 6px;
background: #00a65a;
}
.UNKNOWN{
padding: 3px 15px;
background: #FF8C00;
}
.SYS_CANCELED{
padding: 3px 24px;
background: red;
}
.WAITING{
padding: 3px 24px;
background: #008B8B;
}
*/
.RUNNING{ .RUNNING{
color: #3c8dbc; color: #3c8dbc;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment