Commit 7be3c5c2 authored by Lijiao's avatar Lijiao Committed by rabbit008
Browse files

Show startTime and endTime in detail table (#1536)

* Show startTime and endTime in detail table
parent c6b1e513
...@@ -171,7 +171,9 @@ class TrialsDetail extends React.Component<TrialsDetailProps, TrialDetailState> ...@@ -171,7 +171,9 @@ class TrialsDetail extends React.Component<TrialsDetailProps, TrialDetailState>
status: status, status: status,
duration: duration, duration: duration,
acc: acc, acc: acc,
description: desc description: desc,
startTime: begin,
endTime: (end !== undefined) ? end : undefined
}); });
}); });
// update search data result // update search data result
......
...@@ -182,7 +182,7 @@ class TableList extends React.Component<TableListProps, TableListState> { ...@@ -182,7 +182,7 @@ class TableList extends React.Component<TableListProps, TableListState> {
// checkbox for coloumn // checkbox for coloumn
selectedColumn = (checkedValues: Array<string>) => { selectedColumn = (checkedValues: Array<string>) => {
// 7: because have seven common column, "Intermediate count" is not shown by default // 7: because have seven common column, "Intermediate count" is hidden by default
let count = 7; let count = 7;
const want: Array<object> = []; const want: Array<object> = [];
const finalKeys: Array<string> = []; const finalKeys: Array<string> = [];
...@@ -191,6 +191,8 @@ class TableList extends React.Component<TableListProps, TableListState> { ...@@ -191,6 +191,8 @@ class TableList extends React.Component<TableListProps, TableListState> {
switch (checkedValues[m]) { switch (checkedValues[m]) {
case 'Trial No.': case 'Trial No.':
case 'ID': case 'ID':
case 'StartTime':
case 'EndTime':
case 'Duration': case 'Duration':
case 'Status': case 'Status':
case 'Operation': case 'Operation':
...@@ -347,6 +349,50 @@ class TableList extends React.Component<TableListProps, TableListState> { ...@@ -347,6 +349,50 @@ class TableList extends React.Component<TableListProps, TableListState> {
} }
}); });
break; break;
case 'StartTime':
showColumn.push({
title: 'StartTime',
dataIndex: 'startTime',
key: 'startTime',
width: 160,
render: (text: string, record: TableObj) => {
const start = record.startTime !== undefined ? record.startTime : -1;
return (
<span>
{
start !== -1
?
new Date(start).toLocaleString('en-US')
:
'--'
}
</span>
);
},
});
break;
case 'EndTime':
showColumn.push({
title: 'EndTime',
dataIndex: 'endTime',
key: 'endTime',
width: 160,
render: (text: string, record: TableObj) => {
const end = record.endTime !== undefined ? record.endTime : -1;
return (
<span>
{
end !== -1
?
new Date(end).toLocaleString('en-US')
:
'--'
}
</span>
);
},
});
break;
case 'Duration': case 'Duration':
showColumn.push({ showColumn.push({
title: 'Duration', title: 'Duration',
......
...@@ -34,21 +34,29 @@ const COLUMN_INDEX = [ ...@@ -34,21 +34,29 @@ const COLUMN_INDEX = [
index: 2 index: 2
}, },
{ {
name: 'Duration', name: 'StartTime',
index: 3 index: 3
}, },
{ {
name: 'Status', name: 'EndTime',
index: 4 index: 4
}, },
{ {
name: 'Intermediate count', name: 'Duration',
index: 5 index: 5
}, },
{ {
name: 'Default', name: 'Status',
index: 6 index: 6
}, },
{
name: 'Intermediate count',
index: 7
},
{
name: 'Default',
index: 8
},
{ {
name: 'Operation', name: 'Operation',
index: 10000 index: 10000
...@@ -57,7 +65,8 @@ const COLUMN_INDEX = [ ...@@ -57,7 +65,8 @@ const COLUMN_INDEX = [
// defatult selected column // defatult selected column
const COLUMN = ['Trial No.', 'ID', 'Duration', 'Status', 'Default', 'Operation']; const COLUMN = ['Trial No.', 'ID', 'Duration', 'Status', 'Default', 'Operation'];
// all choice column !dictory final // all choice column !dictory final
const COLUMNPro = ['Trial No.', 'ID', 'Duration', 'Status', 'Intermediate count', 'Default', 'Operation']; const COLUMNPro = ['Trial No.', 'ID', 'StartTime', 'EndTime', 'Duration', 'Status',
'Intermediate count', 'Default', 'Operation'];
export { export {
MANAGER_IP, DOWNLOAD_IP, trialJobStatus, COLUMNPro, MANAGER_IP, DOWNLOAD_IP, trialJobStatus, COLUMNPro,
CONTROLTYPE, MONACO, COLUMN, COLUMN_INDEX, DRAWEROPTION CONTROLTYPE, MONACO, COLUMN, COLUMN_INDEX, DRAWEROPTION
......
...@@ -8,6 +8,8 @@ interface TableObj { ...@@ -8,6 +8,8 @@ interface TableObj {
acc?: FinalType; // draw accuracy graph acc?: FinalType; // draw accuracy graph
description: Parameters; description: Parameters;
color?: string; color?: string;
startTime?: number;
endTime?: number;
} }
interface SearchSpace { interface SearchSpace {
......
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