Commit 45484bfb authored by Lijiao's avatar Lijiao Committed by fishyds
Browse files

Remove intermediate result (#410)

parent cf3d434f
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
"react": "^16.4.2", "react": "^16.4.2",
"react-dom": "^16.4.2", "react-dom": "^16.4.2",
"react-json-tree": "^0.11.0", "react-json-tree": "^0.11.0",
"react-monaco-editor": "^0.22.0",
"react-router": "3.2.1", "react-router": "3.2.1",
"react-scripts-ts-antd": "2.17.0" "react-scripts-ts-antd": "2.17.0"
}, },
......
...@@ -73,9 +73,9 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> { ...@@ -73,9 +73,9 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
enterable: true, enterable: true,
position: function (point: Array<number>, data: TooltipForAccuracy) { position: function (point: Array<number>, data: TooltipForAccuracy) {
if (data.data[0] < resultList.length / 2) { if (data.data[0] < resultList.length / 2) {
return [point[0], 10]; return [point[0], 80];
} else { } else {
return [point[0] - 300, 10]; return [point[0] - 300, 80];
} }
}, },
formatter: function (data: TooltipForAccuracy) { formatter: function (data: TooltipForAccuracy) {
...@@ -121,15 +121,10 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> { ...@@ -121,15 +121,10 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
drawTableList = () => { drawTableList = () => {
axios axios.get(`${MANAGER_IP}/trial-jobs`)
.all([ .then(res => {
axios.get(`${MANAGER_IP}/trial-jobs`), if (res.status === 200) {
axios.get(`${MANAGER_IP}/metric-data`)
])
.then(axios.spread((res, res1) => {
if (res.status === 200 && res1.status === 200) {
const trialJobs = res.data; const trialJobs = res.data;
const metricSource = res1.data;
const trialTable: Array<TableObj> = []; const trialTable: Array<TableObj> = [];
Object.keys(trialJobs).map(item => { Object.keys(trialJobs).map(item => {
// only succeeded trials have finalMetricData // only succeeded trials have finalMetricData
...@@ -165,14 +160,6 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> { ...@@ -165,14 +160,6 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
desc.isLink = true; desc.isLink = true;
} }
} }
let mediate: Array<string> = [];
Object.keys(metricSource).map(key => {
const items = metricSource[key];
if (items.trialJobId === id) {
mediate.push(items.data);
}
});
desc.intermediate = mediate;
const acc = getFinalResult(trialJobs[item].finalMetricData); const acc = getFinalResult(trialJobs[item].finalMetricData);
trialTable.push({ trialTable.push({
key: trialTable.length, key: trialTable.length,
...@@ -191,7 +178,7 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> { ...@@ -191,7 +178,7 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
})); }));
} }
} }
})); });
} }
callback = (key: string) => { callback = (key: string) => {
......
import * as React from 'react'; import * as React from 'react';
import MonacoEditor from 'react-monaco-editor';
import { MONACO } from '../../static/const';
interface SearchspaceProps { interface SearchspaceProps {
searchSpace: object; searchSpace: object;
...@@ -14,9 +16,16 @@ class SearchSpace extends React.Component<SearchspaceProps, {}> { ...@@ -14,9 +16,16 @@ class SearchSpace extends React.Component<SearchspaceProps, {}> {
render() { render() {
const { searchSpace } = this.props; const { searchSpace } = this.props;
return ( return (
<pre className="experiment searchSpace" style={{paddingLeft: 20}}> <div className="searchSpace">
{JSON.stringify(searchSpace, null, 4)} <MonacoEditor
</pre> width="100%"
height="380"
language="json"
theme="vs-light"
value={JSON.stringify(searchSpace, null, 2)}
options={MONACO}
/>
</div>
); );
} }
} }
......
import * as React from 'react'; import * as React from 'react';
import { Experiment } from '../../static/interface'; import { Experiment } from '../../static/interface';
import MonacoEditor from 'react-monaco-editor';
import { MONACO } from '../../static/const';
interface TrialInfoProps { interface TrialInfoProps {
tiralProInfo: Experiment; tiralProInfo: Experiment;
...@@ -25,9 +27,14 @@ class TrialInfo extends React.Component<TrialInfoProps, {}> { ...@@ -25,9 +27,14 @@ class TrialInfo extends React.Component<TrialInfoProps, {}> {
}); });
return ( return (
<div className="profile"> <div className="profile">
<pre> <MonacoEditor
{JSON.stringify(showProInfo[0], null, 4)} width="100%"
</pre> height="386"
language="json"
theme="vs-light"
value={JSON.stringify(showProInfo[0], null, 2)}
options={MONACO}
/>
</div> </div>
); );
} }
......
...@@ -305,11 +305,6 @@ class TableList extends React.Component<TableListProps, TableListState> { ...@@ -305,11 +305,6 @@ class TableList extends React.Component<TableListProps, TableListState> {
const parametersRow = { const parametersRow = {
parameters: record.description.parameters parameters: record.description.parameters
}; };
const intermediate = record.description.intermediate;
let showIntermediate = '';
if (intermediate && intermediate.length > 0) {
showIntermediate = intermediate.join(', ');
}
let isLogLink: boolean = false; let isLogLink: boolean = false;
const logPathRow = record.description.logPath; const logPathRow = record.description.logPath;
if (record.description.isLink !== undefined) { if (record.description.isLink !== undefined) {
...@@ -345,10 +340,6 @@ class TableList extends React.Component<TableListProps, TableListState> { ...@@ -345,10 +340,6 @@ class TableList extends React.Component<TableListProps, TableListState> {
<span className="logContent">{logPathRow}</span> <span className="logContent">{logPathRow}</span>
</div> </div>
} }
<Row className="intermediate logpath">
<span className="logName">Intermediate Result:</span>
{showIntermediate}
</Row>
</pre> </pre>
); );
}; };
......
...@@ -14,3 +14,7 @@ export const CONTROLTYPE = [ ...@@ -14,3 +14,7 @@ export const CONTROLTYPE = [
'TRIAL_CONCURRENCY', 'TRIAL_CONCURRENCY',
'MAX_EXEC_DURATION' 'MAX_EXEC_DURATION'
]; ];
export const MONACO = {
readOnly: true,
automaticLayout: true
};
...@@ -20,7 +20,3 @@ ...@@ -20,7 +20,3 @@
text-decoration: underline; text-decoration: underline;
} }
.intermediate{
white-space: normal;
font-size: 14px;
}
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
height: 386px; height: 386px;
line-height: 22px; line-height: 22px;
font-size: 14px; font-size: 14px;
overflow-y: scroll;
padding: 15px 0; padding: 15px 0;
color: #212121; color: #212121;
} }
...@@ -46,7 +45,6 @@ ...@@ -46,7 +45,6 @@
} }
.profile{ .profile{
padding: 0 20px;
pre{ pre{
overflow: inherit; overflow: inherit;
} }
......
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