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
9aed500d
Commit
9aed500d
authored
Nov 26, 2019
by
Lijiao
Committed by
chicm-ms
Nov 26, 2019
Browse files
Fix table sort issue (#1773)
parent
587dd3af
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
9 deletions
+26
-9
src/webui/src/components/trial-detail/TableList.tsx
src/webui/src/components/trial-detail/TableList.tsx
+5
-6
src/webui/src/static/function.ts
src/webui/src/static/function.ts
+1
-1
src/webui/src/static/interface.ts
src/webui/src/static/interface.ts
+2
-1
src/webui/src/static/model/trial.ts
src/webui/src/static/model/trial.ts
+18
-1
No files found.
src/webui/src/components/trial-detail/TableList.tsx
View file @
9aed500d
...
@@ -586,17 +586,16 @@ const AccuracyColumnConfig: ColumnProps<TableRecord> = {
...
@@ -586,17 +586,16 @@ const AccuracyColumnConfig: ColumnProps<TableRecord> = {
dataIndex
:
'
accuracy
'
,
dataIndex
:
'
accuracy
'
,
width
:
120
,
width
:
120
,
sorter
:
(
a
,
b
,
sortOrder
)
=>
{
sorter
:
(
a
,
b
,
sortOrder
)
=>
{
if
(
a
.
accuracy
===
undefined
)
{
if
(
a
.
latestAccuracy
===
undefined
)
{
return
sortOrder
===
'
ascend
'
?
-
1
:
1
;
}
else
if
(
b
.
accuracy
===
undefined
)
{
return
sortOrder
===
'
ascend
'
?
1
:
-
1
;
return
sortOrder
===
'
ascend
'
?
1
:
-
1
;
}
else
if
(
b
.
latestAccuracy
===
undefined
)
{
return
sortOrder
===
'
ascend
'
?
-
1
:
1
;
}
else
{
}
else
{
return
a
.
a
ccuracy
-
b
.
a
ccuracy
;
return
a
.
latestA
ccuracy
-
b
.
latestA
ccuracy
;
}
}
},
},
render
:
(
text
,
record
)
=>
(
render
:
(
text
,
record
)
=>
(
// TODO: is this needed?
<
div
>
{
record
.
formattedLatestAccuracy
}
</
div
>
<
div
>
{
record
.
latestAccuracy
}
</
div
>
)
)
};
};
...
...
src/webui/src/static/function.ts
View file @
9aed500d
...
@@ -186,5 +186,5 @@ function formatAccuracy(accuracy: number): string {
...
@@ -186,5 +186,5 @@ function formatAccuracy(accuracy: number): string {
export
{
export
{
convertTime
,
convertDuration
,
getFinalResult
,
getFinal
,
downFile
,
convertTime
,
convertDuration
,
getFinalResult
,
getFinal
,
downFile
,
intermediateGraphOption
,
killJob
,
filterByStatus
,
filterDuration
,
intermediateGraphOption
,
killJob
,
filterByStatus
,
filterDuration
,
formatAccuracy
,
formatTimestamp
,
metricAccuracy
,
formatAccuracy
,
formatTimestamp
,
metricAccuracy
};
};
src/webui/src/static/interface.ts
View file @
9aed500d
...
@@ -24,7 +24,8 @@ interface TableRecord {
...
@@ -24,7 +24,8 @@ interface TableRecord {
status
:
string
;
status
:
string
;
intermediateCount
:
number
;
intermediateCount
:
number
;
accuracy
?:
number
;
accuracy
?:
number
;
latestAccuracy
:
string
;
// formatted string
latestAccuracy
:
number
|
undefined
;
formattedLatestAccuracy
:
string
;
// format (LATEST/FINAL)
}
}
interface
SearchSpace
{
interface
SearchSpace
{
...
...
src/webui/src/static/model/trial.ts
View file @
9aed500d
...
@@ -46,6 +46,22 @@ class Trial implements TableObj {
...
@@ -46,6 +46,22 @@ class Trial implements TableObj {
return
this
.
metricsInitialized
&&
this
.
finalAcc
!==
undefined
&&
!
isNaN
(
this
.
finalAcc
);
return
this
.
metricsInitialized
&&
this
.
finalAcc
!==
undefined
&&
!
isNaN
(
this
.
finalAcc
);
}
}
get
latestAccuracy
():
number
|
undefined
{
if
(
this
.
accuracy
!==
undefined
)
{
return
this
.
accuracy
;
}
else
if
(
this
.
intermediates
.
length
>
0
)
{
// TODO: support intermeidate result is dict
const
temp
=
this
.
intermediates
[
this
.
intermediates
.
length
-
1
];
if
(
temp
!==
undefined
)
{
return
JSON
.
parse
(
temp
.
data
);
}
else
{
return
undefined
;
}
}
else
{
return
undefined
;
}
}
/* table obj start */
/* table obj start */
get
tableRecord
():
TableRecord
{
get
tableRecord
():
TableRecord
{
...
@@ -62,7 +78,8 @@ class Trial implements TableObj {
...
@@ -62,7 +78,8 @@ class Trial implements TableObj {
status
:
this
.
info
.
status
,
status
:
this
.
info
.
status
,
intermediateCount
:
this
.
intermediates
.
length
,
intermediateCount
:
this
.
intermediates
.
length
,
accuracy
:
this
.
finalAcc
,
accuracy
:
this
.
finalAcc
,
latestAccuracy
:
this
.
formatLatestAccuracy
(),
latestAccuracy
:
this
.
latestAccuracy
,
formattedLatestAccuracy
:
this
.
formatLatestAccuracy
(),
};
};
}
}
...
...
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