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

Support to show 2 logPath, add hdfsLogPath (#420)

* Support to show 2 logPath

* fix lint

* Update trial status color
parent 02e9fcfc
...@@ -124,7 +124,7 @@ export class PAIJobInfoCollector { ...@@ -124,7 +124,7 @@ export class PAIJobInfoCollector {
} }
// Set pai trial job's url to WebHDFS output path // Set pai trial job's url to WebHDFS output path
if(paiTrialJob.hdfsLogPath) { if(paiTrialJob.hdfsLogPath) {
paiTrialJob.url = paiTrialJob.hdfsLogPath; paiTrialJob.url += `,${paiTrialJob.hdfsLogPath}`;
} }
} }
} }
......
...@@ -225,10 +225,6 @@ class Overview extends React.Component<{}, OverviewState> { ...@@ -225,10 +225,6 @@ class Overview extends React.Component<{}, OverviewState> {
} }
if (tableData[item].logPath !== undefined) { if (tableData[item].logPath !== undefined) {
desJobDetail.logPath = tableData[item].logPath; desJobDetail.logPath = tableData[item].logPath;
const isSessionLink = /^http/gi.test(tableData[item].logPath);
if (isSessionLink) {
desJobDetail.isLink = true;
}
} }
topTableData.push({ topTableData.push({
key: topTableData.length, key: topTableData.length,
......
...@@ -129,8 +129,7 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> { ...@@ -129,8 +129,7 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
Object.keys(trialJobs).map(item => { Object.keys(trialJobs).map(item => {
// only succeeded trials have finalMetricData // only succeeded trials have finalMetricData
let desc: Parameters = { let desc: Parameters = {
parameters: {}, parameters: {}
intermediate: []
}; };
let duration = 0; let duration = 0;
const id = trialJobs[item].id !== undefined const id = trialJobs[item].id !== undefined
...@@ -155,10 +154,6 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> { ...@@ -155,10 +154,6 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
} }
if (trialJobs[item].logPath !== undefined) { if (trialJobs[item].logPath !== undefined) {
desc.logPath = trialJobs[item].logPath; desc.logPath = trialJobs[item].logPath;
const isHyperLink = /^http/gi.test(trialJobs[item].logPath);
if (isHyperLink) {
desc.isLink = true;
}
} }
const acc = getFinalResult(trialJobs[item].finalMetricData); const acc = getFinalResult(trialJobs[item].finalMetricData);
trialTable.push({ trialTable.push({
......
import * as React from 'react';
import LogPathChild from './LogPathChild';
interface LogpathProps {
logStr: string;
}
class LogPath extends React.Component<LogpathProps, {}> {
constructor(props: LogpathProps) {
super(props);
}
render() {
const { logStr } = this.props;
const isTwopath = logStr.indexOf(',') !== -1
?
true
:
false;
return (
<div>
{
isTwopath
?
<div>
<LogPathChild
eachLogpath={logStr.split(',')[0]}
logName="LogPath:"
/>
<LogPathChild
eachLogpath={logStr.split(',')[1]}
logName="hdfsLogPath:"
/>
</div>
:
<LogPathChild
eachLogpath={logStr}
logName="LogPath:"
/>
}
</div>
);
}
}
export default LogPath;
\ No newline at end of file
import * as React from 'react';
interface LogpathChildProps {
eachLogpath: string;
logName: string;
}
class LogPathChild extends React.Component<LogpathChildProps, {}> {
constructor(props: LogpathChildProps) {
super(props);
}
render() {
const { eachLogpath, logName } = this.props;
const isLink = /^http/gi.test(eachLogpath);
return (
<div>
{
isLink
?
<div className="logpath">
<span className="logName">{logName}</span>
<a className="logContent logHref" href={eachLogpath} target="_blank">{eachLogpath}</a>
</div>
:
<div className="logpath">
<span className="logName">{logName}</span>
<span className="logContent">{eachLogpath}</span>
</div>
}
</div>
);
}
}
export default LogPathChild;
...@@ -4,6 +4,7 @@ import { Table } from 'antd'; ...@@ -4,6 +4,7 @@ import { Table } from 'antd';
import { TableObj } from '../../static/interface'; import { TableObj } from '../../static/interface';
import { convertDuration } from '../../static/function'; import { convertDuration } from '../../static/function';
import '../../static/style/tableStatus.css'; import '../../static/style/tableStatus.css';
import LogPath from '../logPath/LogPath';
interface SuccessTableProps { interface SuccessTableProps {
tableSource: Array<TableObj>; tableSource: Array<TableObj>;
...@@ -106,11 +107,11 @@ class SuccessTable extends React.Component<SuccessTableProps, {}> { ...@@ -106,11 +107,11 @@ class SuccessTable extends React.Component<SuccessTableProps, {}> {
const openRowDataSource = { const openRowDataSource = {
parameters: record.description.parameters parameters: record.description.parameters
}; };
let isLogLink: boolean = false; const logPathRow = record.description.logPath !== undefined
const logPathRow = record.description.logPath; ?
if (record.description.isLink !== undefined) { record.description.logPath
isLogLink = true; :
} 'This trial\'s logPath are not available.';
return ( return (
<pre id="description" className="hyperpar"> <pre id="description" className="hyperpar">
{ {
...@@ -128,19 +129,7 @@ class SuccessTable extends React.Component<SuccessTableProps, {}> { ...@@ -128,19 +129,7 @@ class SuccessTable extends React.Component<SuccessTableProps, {}> {
<span className="error">'This trial's parameters are not available.'</span> <span className="error">'This trial's parameters are not available.'</span>
</div> </div>
} }
{ <LogPath logStr={logPathRow}/>
isLogLink
?
<div className="logpath">
<span className="logName">logPath: </span>
<a className="logContent logHref" href={logPathRow} target="_blank">{logPathRow}</a>
</div>
:
<div className="logpath">
<span className="logName">logPath: </span>
<span className="logContent">{logPathRow}</span>
</div>
}
</pre> </pre>
); );
}; };
......
...@@ -6,6 +6,7 @@ import { Row, Table, Button, Popconfirm, Modal, message } from 'antd'; ...@@ -6,6 +6,7 @@ import { Row, Table, Button, Popconfirm, Modal, message } from 'antd';
import { MANAGER_IP, trialJobStatus } from '../../static/const'; import { MANAGER_IP, trialJobStatus } from '../../static/const';
import { convertDuration } from '../../static/function'; import { convertDuration } from '../../static/function';
import { TableObj, TrialJob } from '../../static/interface'; import { TableObj, TrialJob } from '../../static/interface';
import LogPath from '../logPath/LogPath';
require('../../static/style/tableStatus.css'); require('../../static/style/tableStatus.css');
require('../../static/style/logPath.scss'); require('../../static/style/logPath.scss');
require('../../static/style/search.scss'); require('../../static/style/search.scss');
...@@ -305,11 +306,11 @@ class TableList extends React.Component<TableListProps, TableListState> { ...@@ -305,11 +306,11 @@ class TableList extends React.Component<TableListProps, TableListState> {
const parametersRow = { const parametersRow = {
parameters: record.description.parameters parameters: record.description.parameters
}; };
let isLogLink: boolean = false; const logPathRow = record.description.logPath !== undefined
const logPathRow = record.description.logPath; ?
if (record.description.isLink !== undefined) { record.description.logPath
isLogLink = true; :
} 'This trial\'s logPath are not available.';
return ( return (
<pre id="allList" className="hyperpar"> <pre id="allList" className="hyperpar">
{ {
...@@ -327,19 +328,7 @@ class TableList extends React.Component<TableListProps, TableListState> { ...@@ -327,19 +328,7 @@ class TableList extends React.Component<TableListProps, TableListState> {
<span className="error">'This trial's parameters are not available.'</span> <span className="error">'This trial's parameters are not available.'</span>
</div> </div>
} }
{ <LogPath logStr={logPathRow}/>
isLogLink
?
<div className="logpath">
<span className="logName">logPath: </span>
<a className="logContent logHref" href={logPathRow} target="_blank">{logPathRow}</a>
</div>
:
<div className="logpath">
<span className="logName">logPath: </span>
<span className="logContent">{logPathRow}</span>
</div>
}
</pre> </pre>
); );
}; };
......
...@@ -14,8 +14,6 @@ interface ErrorParameter { ...@@ -14,8 +14,6 @@ interface ErrorParameter {
interface Parameters { interface Parameters {
parameters: ErrorParameter; parameters: ErrorParameter;
logPath?: string; logPath?: string;
isLink?: boolean;
intermediate?: Array<string>;
} }
interface Experiment { interface Experiment {
......
.RUNNING{ .RUNNING,.USER_CANCELED{
color: #3c8dbc; color: #0071BC;
} }
.FAILED{ .FAILED{
color: #dd4b39; color: #dd4b39;
} }
.USER_CANCELED{
color: #FF4500;
}
.SUCCEEDED{ .SUCCEEDED{
color: #009245; color: #00A445;
} }
.UNKNOWN{ .UNKNOWN{
color: #FF8C00; color: #FF8C00;
} }
.SYS_CANCELED{ .SYS_CANCELED{
color: red; color: #EB0716;
} }
.WAITING{ .WAITING{
color: #008B8B; color: #008B8B;
......
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