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
8d63b108
Commit
8d63b108
authored
Nov 22, 2018
by
Lijiao
Committed by
fishyds
Nov 22, 2018
Browse files
Show intermediate result (#384)
parent
7035f3e7
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
68 additions
and
56 deletions
+68
-56
src/webui/src/components/SlideBar.tsx
src/webui/src/components/SlideBar.tsx
+3
-1
src/webui/src/components/TrialsDetail.tsx
src/webui/src/components/TrialsDetail.tsx
+29
-14
src/webui/src/components/overview/Progress.tsx
src/webui/src/components/overview/Progress.tsx
+8
-4
src/webui/src/components/trial-detail/Duration.tsx
src/webui/src/components/trial-detail/Duration.tsx
+1
-9
src/webui/src/components/trial-detail/Para.tsx
src/webui/src/components/trial-detail/Para.tsx
+5
-19
src/webui/src/components/trial-detail/TableList.tsx
src/webui/src/components/trial-detail/TableList.tsx
+11
-2
src/webui/src/static/interface.ts
src/webui/src/static/interface.ts
+4
-6
src/webui/src/static/style/logPath.scss
src/webui/src/static/style/logPath.scss
+7
-1
No files found.
src/webui/src/components/SlideBar.tsx
View file @
8d63b108
...
@@ -8,7 +8,9 @@ class SlideBar extends React.Component<{}, {}> {
...
@@ -8,7 +8,9 @@ class SlideBar extends React.Component<{}, {}> {
return
(
return
(
<
ul
className
=
"nav"
>
<
ul
className
=
"nav"
>
<
li
className
=
"logo"
>
<
li
className
=
"logo"
>
<
img
src
=
{
require
(
'
../static/img/logo.png
'
)
}
style
=
{
{
width
:
156
}
}
alt
=
"NNI logo"
/>
<
Link
to
=
{
'
/oview
'
}
>
<
img
src
=
{
require
(
'
../static/img/logo.png
'
)
}
style
=
{
{
width
:
156
}
}
alt
=
"NNI logo"
/>
</
Link
>
</
li
>
</
li
>
<
li
className
=
"tab"
>
<
li
className
=
"tab"
>
<
Link
to
=
{
'
/oview
'
}
activeClassName
=
"high"
>
<
Link
to
=
{
'
/oview
'
}
activeClassName
=
"high"
>
...
...
src/webui/src/components/TrialsDetail.tsx
View file @
8d63b108
...
@@ -3,7 +3,7 @@ import axios from 'axios';
...
@@ -3,7 +3,7 @@ import axios from 'axios';
import
{
MANAGER_IP
}
from
'
../static/const
'
;
import
{
MANAGER_IP
}
from
'
../static/const
'
;
import
{
Row
,
Col
,
Button
,
Tabs
,
Input
}
from
'
antd
'
;
import
{
Row
,
Col
,
Button
,
Tabs
,
Input
}
from
'
antd
'
;
const
Search
=
Input
.
Search
;
const
Search
=
Input
.
Search
;
import
{
TableObj
,
Parameters
,
DetailAccurPoint
,
TooltipForAccuracy
,
}
from
'
../static/interface
'
;
import
{
TableObj
,
Parameters
,
DetailAccurPoint
,
TooltipForAccuracy
}
from
'
../static/interface
'
;
import
Accuracy
from
'
./overview/Accuracy
'
;
import
Accuracy
from
'
./overview/Accuracy
'
;
import
Duration
from
'
./trial-detail/Duration
'
;
import
Duration
from
'
./trial-detail/Duration
'
;
import
Title1
from
'
./overview/Title1
'
;
import
Title1
from
'
./overview/Title1
'
;
...
@@ -16,6 +16,7 @@ interface TrialDetailState {
...
@@ -16,6 +16,7 @@ interface TrialDetailState {
accSource
:
object
;
accSource
:
object
;
accNodata
:
string
;
accNodata
:
string
;
tableListSource
:
Array
<
TableObj
>
;
tableListSource
:
Array
<
TableObj
>
;
tableBaseSource
:
Array
<
TableObj
>
;
}
}
class
TrialsDetail
extends
React
.
Component
<
{},
TrialDetailState
>
{
class
TrialsDetail
extends
React
.
Component
<
{},
TrialDetailState
>
{
...
@@ -30,7 +31,8 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
...
@@ -30,7 +31,8 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
this
.
state
=
{
this
.
state
=
{
accSource
:
{},
accSource
:
{},
accNodata
:
''
,
accNodata
:
''
,
tableListSource
:
[]
tableListSource
:
[],
tableBaseSource
:
[]
};
};
}
}
// trial accuracy graph
// trial accuracy graph
...
@@ -129,17 +131,21 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
...
@@ -129,17 +131,21 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
drawTableList
=
()
=>
{
drawTableList
=
()
=>
{
axios
(
`
${
MANAGER_IP
}
/trial-jobs`
,
{
axios
method
:
'
GET
'
.
all
([
})
axios
.
get
(
`
${
MANAGER_IP
}
/trial-jobs`
),
.
then
(
res
=>
{
axios
.
get
(
`
${
MANAGER_IP
}
/metric-data`
)
if
(
res
.
status
===
200
)
{
])
.
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
let
desc
:
Parameters
=
{
let
desc
:
Parameters
=
{
parameters
:
{}
parameters
:
{},
intermediate
:
[]
};
};
let
acc
;
let
acc
;
let
tableAcc
=
0
;
let
tableAcc
=
0
;
...
@@ -171,6 +177,14 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
...
@@ -171,6 +177,14 @@ 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
;
if
(
trialJobs
[
item
].
finalMetricData
!==
undefined
)
{
if
(
trialJobs
[
item
].
finalMetricData
!==
undefined
)
{
acc
=
JSON
.
parse
(
trialJobs
[
item
].
finalMetricData
.
data
);
acc
=
JSON
.
parse
(
trialJobs
[
item
].
finalMetricData
.
data
);
if
(
typeof
(
acc
)
===
'
object
'
)
{
if
(
typeof
(
acc
)
===
'
object
'
)
{
...
@@ -193,11 +207,12 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
...
@@ -193,11 +207,12 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
});
});
if
(
this
.
_isMounted
)
{
if
(
this
.
_isMounted
)
{
this
.
setState
(()
=>
({
this
.
setState
(()
=>
({
tableListSource
:
trialTable
tableListSource
:
trialTable
,
tableBaseSource
:
trialTable
}));
}));
}
}
}
}
});
})
)
;
}
}
callback
=
(
key
:
string
)
=>
{
callback
=
(
key
:
string
)
=>
{
...
@@ -228,10 +243,10 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
...
@@ -228,10 +243,10 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
searchTrialNo
=
(
value
:
string
)
=>
{
searchTrialNo
=
(
value
:
string
)
=>
{
window
.
clearInterval
(
this
.
interTableList
);
window
.
clearInterval
(
this
.
interTableList
);
const
{
table
List
Source
}
=
this
.
state
;
const
{
table
Base
Source
}
=
this
.
state
;
const
searchResultList
:
Array
<
TableObj
>
=
[];
const
searchResultList
:
Array
<
TableObj
>
=
[];
Object
.
keys
(
table
List
Source
).
map
(
key
=>
{
Object
.
keys
(
table
Base
Source
).
map
(
key
=>
{
const
item
=
table
List
Source
[
key
];
const
item
=
table
Base
Source
[
key
];
if
(
item
.
sequenceId
.
toString
()
===
value
)
{
if
(
item
.
sequenceId
.
toString
()
===
value
)
{
searchResultList
.
push
(
item
);
searchResultList
.
push
(
item
);
}
}
...
@@ -271,7 +286,7 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
...
@@ -271,7 +286,7 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
accSource
,
accNodata
,
accSource
,
accNodata
,
tableListSource
tableListSource
}
=
this
.
state
;
}
=
this
.
state
;
const
titleOfacc
=
(
const
titleOfacc
=
(
<
Title1
text
=
"Default Metric"
icon
=
"3.png"
/>
<
Title1
text
=
"Default Metric"
icon
=
"3.png"
/>
);
);
...
...
src/webui/src/components/overview/Progress.tsx
View file @
8d63b108
...
@@ -29,12 +29,16 @@ class Progressed extends React.Component<ProgressProps, {}> {
...
@@ -29,12 +29,16 @@ class Progressed extends React.Component<ProgressProps, {}> {
trialNumber
,
bestAccuracy
,
trialNumber
,
bestAccuracy
,
status
,
errors
status
,
errors
}
=
this
.
props
;
}
=
this
.
props
;
// remaining time
const
bar2
=
trialNumber
.
totalCurrentTrial
-
trialNumber
.
waitTrial
-
trialNumber
.
unknowTrial
;
const
bar2
=
trialNumber
.
totalCurrentTrial
-
trialNumber
.
waitTrial
-
trialNumber
.
unknowTrial
;
const
bar2Percent
=
(
bar2
/
trialProfile
.
MaxTrialNum
)
*
100
;
const
bar2Percent
=
(
bar2
/
trialProfile
.
MaxTrialNum
)
*
100
;
const
percent
=
(
trialProfile
.
execDuration
/
trialProfile
.
maxDuration
)
*
100
;
const
percent
=
(
trialProfile
.
execDuration
/
trialProfile
.
maxDuration
)
*
100
;
const
runDuration
=
convertTime
(
trialProfile
.
execDuration
);
const
runDuration
=
convertTime
(
trialProfile
.
execDuration
);
const
remaining
=
convertTime
(
trialProfile
.
maxDuration
-
trialProfile
.
execDuration
);
let
remaining
;
if
(
status
===
'
DONE
'
)
{
remaining
=
'
0
'
;
}
else
{
remaining
=
convertTime
(
trialProfile
.
maxDuration
-
trialProfile
.
execDuration
);
}
let
errorContent
;
let
errorContent
;
if
(
errors
!==
''
)
{
if
(
errors
!==
''
)
{
errorContent
=
(
errorContent
=
(
...
@@ -81,7 +85,7 @@ class Progressed extends React.Component<ProgressProps, {}> {
...
@@ -81,7 +85,7 @@ class Progressed extends React.Component<ProgressProps, {}> {
maxString
=
{
`MaxTrialNumber:
${
trialProfile
.
MaxTrialNum
}
`
}
maxString
=
{
`MaxTrialNumber:
${
trialProfile
.
MaxTrialNum
}
`
}
/>
/>
<
Row
className
=
"basic colorOfbasic mess"
>
<
Row
className
=
"basic colorOfbasic mess"
>
<
p
>
Best
Accuracy
</
p
>
<
p
>
Best
Default Metric
</
p
>
<
div
>
{
bestAccuracy
}
</
div
>
<
div
>
{
bestAccuracy
}
</
div
>
</
Row
>
</
Row
>
<
Row
className
=
"mess"
>
<
Row
className
=
"mess"
>
...
@@ -99,7 +103,7 @@ class Progressed extends React.Component<ProgressProps, {}> {
...
@@ -99,7 +103,7 @@ class Progressed extends React.Component<ProgressProps, {}> {
</
Col
>
</
Col
>
<
Col
span
=
{
7
}
>
<
Col
span
=
{
7
}
>
<
Row
className
=
"basic colorOfbasic"
>
<
Row
className
=
"basic colorOfbasic"
>
<
p
>
Duration
</
p
>
<
p
>
Max
Duration
</
p
>
<
div
>
{
convertTime
(
trialProfile
.
maxDuration
)
}
</
div
>
<
div
>
{
convertTime
(
trialProfile
.
maxDuration
)
}
</
div
>
</
Row
>
</
Row
>
</
Col
>
</
Col
>
...
...
src/webui/src/components/trial-detail/Duration.tsx
View file @
8d63b108
...
@@ -44,14 +44,6 @@ class Duration extends React.Component<{}, DurationState> {
...
@@ -44,14 +44,6 @@ class Duration extends React.Component<{}, DurationState> {
type
:
'
shadow
'
type
:
'
shadow
'
}
}
},
},
// title: {
// left: 'center',
// text: 'Trial Duration',
// textStyle: {
// fontSize: 18,
// color: '#333'
// }
// },
grid
:
{
grid
:
{
bottom
:
'
3%
'
,
bottom
:
'
3%
'
,
containLabel
:
true
,
containLabel
:
true
,
...
@@ -108,7 +100,7 @@ class Duration extends React.Component<{}, DurationState> {
...
@@ -108,7 +100,7 @@ class Duration extends React.Component<{}, DurationState> {
}
else
{
}
else
{
duration
=
(
new
Date
().
getTime
()
-
start
)
/
1000
;
duration
=
(
new
Date
().
getTime
()
-
start
)
/
1000
;
}
}
trialId
.
push
(
trialJobs
[
item
].
i
d
);
trialId
.
push
(
trialJobs
[
item
].
sequenceI
d
);
trialTime
.
push
(
duration
);
trialTime
.
push
(
duration
);
}
}
});
});
...
...
src/webui/src/components/trial-detail/Para.tsx
View file @
8d63b108
...
@@ -3,7 +3,7 @@ import axios from 'axios';
...
@@ -3,7 +3,7 @@ import axios from 'axios';
import
{
MANAGER_IP
}
from
'
../../static/const
'
;
import
{
MANAGER_IP
}
from
'
../../static/const
'
;
import
ReactEcharts
from
'
echarts-for-react
'
;
import
ReactEcharts
from
'
echarts-for-react
'
;
import
{
Row
,
Col
,
Select
,
Button
,
message
}
from
'
antd
'
;
import
{
Row
,
Col
,
Select
,
Button
,
message
}
from
'
antd
'
;
import
{
HoverName
,
ParaObj
,
VisualMapValue
,
Dimobj
}
from
'
../../static/interface
'
;
import
{
ParaObj
,
VisualMapValue
,
Dimobj
}
from
'
../../static/interface
'
;
const
Option
=
Select
.
Option
;
const
Option
=
Select
.
Option
;
require
(
'
echarts/lib/chart/parallel
'
);
require
(
'
echarts/lib/chart/parallel
'
);
require
(
'
echarts/lib/component/tooltip
'
);
require
(
'
echarts/lib/component/tooltip
'
);
...
@@ -243,30 +243,19 @@ class Para extends React.Component<{}, ParaState> {
...
@@ -243,30 +243,19 @@ class Para extends React.Component<{}, ParaState> {
};
};
}
else
{
}
else
{
visualMapObj
=
{
visualMapObj
=
{
bottom
:
'
20px
'
,
type
:
'
continuous
'
,
type
:
'
continuous
'
,
precision
:
3
,
precision
:
3
,
min
:
visualValue
.
minAccuracy
,
min
:
visualValue
.
minAccuracy
,
max
:
visualValue
.
maxAccuracy
,
max
:
visualValue
.
maxAccuracy
,
color
:
[
'
#CA0000
'
,
'
#FFC400
'
,
'
#90EE90
'
]
color
:
[
'
#CA0000
'
,
'
#FFC400
'
,
'
#90EE90
'
],
calculable
:
true
};
};
}
}
let
optionown
=
{
let
optionown
=
{
parallelAxis
,
parallelAxis
,
tooltip
:
{
tooltip
:
{
trigger
:
'
item
'
,
trigger
:
'
item
'
formatter
:
function
(
params
:
HoverName
)
{
return
params
.
name
;
}
},
toolbox
:
{
show
:
true
,
left
:
'
right
'
,
iconStyle
:
{
normal
:
{
borderColor
:
'
#ddd
'
}
},
z
:
202
},
},
parallel
:
{
parallel
:
{
parallelAxisDefault
:
{
parallelAxisDefault
:
{
...
@@ -276,9 +265,6 @@ class Para extends React.Component<{}, ParaState> {
...
@@ -276,9 +265,6 @@ class Para extends React.Component<{}, ParaState> {
}
}
},
},
visualMap
:
visualMapObj
,
visualMap
:
visualMapObj
,
highlight
:
{
type
:
'
highlight
'
},
series
:
{
series
:
{
type
:
'
parallel
'
,
type
:
'
parallel
'
,
smooth
:
true
,
smooth
:
true
,
...
...
src/webui/src/components/trial-detail/TableList.tsx
View file @
8d63b108
...
@@ -98,7 +98,7 @@ class TableList extends React.Component<TableListProps, TableListState> {
...
@@ -98,7 +98,7 @@ class TableList extends React.Component<TableListProps, TableListState> {
data
:
sequence
data
:
sequence
},
},
yAxis
:
{
yAxis
:
{
name
:
'
Accuracy
'
,
name
:
'
Default Metric
'
,
type
:
'
value
'
,
type
:
'
value
'
,
data
:
intermediateArr
data
:
intermediateArr
},
},
...
@@ -165,7 +165,7 @@ class TableList extends React.Component<TableListProps, TableListState> {
...
@@ -165,7 +165,7 @@ class TableList extends React.Component<TableListProps, TableListState> {
key
:
'
sequenceId
'
,
key
:
'
sequenceId
'
,
width
:
120
,
width
:
120
,
className
:
'
tableHead
'
,
className
:
'
tableHead
'
,
sorter
:
(
a
:
TableObj
,
b
:
TableObj
)
=>
(
a
.
sequenceId
as
number
)
-
(
b
.
sequenceId
as
number
)
,
sorter
:
(
a
:
TableObj
,
b
:
TableObj
)
=>
(
a
.
sequenceId
as
number
)
-
(
b
.
sequenceId
as
number
)
},
{
},
{
title
:
'
Id
'
,
title
:
'
Id
'
,
dataIndex
:
'
id
'
,
dataIndex
:
'
id
'
,
...
@@ -305,6 +305,11 @@ class TableList extends React.Component<TableListProps, TableListState> {
...
@@ -305,6 +305,11 @@ 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
)
{
...
@@ -340,6 +345,10 @@ class TableList extends React.Component<TableListProps, TableListState> {
...
@@ -340,6 +345,10 @@ 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
>
);
);
};
};
...
...
src/webui/src/static/interface.ts
View file @
8d63b108
...
@@ -15,6 +15,7 @@ interface Parameters {
...
@@ -15,6 +15,7 @@ interface Parameters {
parameters
:
ErrorParameter
;
parameters
:
ErrorParameter
;
logPath
?:
string
;
logPath
?:
string
;
isLink
?:
boolean
;
isLink
?:
boolean
;
intermediate
?:
Array
<
string
>
;
}
}
interface
Experiment
{
interface
Experiment
{
...
@@ -76,10 +77,6 @@ interface Dimobj {
...
@@ -76,10 +77,6 @@ interface Dimobj {
data
?:
string
[];
data
?:
string
[];
}
}
interface
HoverName
{
name
:
string
;
}
interface
ParaObj
{
interface
ParaObj
{
data
:
number
[][];
data
:
number
[][];
parallelAxis
:
Array
<
Dimobj
>
;
parallelAxis
:
Array
<
Dimobj
>
;
...
@@ -90,8 +87,9 @@ interface VisualMapValue {
...
@@ -90,8 +87,9 @@ interface VisualMapValue {
minAccuracy
:
number
;
minAccuracy
:
number
;
}
}
export
{
TableObj
,
Parameters
,
Experiment
,
export
{
TableObj
,
Parameters
,
Experiment
,
AccurPoint
,
TrialNumber
,
TrialJob
,
AccurPoint
,
TrialNumber
,
TrialJob
,
DetailAccurPoint
,
TooltipForAccuracy
,
DetailAccurPoint
,
TooltipForAccuracy
,
HoverName
,
ParaObj
,
VisualMapValue
,
Dimobj
ParaObj
,
VisualMapValue
,
Dimobj
};
};
\ No newline at end of file
src/webui/src/static/style/logPath.scss
View file @
8d63b108
.logpath
{
.logpath
{
margin-left
:
10px
;
margin-left
:
10px
;
font-size
:
14px
;
.logName
{
.logName
{
color
:
#268BD2
;
color
:
#268BD2
;
margin-right
:
5px
;
}
}
.logContent
{
.logContent
{
...
@@ -18,3 +19,8 @@
...
@@ -18,3 +19,8 @@
color
:
blue
;
color
:
blue
;
text-decoration
:
underline
;
text-decoration
:
underline
;
}
}
.intermediate
{
white-space
:
normal
;
font-size
:
14px
;
}
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