Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
ceff47c7
Commit
ceff47c7
authored
Dec 02, 2019
by
Lijiao
Committed by
chicm-ms
Dec 02, 2019
Browse files
add sort for detail table column and style (#1807)
parent
afcea5eb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
19 deletions
+18
-19
src/webui/src/components/trial-detail/TableList.tsx
src/webui/src/components/trial-detail/TableList.tsx
+12
-11
src/webui/src/static/style/table.scss
src/webui/src/static/style/table.scss
+6
-8
No files found.
src/webui/src/components/trial-detail/TableList.tsx
View file @
ceff47c7
...
@@ -340,7 +340,6 @@ class TableList extends React.Component<TableListProps, TableListState> {
...
@@ -340,7 +340,6 @@ class TableList extends React.Component<TableListProps, TableListState> {
title
:
'
Operation
'
,
title
:
'
Operation
'
,
dataIndex
:
'
operation
'
,
dataIndex
:
'
operation
'
,
key
:
'
operation
'
,
key
:
'
operation
'
,
width
:
120
,
render
:
(
text
:
string
,
record
:
TableRecord
)
=>
{
render
:
(
text
:
string
,
record
:
TableRecord
)
=>
{
let
trialStatus
=
record
.
status
;
let
trialStatus
=
record
.
status
;
const
flag
:
boolean
=
(
trialStatus
===
'
RUNNING
'
)
?
false
:
true
;
const
flag
:
boolean
=
(
trialStatus
===
'
RUNNING
'
)
?
false
:
true
;
...
@@ -413,7 +412,6 @@ class TableList extends React.Component<TableListProps, TableListState> {
...
@@ -413,7 +412,6 @@ class TableList extends React.Component<TableListProps, TableListState> {
title
:
realItem
,
title
:
realItem
,
dataIndex
:
item
,
dataIndex
:
item
,
key
:
item
,
key
:
item
,
width
:
'
6%
'
,
render
:
(
text
:
string
,
record
:
TableRecord
)
=>
{
render
:
(
text
:
string
,
record
:
TableRecord
)
=>
{
const
eachTrial
=
TRIALS
.
getTrial
(
record
.
id
);
const
eachTrial
=
TRIALS
.
getTrial
(
record
.
id
);
return
(
return
(
...
@@ -514,7 +512,6 @@ class TableList extends React.Component<TableListProps, TableListState> {
...
@@ -514,7 +512,6 @@ class TableList extends React.Component<TableListProps, TableListState> {
const
SequenceIdColumnConfig
:
ColumnProps
<
TableRecord
>
=
{
const
SequenceIdColumnConfig
:
ColumnProps
<
TableRecord
>
=
{
title
:
'
Trial No.
'
,
title
:
'
Trial No.
'
,
dataIndex
:
'
sequenceId
'
,
dataIndex
:
'
sequenceId
'
,
width
:
120
,
className
:
'
tableHead
'
,
className
:
'
tableHead
'
,
sorter
:
(
a
,
b
)
=>
a
.
sequenceId
-
b
.
sequenceId
sorter
:
(
a
,
b
)
=>
a
.
sequenceId
-
b
.
sequenceId
};
};
...
@@ -522,7 +519,6 @@ const SequenceIdColumnConfig: ColumnProps<TableRecord> = {
...
@@ -522,7 +519,6 @@ const SequenceIdColumnConfig: ColumnProps<TableRecord> = {
const
IdColumnConfig
:
ColumnProps
<
TableRecord
>
=
{
const
IdColumnConfig
:
ColumnProps
<
TableRecord
>
=
{
title
:
'
ID
'
,
title
:
'
ID
'
,
dataIndex
:
'
id
'
,
dataIndex
:
'
id
'
,
width
:
60
,
className
:
'
tableHead leftTitle
'
,
className
:
'
tableHead leftTitle
'
,
sorter
:
(
a
,
b
)
=>
a
.
id
.
localeCompare
(
b
.
id
),
sorter
:
(
a
,
b
)
=>
a
.
id
.
localeCompare
(
b
.
id
),
render
:
(
text
,
record
)
=>
(
render
:
(
text
,
record
)
=>
(
...
@@ -533,7 +529,7 @@ const IdColumnConfig: ColumnProps<TableRecord> = {
...
@@ -533,7 +529,7 @@ const IdColumnConfig: ColumnProps<TableRecord> = {
const
StartTimeColumnConfig
:
ColumnProps
<
TableRecord
>
=
{
const
StartTimeColumnConfig
:
ColumnProps
<
TableRecord
>
=
{
title
:
'
Start Time
'
,
title
:
'
Start Time
'
,
dataIndex
:
'
startTime
'
,
dataIndex
:
'
startTime
'
,
width
:
160
,
sorter
:
(
a
,
b
)
=>
a
.
startTime
-
b
.
startTime
,
render
:
(
text
,
record
)
=>
(
render
:
(
text
,
record
)
=>
(
<
span
>
{
formatTimestamp
(
record
.
startTime
)
}
</
span
>
<
span
>
{
formatTimestamp
(
record
.
startTime
)
}
</
span
>
)
)
...
@@ -542,7 +538,15 @@ const StartTimeColumnConfig: ColumnProps<TableRecord> = {
...
@@ -542,7 +538,15 @@ const StartTimeColumnConfig: ColumnProps<TableRecord> = {
const
EndTimeColumnConfig
:
ColumnProps
<
TableRecord
>
=
{
const
EndTimeColumnConfig
:
ColumnProps
<
TableRecord
>
=
{
title
:
'
End Time
'
,
title
:
'
End Time
'
,
dataIndex
:
'
endTime
'
,
dataIndex
:
'
endTime
'
,
width
:
160
,
sorter
:
(
a
,
b
,
sortOrder
)
=>
{
if
(
a
.
endTime
===
undefined
)
{
return
sortOrder
===
'
ascend
'
?
1
:
-
1
;
}
else
if
(
b
.
endTime
===
undefined
)
{
return
sortOrder
===
'
ascend
'
?
-
1
:
1
;
}
else
{
return
a
.
endTime
-
b
.
endTime
;
}
},
render
:
(
text
,
record
)
=>
(
render
:
(
text
,
record
)
=>
(
<
span
>
{
formatTimestamp
(
record
.
endTime
,
'
--
'
)
}
</
span
>
<
span
>
{
formatTimestamp
(
record
.
endTime
,
'
--
'
)
}
</
span
>
)
)
...
@@ -551,17 +555,15 @@ const EndTimeColumnConfig: ColumnProps<TableRecord> = {
...
@@ -551,17 +555,15 @@ const EndTimeColumnConfig: ColumnProps<TableRecord> = {
const
DurationColumnConfig
:
ColumnProps
<
TableRecord
>
=
{
const
DurationColumnConfig
:
ColumnProps
<
TableRecord
>
=
{
title
:
'
Duration
'
,
title
:
'
Duration
'
,
dataIndex
:
'
duration
'
,
dataIndex
:
'
duration
'
,
width
:
100
,
sorter
:
(
a
,
b
)
=>
a
.
duration
-
b
.
duration
,
sorter
:
(
a
,
b
)
=>
a
.
duration
-
b
.
duration
,
render
:
(
text
,
record
)
=>
(
render
:
(
text
,
record
)
=>
(
<
div
className
=
"durationsty"
>
<
div
>
{
convertDuration
(
record
.
duration
)
}
</
div
></
div
>
<
span
className
=
"durationsty"
>
{
convertDuration
(
record
.
duration
)
}
</
span
>
)
)
};
};
const
StatusColumnConfig
:
ColumnProps
<
TableRecord
>
=
{
const
StatusColumnConfig
:
ColumnProps
<
TableRecord
>
=
{
title
:
'
Status
'
,
title
:
'
Status
'
,
dataIndex
:
'
status
'
,
dataIndex
:
'
status
'
,
width
:
150
,
className
:
'
tableStatus
'
,
className
:
'
tableStatus
'
,
render
:
(
text
,
record
)
=>
(
render
:
(
text
,
record
)
=>
(
<
span
className
=
{
`
${
record
.
status
}
commonStyle`
}
>
{
record
.
status
}
</
span
>
<
span
className
=
{
`
${
record
.
status
}
commonStyle`
}
>
{
record
.
status
}
</
span
>
...
@@ -574,7 +576,7 @@ const StatusColumnConfig: ColumnProps<TableRecord> = {
...
@@ -574,7 +576,7 @@ const StatusColumnConfig: ColumnProps<TableRecord> = {
const
IntermediateCountColumnConfig
:
ColumnProps
<
TableRecord
>
=
{
const
IntermediateCountColumnConfig
:
ColumnProps
<
TableRecord
>
=
{
title
:
'
Intermediate result
'
,
title
:
'
Intermediate result
'
,
dataIndex
:
'
intermediateCount
'
,
dataIndex
:
'
intermediateCount
'
,
width
:
86
,
sorter
:
(
a
,
b
)
=>
a
.
intermediateCount
-
b
.
intermediateCount
,
render
:
(
text
,
record
)
=>
(
render
:
(
text
,
record
)
=>
(
<
span
>
{
`#
${
record
.
intermediateCount
}
`
}
</
span
>
<
span
>
{
`#
${
record
.
intermediateCount
}
`
}
</
span
>
)
)
...
@@ -584,7 +586,6 @@ const AccuracyColumnConfig: ColumnProps<TableRecord> = {
...
@@ -584,7 +586,6 @@ const AccuracyColumnConfig: ColumnProps<TableRecord> = {
title
:
'
Default metric
'
,
title
:
'
Default metric
'
,
className
:
'
leftTitle
'
,
className
:
'
leftTitle
'
,
dataIndex
:
'
accuracy
'
,
dataIndex
:
'
accuracy
'
,
width
:
120
,
sorter
:
(
a
,
b
,
sortOrder
)
=>
{
sorter
:
(
a
,
b
,
sortOrder
)
=>
{
if
(
a
.
latestAccuracy
===
undefined
)
{
if
(
a
.
latestAccuracy
===
undefined
)
{
return
sortOrder
===
'
ascend
'
?
1
:
-
1
;
return
sortOrder
===
'
ascend
'
?
1
:
-
1
;
...
...
src/webui/src/static/style/table.scss
View file @
ceff47c7
...
@@ -57,26 +57,24 @@
...
@@ -57,26 +57,24 @@
}
}
td
{
td
{
padding
:
0px
;
padding
:
0
15
px
;
line-height
:
24px
;
line-height
:
24px
;
}
}
/* + button */
.ant-table-row-expand-icon
{
background
:
none
;
}
.ant-table-row-expand-icon-cell
{
.ant-table-row-expand-icon-cell
{
background
:
#ccc
;
background
:
#ccc
;
width
:
50px
;
.ant-table-row-expand-icon
{
.ant-table-row-expand-icon
{
background
:
none
;
border
:
none
;
border
:
none
;
width
:
100%
;
height
:
100%
;
}
}
}
}
.ant-table-row-expand-icon-cell
:hover
{
.ant-table-row-expand-icon-cell
:hover
{
background
:
#ccc
;
background
:
#ccc
;
}
}
.ant-table-selection-column
{
width
:
50px
;
}
}
}
/* let openrow content left*/
/* let openrow content left*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment