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
"docs/vscode:/vscode.git/clone" did not exist on "25db55caee4325b3b8ad3e3b48de76f349beeae6"
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
Show 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 @@
...
@@ -43,8 +43,7 @@
"react-monaco-editor"
:
"^0.32.1"
,
"react-monaco-editor"
:
"^0.32.1"
,
"react-paginate"
:
"^6.3.2"
,
"react-paginate"
:
"^6.3.2"
,
"react-responsive"
:
"^8.1.1"
,
"react-responsive"
:
"^8.1.1"
,
"react-router"
:
"^5.2.0"
,
"react-router-dom"
:
"^6.3.0"
,
"react-router-dom"
:
"^5.2.0"
,
"react-table"
:
"^7.0.0-rc.15"
,
"react-table"
:
"^7.0.0-rc.15"
,
"resolve"
:
"^1.10.0"
,
"resolve"
:
"^1.10.0"
,
"sass-loader"
:
"^12.1.0"
,
"sass-loader"
:
"^12.1.0"
,
...
...
ts/webui/src/App.tsx
View file @
0e835aa9
import
*
as
React
from
'
react
'
;
import
*
as
React
from
'
react
'
;
import
{
Outlet
}
from
'
react-router-dom
'
;
import
{
Stack
}
from
'
@fluentui/react
'
;
import
{
Stack
}
from
'
@fluentui/react
'
;
import
{
SlideNavBtns
}
from
'
@components/nav/slideNav/SlideNavBtns
'
;
import
{
SlideNavBtns
}
from
'
@components/nav/slideNav/SlideNavBtns
'
;
import
{
EXPERIMENT
,
TRIALS
}
from
'
@static/datamodel
'
;
import
{
EXPERIMENT
,
TRIALS
}
from
'
@static/datamodel
'
;
...
@@ -166,6 +167,7 @@ class App extends React.Component<{}, AppState> {
...
@@ -166,6 +167,7 @@ class App extends React.Component<{}, AppState> {
closeTimer
:
this
.
closeTimer
closeTimer
:
this
.
closeTimer
}
}
}
}
>
>
<
Outlet
/>
{
this
.
props
.
children
}
{
this
.
props
.
children
}
</
AppContext
.
Provider
>
</
AppContext
.
Provider
>
</
Stack
>
</
Stack
>
...
...
ts/webui/src/components/experiment/trialdetail/ChangeColumnComponent.tsx
View file @
0e835aa9
...
@@ -118,7 +118,7 @@ class ChangeColumnComponent extends React.Component<ChangeColumnProps, ChangeCol
...
@@ -118,7 +118,7 @@ class ChangeColumnComponent extends React.Component<ChangeColumnProps, ChangeCol
<
PrimaryButton
<
PrimaryButton
text
=
'Save'
text
=
'Save'
onClick
=
{
this
.
saveUserSelectColumn
}
onClick
=
{
this
.
saveUserSelectColumn
}
disabled
=
{
currentSelected
.
length
<
(
minSelected
===
undefined
?
1
:
minSelected
)
}
disabled
=
{
currentSelected
.
length
<
(
minSelected
??
1
)
}
/>
/>
<
DefaultButton
text
=
'Cancel'
onClick
=
{
this
.
cancelOption
}
/>
<
DefaultButton
text
=
'Cancel'
onClick
=
{
this
.
cancelOption
}
/>
</
DialogFooter
>
</
DialogFooter
>
...
...
ts/webui/src/components/nav/slideNav/NNItabs.tsx
View file @
0e835aa9
...
@@ -2,16 +2,17 @@ import * as React from 'react';
...
@@ -2,16 +2,17 @@ import * as React from 'react';
import
{
NavLink
}
from
'
react-router-dom
'
;
import
{
NavLink
}
from
'
react-router-dom
'
;
import
{
getPrefix
}
from
'
@static/function
'
;
import
{
getPrefix
}
from
'
@static/function
'
;
const
activeClassName
=
'
selected
'
;
const
OVERVIEWTABS
=
(
const
OVERVIEWTABS
=
(
<
NavLink
to
=
'/oview'
activeC
lassName
=
'selected'
className
=
'common-tabs'
>
<
NavLink
to
=
'/oview'
c
lassName
=
{
({
isActive
})
=>
(
isActive
?
`
${
activeClassName
}
link`
:
'
link
'
)
}
>
Overview
<
span
className
=
'common-tabs'
>
Overview
</
span
>
</
NavLink
>
</
NavLink
>
);
);
const
DETAILTABS
=
(
const
DETAILTABS
=
(
<
NavLink
to
=
'/detail'
activeC
lassName
=
'selected'
className
=
'common-tabs'
>
<
NavLink
to
=
'/detail'
c
lassName
=
{
({
isActive
})
=>
(
isActive
?
`
${
activeClassName
}
link`
:
'
link
'
)
}
>
Trials detail
<
span
className
=
'common-tabs'
>
Trials detail
</
span
>
</
NavLink
>
</
NavLink
>
);
);
...
...
ts/webui/src/index.tsx
View file @
0e835aa9
...
@@ -2,7 +2,7 @@ import React, { lazy, Suspense } from 'react';
...
@@ -2,7 +2,7 @@ import React, { lazy, Suspense } from 'react';
import
ReactDOM
from
'
react-dom
'
;
import
ReactDOM
from
'
react-dom
'
;
import
App
from
'
./App
'
;
import
App
from
'
./App
'
;
import
{
getPrefix
}
from
'
./static/function
'
;
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
Overview
=
lazy
(()
=>
import
(
'
./components/experiment/overview/Overview
'
));
const
TrialsDetail
=
lazy
(()
=>
import
(
'
./components/experiment/trialdetail/TrialsDetail
'
));
const
TrialsDetail
=
lazy
(()
=>
import
(
'
./components/experiment/trialdetail/TrialsDetail
'
));
const
ExperimentManagerIndex
=
lazy
(()
=>
import
(
'
./components/experimentManagement/ExperimentManagerIndex
'
));
const
ExperimentManagerIndex
=
lazy
(()
=>
import
(
'
./components/experimentManagement/ExperimentManagerIndex
'
));
...
@@ -13,24 +13,24 @@ import * as serviceWorker from './serviceWorker';
...
@@ -13,24 +13,24 @@ import * as serviceWorker from './serviceWorker';
const
path
=
getPrefix
();
const
path
=
getPrefix
();
ReactDOM
.
render
(
ReactDOM
.
render
(
<
Router
basename
=
{
path
===
undefined
?
null
:
path
}
>
<
Suspense
<
Suspense
fallback
=
{
fallback
=
{
<
div
className
=
'loading'
>
<
div
className
=
'loading'
>
<
img
title
=
'loading-graph'
src
=
{
(
path
||
''
)
+
'
/loading.gif
'
}
/>
<
img
title
=
'loading-graph'
src
=
{
(
path
??
''
)
+
'
/loading.gif
'
}
/>
</
div
>
</
div
>
}
}
>
>
<
Route
path
=
'/experiment'
component
=
{
ExperimentManagerIndex
}
exact
/>
<
Router
basename
=
{
path
??
''
}
>
<
Switch
>
<
Routes
>
<
App
>
<
Route
path
=
'/experiment'
element
=
{
<
ExperimentManagerIndex
/>
}
/>
<
Route
path
=
'/'
component
=
{
Overview
}
exact
/>
<
Route
element
=
{
<
App
/>
}
>
<
Route
path
=
'/oview'
component
=
{
Overview
}
/>
<
Route
path
=
'/oview'
element
=
{
<
Overview
/>
}
/>
<
Route
path
=
'/detail'
component
=
{
TrialsDetail
}
/>
<
Route
path
=
'/detail'
element
=
{
<
TrialsDetail
/>
}
/>
</
App
>
<
Route
path
=
'/*'
element
=
{
<
Navigate
to
=
'/oview'
/>
}
/>
</
Switch
>
</
Route
>
</
Suspense
>
</
Routes
>
</
Router
>,
</
Router
>
</
Suspense
>,
document
.
getElementById
(
'
root
'
)
document
.
getElementById
(
'
root
'
)
);
);
...
...
ts/webui/src/static/model/experiment.ts
View file @
0e835aa9
...
@@ -128,11 +128,11 @@ class Experiment {
...
@@ -128,11 +128,11 @@ class Experiment {
}
}
get
profile
():
ExperimentProfile
{
get
profile
():
ExperimentProfile
{
return
this
.
profileField
===
undefined
?
emptyProfile
:
this
.
profileField
;
return
this
.
profileField
??
emptyProfile
;
}
}
get
metadata
():
ExperimentMetadata
{
get
metadata
():
ExperimentMetadata
{
return
this
.
metadataField
===
undefined
?
emptyMetadata
:
this
.
metadataField
;
return
this
.
metadataField
?
?
emptyMetadata
;
}
}
get
config
():
ExperimentConfig
{
get
config
():
ExperimentConfig
{
...
@@ -146,7 +146,7 @@ class Experiment {
...
@@ -146,7 +146,7 @@ class Experiment {
get
maxTrialNumber
():
number
{
get
maxTrialNumber
():
number
{
const
value
=
this
.
config
.
maxTrialNumber
||
(
this
.
config
as
any
).
maxTrialNum
;
const
value
=
this
.
config
.
maxTrialNumber
||
(
this
.
config
as
any
).
maxTrialNum
;
return
value
===
undefined
?
Infinity
:
value
;
return
value
?
?
Infinity
;
}
}
get
trialConcurrency
():
number
{
get
trialConcurrency
():
number
{
...
...
ts/webui/src/static/style/experiment/overview/succTable.scss
View file @
0e835aa9
...
@@ -20,9 +20,9 @@ $tableHeight: 432px;
...
@@ -20,9 +20,9 @@ $tableHeight: 432px;
top
:
50%
;
top
:
50%
;
transform
:
translate
(
-50%
,
-50%
);
transform
:
translate
(
-50%
,
-50%
);
a
{
.common-tabs
{
color
:
#0071bc
;
font-weight
:
500
;
font-weight
:
500
;
color
:
blue
;
}
}
}
}
...
...
ts/webui/src/static/style/nav/nav.scss
View file @
0e835aa9
...
@@ -72,25 +72,20 @@ $barHeight: 56px;
...
@@ -72,25 +72,20 @@ $barHeight: 56px;
}
}
/* overview and detail tabs common style */
/* overview and detail tabs common style */
a
.common-tabs
{
.common-tabs
{
font-family
:
'Segoe UI'
,
Tahoma
,
Geneva
,
Verdana
,
sans-serif
;
font-family
:
'Segoe UI'
,
Tahoma
,
Geneva
,
Verdana
,
sans-serif
;
font-size
:
16px
;
font-size
:
16px
;
color
:
#b8c7ce
;
color
:
#b8c7ce
;
text-decoration
:
none
;
text-decoration
:
none
;
}
}
.common-tabs
:visited
,
.selected
.common-tabs
{
.selected
:hover
{
color
:
#fff
;
text-decoration
:
none
;
}
.common-tabs
:hover
,
.selected
{
color
:
#fff
;
color
:
#fff
;
padding-bottom
:
2px
;
border-bottom
:
1px
solid
#fff
;
border-bottom
:
1px
solid
#fff
;
}
}
.left-right-margin
{
.left-right-margin
{
margin-left
:
20px
;
margin-left
:
20px
;
margin-right
:
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