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
0e835aa9
Unverified
Commit
0e835aa9
authored
Jul 13, 2022
by
Lijiaoa
Committed by
GitHub
Jul 13, 2022
Browse files
upgrade react router to v6 (#4975)
parent
10c5abb2
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
2610 additions
and
2771 deletions
+2610
-2771
ts/webui/package.json
ts/webui/package.json
+1
-2
ts/webui/src/App.tsx
ts/webui/src/App.tsx
+2
-0
ts/webui/src/components/experiment/trialdetail/ChangeColumnComponent.tsx
...mponents/experiment/trialdetail/ChangeColumnComponent.tsx
+1
-1
ts/webui/src/components/nav/slideNav/NNItabs.tsx
ts/webui/src/components/nav/slideNav/NNItabs.tsx
+5
-4
ts/webui/src/index.tsx
ts/webui/src/index.tsx
+19
-19
ts/webui/src/static/model/experiment.ts
ts/webui/src/static/model/experiment.ts
+3
-3
ts/webui/src/static/style/experiment/overview/succTable.scss
ts/webui/src/static/style/experiment/overview/succTable.scss
+2
-2
ts/webui/src/static/style/nav/nav.scss
ts/webui/src/static/style/nav/nav.scss
+4
-9
ts/webui/yarn.lock
ts/webui/yarn.lock
+2573
-2731
No files found.
ts/webui/package.json
View file @
0e835aa9
...
...
@@ -43,8 +43,7 @@
"react-monaco-editor"
:
"^0.32.1"
,
"react-paginate"
:
"^6.3.2"
,
"react-responsive"
:
"^8.1.1"
,
"react-router"
:
"^5.2.0"
,
"react-router-dom"
:
"^5.2.0"
,
"react-router-dom"
:
"^6.3.0"
,
"react-table"
:
"^7.0.0-rc.15"
,
"resolve"
:
"^1.10.0"
,
"sass-loader"
:
"^12.1.0"
,
...
...
ts/webui/src/App.tsx
View file @
0e835aa9
import
*
as
React
from
'
react
'
;
import
{
Outlet
}
from
'
react-router-dom
'
;
import
{
Stack
}
from
'
@fluentui/react
'
;
import
{
SlideNavBtns
}
from
'
@components/nav/slideNav/SlideNavBtns
'
;
import
{
EXPERIMENT
,
TRIALS
}
from
'
@static/datamodel
'
;
...
...
@@ -166,6 +167,7 @@ class App extends React.Component<{}, AppState> {
closeTimer
:
this
.
closeTimer
}
}
>
<
Outlet
/>
{
this
.
props
.
children
}
</
AppContext
.
Provider
>
</
Stack
>
...
...
ts/webui/src/components/experiment/trialdetail/ChangeColumnComponent.tsx
View file @
0e835aa9
...
...
@@ -118,7 +118,7 @@ class ChangeColumnComponent extends React.Component<ChangeColumnProps, ChangeCol
<
PrimaryButton
text
=
'Save'
onClick
=
{
this
.
saveUserSelectColumn
}
disabled
=
{
currentSelected
.
length
<
(
minSelected
===
undefined
?
1
:
minSelected
)
}
disabled
=
{
currentSelected
.
length
<
(
minSelected
??
1
)
}
/>
<
DefaultButton
text
=
'Cancel'
onClick
=
{
this
.
cancelOption
}
/>
</
DialogFooter
>
...
...
ts/webui/src/components/nav/slideNav/NNItabs.tsx
View file @
0e835aa9
...
...
@@ -2,16 +2,17 @@ import * as React from 'react';
import
{
NavLink
}
from
'
react-router-dom
'
;
import
{
getPrefix
}
from
'
@static/function
'
;
const
activeClassName
=
'
selected
'
;
const
OVERVIEWTABS
=
(
<
NavLink
to
=
'/oview'
activeC
lassName
=
'selected'
className
=
'common-tabs'
>
Overview
<
NavLink
to
=
'/oview'
c
lassName
=
{
({
isActive
})
=>
(
isActive
?
`
${
activeClassName
}
link`
:
'
link
'
)
}
>
<
span
className
=
'common-tabs'
>
Overview
</
span
>
</
NavLink
>
);
const
DETAILTABS
=
(
<
NavLink
to
=
'/detail'
activeC
lassName
=
'selected'
className
=
'common-tabs'
>
Trials detail
<
NavLink
to
=
'/detail'
c
lassName
=
{
({
isActive
})
=>
(
isActive
?
`
${
activeClassName
}
link`
:
'
link
'
)
}
>
<
span
className
=
'common-tabs'
>
Trials detail
</
span
>
</
NavLink
>
);
...
...
ts/webui/src/index.tsx
View file @
0e835aa9
...
...
@@ -2,7 +2,7 @@ import React, { lazy, Suspense } from 'react';
import
ReactDOM
from
'
react-dom
'
;
import
App
from
'
./App
'
;
import
{
getPrefix
}
from
'
./static/function
'
;
import
{
BrowserRouter
as
Router
,
Route
,
Switch
}
from
'
react-router-dom
'
;
import
{
BrowserRouter
as
Router
,
Route
s
,
Route
,
Navigate
}
from
'
react-router-dom
'
;
const
Overview
=
lazy
(()
=>
import
(
'
./components/experiment/overview/Overview
'
));
const
TrialsDetail
=
lazy
(()
=>
import
(
'
./components/experiment/trialdetail/TrialsDetail
'
));
const
ExperimentManagerIndex
=
lazy
(()
=>
import
(
'
./components/experimentManagement/ExperimentManagerIndex
'
));
...
...
@@ -13,24 +13,24 @@ import * as serviceWorker from './serviceWorker';
const
path
=
getPrefix
();
ReactDOM
.
render
(
<
Router
basename
=
{
path
===
undefined
?
null
:
path
}
>
<
Suspense
fallback
=
{
<
div
className
=
'loading'
>
<
img
title
=
'loading-graph'
src
=
{
(
path
||
''
)
+
'
/loading.gif
'
}
/
>
</
div
>
}
>
<
Route
path
=
'/experiment'
component
=
{
ExperimentManagerIndex
}
exact
/
>
<
Switch
>
<
App
>
<
Route
path
=
'/
'
compon
ent
=
{
Overview
}
exact
/>
<
Route
path
=
'/
oview'
component
=
{
Overview
}
/>
<
Route
path
=
'/
detail'
component
=
{
TrialsDetail
}
/>
</
App
>
</
Switch
>
</
Suspense
>
</
Router
>,
<
Suspense
fallback
=
{
<
div
className
=
'loading'
>
<
img
title
=
'loading-graph'
src
=
{
(
path
??
''
)
+
'
/loading.gif
'
}
/
>
</
div
>
}
>
<
Router
basename
=
{
path
??
''
}
>
<
Route
s
>
<
Route
path
=
'/experiment'
element
=
{
<
ExperimentManagerIndex
/>
}
/
>
<
Route
element
=
{
<
App
/>
}
>
<
Route
path
=
'/
oview'
elem
ent
=
{
<
Overview
/>
}
/>
<
Route
path
=
'/
detail'
element
=
{
<
TrialsDetail
/>
}
/>
<
Route
path
=
'/
*'
element
=
{
<
Navigate
to
=
'/oview'
/>
}
/>
</
Route
>
</
Routes
>
</
Router
>
</
Suspense
>,
document
.
getElementById
(
'
root
'
)
);
...
...
ts/webui/src/static/model/experiment.ts
View file @
0e835aa9
...
...
@@ -128,11 +128,11 @@ class Experiment {
}
get
profile
():
ExperimentProfile
{
return
this
.
profileField
===
undefined
?
emptyProfile
:
this
.
profileField
;
return
this
.
profileField
??
emptyProfile
;
}
get
metadata
():
ExperimentMetadata
{
return
this
.
metadataField
===
undefined
?
emptyMetadata
:
this
.
metadataField
;
return
this
.
metadataField
?
?
emptyMetadata
;
}
get
config
():
ExperimentConfig
{
...
...
@@ -146,7 +146,7 @@ class Experiment {
get
maxTrialNumber
():
number
{
const
value
=
this
.
config
.
maxTrialNumber
||
(
this
.
config
as
any
).
maxTrialNum
;
return
value
===
undefined
?
Infinity
:
value
;
return
value
?
?
Infinity
;
}
get
trialConcurrency
():
number
{
...
...
ts/webui/src/static/style/experiment/overview/succTable.scss
View file @
0e835aa9
...
...
@@ -20,9 +20,9 @@ $tableHeight: 432px;
top
:
50%
;
transform
:
translate
(
-50%
,
-50%
);
a
{
.common-tabs
{
color
:
#0071bc
;
font-weight
:
500
;
color
:
blue
;
}
}
...
...
ts/webui/src/static/style/nav/nav.scss
View file @
0e835aa9
...
...
@@ -72,25 +72,20 @@ $barHeight: 56px;
}
/* overview and detail tabs common style */
a
.common-tabs
{
.common-tabs
{
font-family
:
'Segoe UI'
,
Tahoma
,
Geneva
,
Verdana
,
sans-serif
;
font-size
:
16px
;
color
:
#b8c7ce
;
text-decoration
:
none
;
}
.common-tabs
:visited
,
.selected
:hover
{
color
:
#fff
;
text-decoration
:
none
;
}
.common-tabs
:hover
,
.selected
{
.selected
.common-tabs
{
color
:
#fff
;
padding-bottom
:
2px
;
border-bottom
:
1px
solid
#fff
;
}
.left-right-margin
{
margin-left
:
20px
;
margin-right
:
20px
;
...
...
ts/webui/yarn.lock
View file @
0e835aa9
This diff is collapsed.
Click to expand it.
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