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
4668fc08
Unverified
Commit
4668fc08
authored
Sep 18, 2020
by
Lijiaoa
Committed by
GitHub
Sep 18, 2020
Browse files
Update webui react version and use fluent ui (#2873)
parent
2ee76dc7
Changes
33
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
3674 additions
and
1483 deletions
+3674
-1483
src/webui/src/components/overview/SuccessTable.tsx
src/webui/src/components/overview/SuccessTable.tsx
+1
-1
src/webui/src/components/overview/Title1.tsx
src/webui/src/components/overview/Title1.tsx
+14
-24
src/webui/src/components/public-child/MonacoEditor.tsx
src/webui/src/components/public-child/MonacoEditor.tsx
+1
-1
src/webui/src/components/public-child/OpenRow.tsx
src/webui/src/components/public-child/OpenRow.tsx
+2
-2
src/webui/src/components/stateless-component/NNItabs.tsx
src/webui/src/components/stateless-component/NNItabs.tsx
+7
-7
src/webui/src/components/trial-detail/DefaultMetricPoint.tsx
src/webui/src/components/trial-detail/DefaultMetricPoint.tsx
+1
-2
src/webui/src/components/trial-detail/Intermediate.tsx
src/webui/src/components/trial-detail/Intermediate.tsx
+1
-1
src/webui/src/components/trial-detail/Para.tsx
src/webui/src/components/trial-detail/Para.tsx
+1
-1
src/webui/src/components/trial-detail/TableList.tsx
src/webui/src/components/trial-detail/TableList.tsx
+10
-12
src/webui/src/index.tsx
src/webui/src/index.tsx
+14
-11
src/webui/src/static/style/nav/nav.scss
src/webui/src/static/style/nav/nav.scss
+4
-4
src/webui/src/static/style/trialsDetail.scss
src/webui/src/static/style/trialsDetail.scss
+4
-0
src/webui/yarn.lock
src/webui/yarn.lock
+3614
-1417
No files found.
src/webui/src/components/overview/SuccessTable.tsx
View file @
4668fc08
import
*
as
React
from
'
react
'
;
import
{
DetailsList
,
IDetailsListProps
,
IColumn
}
from
'
office-ui-fabric-
react
'
;
import
{
DetailsList
,
IDetailsListProps
,
IColumn
}
from
'
@fluentui/
react
'
;
import
DefaultMetric
from
'
../public-child/DefaultMetric
'
;
import
Details
from
'
./Details
'
;
import
{
convertDuration
}
from
'
../../static/function
'
;
...
...
src/webui/src/components/overview/Title1.tsx
View file @
4668fc08
import
*
as
React
from
'
react
'
;
import
{
Stack
}
from
'
office-ui-fabric-react
'
;
import
{
Stack
}
from
'
@fluentui/react
'
;
import
{
TitleContext
}
from
'
../Overview
'
;
import
'
../../static/style/overviewTitle.scss
'
;
interface
Title1Props
{
text
:
string
;
icon
?:
string
;
fontColor
?:
string
;
}
class
Title1
extends
React
.
Component
<
Title1Props
,
{}
>
{
constructor
(
props
:
Title1Props
)
{
super
(
props
);
}
render
():
React
.
ReactNode
{
const
{
text
,
icon
,
fontColor
}
=
this
.
props
;
return
(
<
Stack
horizontal
className
=
"panelTitle"
>
<
img
src
=
{
require
(
`../../static/img/icon/
${
icon
}
`
)
}
alt
=
"icon"
/>
<
span
style
=
{
{
color
:
fontColor
}
}
>
{
text
}
</
span
>
</
Stack
>
);
}
}
export
default
Title1
;
\ No newline at end of file
export
const
Title1
=
():
any
=>
(
<
TitleContext
.
Consumer
>
{
(
value
):
React
.
ReactNode
=>
(
<
Stack
horizontal
className
=
"panelTitle"
>
<
img
src
=
{
require
(
`../../static/img/icon/
${
value
.
icon
}
`
)
}
alt
=
"icon"
/>
<
span
style
=
{
{
color
:
value
.
fontColor
}
}
>
{
value
.
text
}
</
span
>
</
Stack
>
)
}
</
TitleContext
.
Consumer
>
);
\ No newline at end of file
src/webui/src/components/public-child/MonacoEditor.tsx
View file @
4668fc08
import
*
as
React
from
'
react
'
;
import
{
Spinner
}
from
'
office-ui-fabric-
react
'
;
import
{
Spinner
}
from
'
@fluentui/
react
'
;
import
{
DRAWEROPTION
}
from
'
../../static/const
'
;
import
MonacoEditor
from
'
react-monaco-editor
'
;
...
...
src/webui/src/components/public-child/OpenRow.tsx
View file @
4668fc08
import
*
as
React
from
'
react
'
;
import
*
as
copy
from
'
copy-to-clipboard
'
;
import
{
Stack
,
PrimaryButton
,
Pivot
,
PivotItem
}
from
'
office-ui-fabric-
react
'
;
import
{
Stack
,
PrimaryButton
,
Pivot
,
PivotItem
}
from
'
@fluentui/
react
'
;
import
{
Trial
}
from
'
../../static/model/trial
'
;
import
{
MANAGER_IP
}
from
'
../../static/const
'
;
import
{
EXPERIMENT
,
TRIALS
}
from
'
../../static/datamodel
'
;
import
JSONTree
from
'
react-json-tree
'
;
import
PaiTrialLog
from
'
../public-child/PaiTrialLog
'
;
import
TrialLog
from
'
../public-child/TrialLog
'
;
import
MessageInfo
from
'
../
M
odals/MessageInfo
'
;
import
MessageInfo
from
'
../
m
odals/MessageInfo
'
;
import
'
../../static/style/overview.scss
'
;
import
'
../../static/style/copyParameter.scss
'
;
import
'
../../static/style/openRow.scss
'
;
...
...
src/webui/src/components/stateless-component/NNItabs.tsx
View file @
4668fc08
import
*
as
React
from
'
react
'
;
import
{
Link
}
from
'
react-router
'
;
import
{
Nav
Link
}
from
'
react-router
-dom
'
;
const
OVERVIEWTABS
=
(
<
Link
to
=
{
'
/oview
'
}
activeClassName
=
"
high-light
"
className
=
"common-tabs"
>
<
Nav
Link
to
=
{
'
/oview
'
}
activeClassName
=
"
selected
"
className
=
"common-tabs"
>
Overview
</
Link
>
</
Nav
Link
>
);
const
DETAILTABS
=
(
<
Link
to
=
{
'
/detail
'
}
activeClassName
=
"
high-light
"
className
=
"common-tabs"
>
<
Nav
Link
to
=
{
'
/detail
'
}
activeClassName
=
"
selected
"
className
=
"common-tabs"
>
Trials detail
</
Link
>
</
Nav
Link
>
);
const
NNILOGO
=
(
<
Link
to
=
{
'
/oview
'
}
>
<
Nav
Link
to
=
{
'
/oview
'
}
>
<
img
src
=
{
require
(
'
../../static/img/logo2.png
'
)
}
alt
=
"NNI logo"
style
=
{
{
height
:
40
}
}
/>
</
Link
>
</
Nav
Link
>
);
export
{
OVERVIEWTABS
,
DETAILTABS
,
NNILOGO
};
\ No newline at end of file
src/webui/src/components/trial-detail/DefaultMetricPoint.tsx
View file @
4668fc08
import
*
as
React
from
'
react
'
;
import
{
Toggle
,
Stack
}
from
'
office-ui-fabric-
react
'
;
import
{
Toggle
,
Stack
}
from
'
@fluentui/
react
'
;
import
ReactEcharts
from
'
echarts-for-react
'
;
import
{
EXPERIMENT
,
TRIALS
}
from
'
../../static/datamodel
'
;
import
{
Trial
}
from
'
../../static/model/trial
'
;
...
...
@@ -25,7 +25,6 @@ const EmptyGraph = {
interface
DefaultPointProps
{
trialIds
:
string
[];
visible
:
boolean
;
trialsUpdateBroadcast
:
number
;
}
interface
DefaultPointState
{
...
...
src/webui/src/components/trial-detail/Intermediate.tsx
View file @
4668fc08
import
*
as
React
from
'
react
'
;
import
{
Stack
,
PrimaryButton
,
Toggle
,
IStackTokens
}
from
'
office-ui-fabric-
react
'
;
import
{
Stack
,
PrimaryButton
,
Toggle
,
IStackTokens
}
from
'
@fluentui/
react
'
;
import
{
TooltipForIntermediate
,
TableObj
,
Intermedia
,
EventMap
}
from
'
../../static/interface
'
;
import
ReactEcharts
from
'
echarts-for-react
'
;
import
'
echarts/lib/component/tooltip
'
;
...
...
src/webui/src/components/trial-detail/Para.tsx
View file @
4668fc08
import
*
as
d3
from
'
d3
'
;
import
{
Dropdown
,
IDropdownOption
,
Stack
}
from
'
office-ui-fabric-
react
'
;
import
{
Dropdown
,
IDropdownOption
,
Stack
}
from
'
@fluentui/
react
'
;
import
ParCoords
from
'
parcoord-es
'
;
import
'
parcoord-es/dist/parcoords.css
'
;
import
*
as
React
from
'
react
'
;
...
...
src/webui/src/components/trial-detail/TableList.tsx
View file @
4668fc08
import
*
as
React
from
'
react
'
;
import
React
,
{
lazy
}
from
'
react
'
;
import
axios
from
'
axios
'
;
import
ReactEcharts
from
'
echarts-for-react
'
;
import
{
Stack
,
Dropdown
,
DetailsList
,
IDetailsListProps
,
DetailsListLayoutMode
,
PrimaryButton
,
Modal
,
IDropdownOption
,
IColumn
,
Selection
,
SelectionMode
,
IconButton
,
TooltipHost
,
IStackTokens
}
from
'
office-ui-fabric-
react
'
;
}
from
'
@fluentui/
react
'
;
import
ReactPaginate
from
'
react-paginate
'
;
import
{
LineChart
,
blocked
,
copy
}
from
'
../
B
uttons/Icon
'
;
import
{
LineChart
,
blocked
,
copy
}
from
'
../
b
uttons/Icon
'
;
import
{
MANAGER_IP
,
COLUMNPro
}
from
'
../../static/const
'
;
import
{
convertDuration
,
formatTimestamp
,
intermediateGraphOption
,
parseMetrics
}
from
'
../../static/function
'
;
import
{
EXPERIMENT
,
TRIALS
}
from
'
../../static/datamodel
'
;
import
{
TableRecord
,
TrialJobInfo
}
from
'
../../static/interface
'
;
impor
t
Details
from
'
../overview/Details
'
;
impor
t
ChangeColumnComponent
from
'
../
M
odals/ChangeColumnComponent
'
;
impor
t
Compare
from
'
../
M
odals/Compare
'
;
impor
t
KillJob
from
'
../
M
odals/Killjob
'
;
impor
t
Customize
from
'
../
M
odals/CustomizedTrial
'
;
import
{
contentStyles
,
iconButtonStyles
}
from
'
../
B
uttons/ModalTheme
'
;
cons
t
Details
=
lazy
(()
=>
import
(
'
../overview/Details
'
))
;
cons
t
ChangeColumnComponent
=
lazy
(()
=>
import
(
'
../
m
odals/ChangeColumnComponent
'
))
;
cons
t
Compare
=
lazy
(()
=>
import
(
'
../
m
odals/Compare
'
))
;
cons
t
KillJob
=
lazy
(()
=>
import
(
'
../
m
odals/Killjob
'
))
;
cons
t
Customize
=
lazy
(()
=>
import
(
'
../
m
odals/CustomizedTrial
'
))
;
import
{
contentStyles
,
iconButtonStyles
}
from
'
../
b
uttons/ModalTheme
'
;
import
'
../../static/style/search.scss
'
;
import
'
../../static/style/tableStatus.css
'
;
import
'
../../static/style/logPath.scss
'
;
...
...
@@ -25,7 +25,6 @@ import '../../static/style/button.scss';
import
'
../../static/style/openRow.scss
'
;
import
'
../../static/style/pagination.scss
'
;
const
echarts
=
require
(
'
echarts/lib/echarts
'
);
require
(
'
echarts/lib/chart/line
'
);
require
(
'
echarts/lib/component/tooltip
'
);
...
...
@@ -36,7 +35,7 @@ echarts.registerTheme('my_theme', {
const
horizontalGapStackTokens
:
IStackTokens
=
{
childrenGap
:
20
,
padding
:
10
,
padding
:
10
};
interface
TableListProps
{
...
...
@@ -180,7 +179,6 @@ class TableList extends React.Component<TableListProps, TableListState> {
className
:
'
tableHead leftTitle
'
};
StartTimeColumnConfig
:
any
=
{
name
:
'
Start time
'
,
key
:
'
startTime
'
,
...
...
src/webui/src/index.tsx
View file @
4668fc08
import
React
from
'
react
'
;
import
React
,
{
lazy
,
Suspense
}
from
'
react
'
;
import
ReactDOM
from
'
react-dom
'
;
import
App
from
'
./App
'
;
import
{
Router
,
Route
,
browserHistory
,
Index
Redirect
}
from
'
react-router
'
;
impor
t
Overview
from
'
./components/Overview
'
;
impor
t
TrialsDetail
from
'
./components/TrialsDetail
'
;
import
{
Browser
Router
as
Route
r
,
Route
,
Switch
,
Redirect
}
from
'
react-router
-dom
'
;
cons
t
Overview
=
lazy
(()
=>
import
(
'
./components/Overview
'
))
;
cons
t
TrialsDetail
=
lazy
(()
=>
import
(
'
./components/TrialsDetail
'
))
;
import
'
./index.css
'
;
import
*
as
serviceWorker
from
'
./serviceWorker
'
;
ReactDOM
.
render
(
(
<
Router
history
=
{
browserHistory
}
>
<
Route
path
=
"/"
component
=
{
App
}
>
<
IndexRedirect
to
=
"/oview"
/>
<
Route
path
=
"/oview"
component
=
{
Overview
}
/>
<
Route
path
=
"/detail"
component
=
{
TrialsDetail
}
/>
{
/* test branch */
}
</
Route
>
<
Router
>
<
App
>
<
Switch
>
<
Suspense
fallback
=
{
null
}
>
<
Route
path
=
"/oview"
component
=
{
Overview
}
/>
<
Route
path
=
"/detail"
component
=
{
TrialsDetail
}
/>
<
Route
path
=
"/"
render
=
{
():
React
.
ReactNode
=>
<
Redirect
to
=
{
{
pathname
:
'
/oview
'
}
}
/>
}
/>
</
Suspense
>
</
Switch
>
</
App
>
</
Router
>
),
...
...
src/webui/src/static/style/nav/nav.scss
View file @
4668fc08
...
...
@@ -42,8 +42,8 @@ $barHeight: 56px;
}
&
-refresh-num
{
position
:
absolute
;
top
:
-1
0
px
;
left
:
1
8
px
;
top
:
-1
3
px
;
left
:
1
7
px
;
color
:
#fff
;
font-size
:
12px
;
}
...
...
@@ -56,11 +56,11 @@ a.common-tabs{
color
:
#b8c7ce
;
text-decoration
:
none
;
}
.common-tabs
:visited
,
.
high-light
:hover
{
.common-tabs
:visited
,
.
selected
:hover
{
color
:
#fff
;
text-decoration
:
none
;
}
.common-tabs
:hover
,
.
high-light
{
.common-tabs
:hover
,
.
selected
{
color
:
#fff
;
border-bottom
:
1px
solid
#fff
;
}
...
...
src/webui/src/static/style/trialsDetail.scss
View file @
4668fc08
...
...
@@ -19,6 +19,10 @@
background
:
#999
;
}
}
.
is-selected
:
:
before
{
border-bottom
:
none
;
}
}
.ms-Pivot-icon
{
...
...
src/webui/yarn.lock
View file @
4668fc08
This diff is collapsed.
Click to expand it.
Prev
1
2
Next
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