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
b0bcde86
Unverified
Commit
b0bcde86
authored
Mar 23, 2022
by
Lijiaoa
Committed by
GitHub
Mar 23, 2022
Browse files
Refine webui (#4548)
parent
b4d8aebb
Changes
89
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
46 additions
and
59 deletions
+46
-59
ts/webui/src/components/nav/slideNav/LogPanel.tsx
ts/webui/src/components/nav/slideNav/LogPanel.tsx
+24
-24
ts/webui/src/components/nav/slideNav/NNItabs.tsx
ts/webui/src/components/nav/slideNav/NNItabs.tsx
+1
-1
ts/webui/src/components/nav/slideNav/SlideNavBtns.tsx
ts/webui/src/components/nav/slideNav/SlideNavBtns.tsx
+7
-3
ts/webui/src/components/nav/slideNav/TrialConfigPanel.tsx
ts/webui/src/components/nav/slideNav/TrialConfigPanel.tsx
+6
-6
ts/webui/src/components/public-child/IntermediateVal.tsx
ts/webui/src/components/public-child/IntermediateVal.tsx
+0
-18
ts/webui/src/index.tsx
ts/webui/src/index.tsx
+6
-6
ts/webui/src/static/jsonutil.ts
ts/webui/src/static/jsonutil.ts
+0
-0
ts/webui/src/static/style/App.scss
ts/webui/src/static/style/App.scss
+0
-0
ts/webui/src/static/style/common/common.scss
ts/webui/src/static/style/common/common.scss
+0
-0
ts/webui/src/static/style/common/experimentStatusColor.scss
ts/webui/src/static/style/common/experimentStatusColor.scss
+1
-0
ts/webui/src/static/style/common/trialStatus.css
ts/webui/src/static/style/common/trialStatus.css
+1
-1
ts/webui/src/static/style/experiment/overview/basic.scss
ts/webui/src/static/style/experiment/overview/basic.scss
+0
-0
ts/webui/src/static/style/experiment/overview/command.scss
ts/webui/src/static/style/experiment/overview/command.scss
+0
-0
ts/webui/src/static/style/experiment/overview/count.scss
ts/webui/src/static/style/experiment/overview/count.scss
+0
-0
ts/webui/src/static/style/experiment/overview/overview.scss
ts/webui/src/static/style/experiment/overview/overview.scss
+0
-0
ts/webui/src/static/style/experiment/overview/overviewTitle.scss
...i/src/static/style/experiment/overview/overviewTitle.scss
+0
-0
ts/webui/src/static/style/experiment/overview/succTable.scss
ts/webui/src/static/style/experiment/overview/succTable.scss
+0
-0
ts/webui/src/static/style/experiment/overview/topTrial.scss
ts/webui/src/static/style/experiment/overview/topTrial.scss
+0
-0
ts/webui/src/static/style/experiment/trialdetail/compare.scss
...ebui/src/static/style/experiment/trialdetail/compare.scss
+0
-0
ts/webui/src/static/style/experiment/trialdetail/customized.scss
...i/src/static/style/experiment/trialdetail/customized.scss
+0
-0
No files found.
ts/webui/src/components/
modals
/LogPanel.tsx
→
ts/webui/src/components/
nav/slideNav
/LogPanel.tsx
View file @
b0bcde86
import
*
as
React
from
'
react
'
;
import
*
as
React
from
'
react
'
;
import
axios
from
'
axios
'
;
import
axios
from
'
axios
'
;
import
{
Stack
,
StackItem
,
Panel
,
PrimaryButton
,
DefaultButton
,
Pivot
,
PivotItem
}
from
'
@fluentui/react
'
;
import
{
Stack
,
StackItem
,
Panel
,
PrimaryButton
,
DefaultButton
,
Pivot
,
PivotItem
}
from
'
@fluentui/react
'
;
import
{
infoIcon
}
from
'
../buttons/I
con
'
;
import
{
DOWNLOAD_IP
}
from
'
@static/
con
st
'
;
import
{
DOWNLOAD_IP
}
from
'
../../
static/
const
'
;
import
{
downFile
}
from
'
@
static/
function
'
;
import
{
downFile
}
from
'
../../static/functi
on
'
;
import
{
infoIcon
}
from
'
@components/fluent/Ic
on
'
;
import
MonacoHTML
from
'
../public-child
/MonacoEditor
'
;
import
MonacoHTML
from
'
@components/common
/MonacoEditor
'
;
import
'
../../static/
style/log
Drawer
.scss
'
;
import
'
@
style/log
Panel
.scss
'
;
interface
Log
Drawer
Props
{
interface
Log
Panel
Props
{
close
Drawer
:
()
=>
void
;
close
Panel
:
()
=>
void
;
activeTab
?:
string
;
activeTab
?:
string
;
}
}
interface
Log
Drawer
State
{
interface
Log
Panel
State
{
nniManagerLogStr
:
string
|
null
;
nniManagerLogStr
:
string
|
null
;
dispatcherLogStr
:
string
|
null
;
dispatcherLogStr
:
string
|
null
;
isLoading
:
boolean
;
isLoading
:
boolean
;
log
Drawer
Height
:
number
;
log
Panel
Height
:
number
;
}
}
class
Log
Drawer
extends
React
.
Component
<
Log
Drawer
Props
,
Log
Drawer
State
>
{
class
Log
Panel
extends
React
.
Component
<
Log
Panel
Props
,
Log
Panel
State
>
{
private
timerId
:
number
|
undefined
;
private
timerId
:
number
|
undefined
;
constructor
(
props
:
Log
Drawer
Props
)
{
constructor
(
props
:
Log
Panel
Props
)
{
super
(
props
);
super
(
props
);
this
.
state
=
{
this
.
state
=
{
nniManagerLogStr
:
null
,
nniManagerLogStr
:
null
,
dispatcherLogStr
:
null
,
dispatcherLogStr
:
null
,
isLoading
:
true
,
isLoading
:
true
,
log
Drawer
Height
:
window
.
innerHeight
log
Panel
Height
:
window
.
innerHeight
};
};
}
}
...
@@ -63,25 +63,25 @@ class LogDrawer extends React.Component<LogDrawerProps, LogDrawerState> {
...
@@ -63,25 +63,25 @@ class LogDrawer extends React.Component<LogDrawerProps, LogDrawerState> {
</
div
>
</
div
>
);
);
setLog
Drawer
Height
=
():
void
=>
{
setLog
Panel
Height
=
():
void
=>
{
this
.
setState
(()
=>
({
log
Drawer
Height
:
window
.
innerHeight
}));
this
.
setState
(()
=>
({
log
Panel
Height
:
window
.
innerHeight
}));
};
};
async
componentDidMount
():
Promise
<
void
>
{
async
componentDidMount
():
Promise
<
void
>
{
this
.
refresh
();
this
.
refresh
();
window
.
addEventListener
(
'
resize
'
,
this
.
setLog
Drawer
Height
);
window
.
addEventListener
(
'
resize
'
,
this
.
setLog
Panel
Height
);
}
}
componentWillUnmount
():
void
{
componentWillUnmount
():
void
{
window
.
clearTimeout
(
this
.
timerId
);
window
.
clearTimeout
(
this
.
timerId
);
window
.
removeEventListener
(
'
resize
'
,
this
.
setLog
Drawer
Height
);
window
.
removeEventListener
(
'
resize
'
,
this
.
setLog
Panel
Height
);
}
}
render
():
React
.
ReactNode
{
render
():
React
.
ReactNode
{
const
{
close
Drawer
,
activeTab
}
=
this
.
props
;
const
{
close
Panel
,
activeTab
}
=
this
.
props
;
const
{
nniManagerLogStr
,
dispatcherLogStr
,
isLoading
,
log
Drawer
Height
}
=
this
.
state
;
const
{
nniManagerLogStr
,
dispatcherLogStr
,
isLoading
,
log
Panel
Height
}
=
this
.
state
;
// tab[height: 56] + tab[margin-bottom: 20] + button[32] + button[margin-top: 45, -bottom: 7] + fluent-panel own paddingBottom[20] + title-border[2]
// tab[height: 56] + tab[margin-bottom: 20] + button[32] + button[margin-top: 45, -bottom: 7] + fluent-panel own paddingBottom[20] + title-border[2]
const
monacoHeight
=
log
Drawer
Height
-
182
;
const
monacoHeight
=
log
Panel
Height
-
182
;
return
(
return
(
<
Stack
>
<
Stack
>
<
Panel
<
Panel
...
@@ -89,7 +89,7 @@ class LogDrawer extends React.Component<LogDrawerProps, LogDrawerState> {
...
@@ -89,7 +89,7 @@ class LogDrawer extends React.Component<LogDrawerProps, LogDrawerState> {
hasCloseButton
=
{
false
}
hasCloseButton
=
{
false
}
isFooterAtBottom
=
{
true
}
isFooterAtBottom
=
{
true
}
isLightDismiss
=
{
true
}
isLightDismiss
=
{
true
}
onLightDismissClick
=
{
close
Drawer
}
onLightDismissClick
=
{
close
Panel
}
className
=
'logPanel'
className
=
'logPanel'
>
>
<
Pivot
selectedKey
=
{
activeTab
}
style
=
{
{
minHeight
:
190
}
}
>
<
Pivot
selectedKey
=
{
activeTab
}
style
=
{
{
minHeight
:
190
}
}
>
...
@@ -105,7 +105,7 @@ class LogDrawer extends React.Component<LogDrawerProps, LogDrawerState> {
...
@@ -105,7 +105,7 @@ class LogDrawer extends React.Component<LogDrawerProps, LogDrawerState> {
<
PrimaryButton
text
=
'Download'
onClick
=
{
this
.
downloadDispatcher
}
/>
<
PrimaryButton
text
=
'Download'
onClick
=
{
this
.
downloadDispatcher
}
/>
</
StackItem
>
</
StackItem
>
<
StackItem
grow
=
{
12
}
className
=
'close'
>
<
StackItem
grow
=
{
12
}
className
=
'close'
>
<
DefaultButton
text
=
'Close'
onClick
=
{
close
Drawer
}
/>
<
DefaultButton
text
=
'Close'
onClick
=
{
close
Panel
}
/>
</
StackItem
>
</
StackItem
>
</
Stack
>
</
Stack
>
</
div
>
</
div
>
...
@@ -122,7 +122,7 @@ class LogDrawer extends React.Component<LogDrawerProps, LogDrawerState> {
...
@@ -122,7 +122,7 @@ class LogDrawer extends React.Component<LogDrawerProps, LogDrawerState> {
<
PrimaryButton
text
=
'Download'
onClick
=
{
this
.
downloadNNImanager
}
/>
<
PrimaryButton
text
=
'Download'
onClick
=
{
this
.
downloadNNImanager
}
/>
</
StackItem
>
</
StackItem
>
<
StackItem
grow
=
{
12
}
className
=
'close'
>
<
StackItem
grow
=
{
12
}
className
=
'close'
>
<
DefaultButton
text
=
'Close'
onClick
=
{
close
Drawer
}
/>
<
DefaultButton
text
=
'Close'
onClick
=
{
close
Panel
}
/>
</
StackItem
>
</
StackItem
>
</
Stack
>
</
Stack
>
</
div
>
</
div
>
...
@@ -159,4 +159,4 @@ class LogDrawer extends React.Component<LogDrawerProps, LogDrawerState> {
...
@@ -159,4 +159,4 @@ class LogDrawer extends React.Component<LogDrawerProps, LogDrawerState> {
};
};
}
}
export
default
Log
Drawer
;
export
default
Log
Panel
;
ts/webui/src/components/
stateless-component
/NNItabs.tsx
→
ts/webui/src/components/
nav/slideNav
/NNItabs.tsx
View file @
b0bcde86
import
*
as
React
from
'
react
'
;
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
OVERVIEWTABS
=
(
const
OVERVIEWTABS
=
(
<
NavLink
to
=
'/oview'
activeClassName
=
'selected'
className
=
'common-tabs'
>
<
NavLink
to
=
'/oview'
activeClassName
=
'selected'
className
=
'common-tabs'
>
...
...
ts/webui/src/components/slideNav/SlideNavBtns.tsx
→
ts/webui/src/components/
nav/
slideNav/SlideNavBtns.tsx
View file @
b0bcde86
...
@@ -2,10 +2,14 @@ import React, { useState, useCallback } from 'react';
...
@@ -2,10 +2,14 @@ import React, { useState, useCallback } from 'react';
import
{
Stack
,
DefaultButton
,
Icon
}
from
'
@fluentui/react
'
;
import
{
Stack
,
DefaultButton
,
Icon
}
from
'
@fluentui/react
'
;
import
MediaQuery
from
'
react-responsive
'
;
import
MediaQuery
from
'
react-responsive
'
;
import
TrialConfigPanel
from
'
./TrialConfigPanel
'
;
import
TrialConfigPanel
from
'
./TrialConfigPanel
'
;
import
LogPanel
from
'
.
./modals
/LogPanel
'
;
import
LogPanel
from
'
./LogPanel
'
;
import
IconButtonTemplate
from
'
./IconButtonTemplet
'
;
import
IconButtonTemplate
from
'
./IconButtonTemplet
'
;
import
'
../../static/style/overview/panel
.scss
'
;
import
'
@style/nav/slideNavBtns
.scss
'
;
/***
* this file is the container of [config, search space, dispatcher/nnimanager log]
* these three button is in the right of page
*/
export
const
SlideNavBtns
=
():
any
=>
{
export
const
SlideNavBtns
=
():
any
=>
{
const
[
isShowConfigPanel
,
setShowConfigPanle
]
=
useState
(
false
);
const
[
isShowConfigPanel
,
setShowConfigPanle
]
=
useState
(
false
);
const
[
isShowLogPanel
,
setShowLogPanel
]
=
useState
(
false
);
const
[
isShowLogPanel
,
setShowLogPanel
]
=
useState
(
false
);
...
@@ -57,7 +61,7 @@ export const SlideNavBtns = (): any => {
...
@@ -57,7 +61,7 @@ export const SlideNavBtns = (): any => {
</
Stack
>
</
Stack
>
{
isShowConfigPanel
&&
<
TrialConfigPanel
panelName
=
{
panelName
}
hideConfigPanel
=
{
hideConfigPanel
}
/>
}
{
isShowConfigPanel
&&
<
TrialConfigPanel
panelName
=
{
panelName
}
hideConfigPanel
=
{
hideConfigPanel
}
/>
}
{
/* the panel for dispatcher & nnimanager log message */
}
{
/* the panel for dispatcher & nnimanager log message */
}
{
isShowLogPanel
&&
<
LogPanel
close
Drawer
=
{
hideLogPanel
}
/>
}
{
isShowLogPanel
&&
<
LogPanel
close
Panel
=
{
hideLogPanel
}
/>
}
</
React
.
Fragment
>
</
React
.
Fragment
>
);
);
};
};
ts/webui/src/components/slideNav/TrialConfigPanel.tsx
→
ts/webui/src/components/
nav/
slideNav/TrialConfigPanel.tsx
View file @
b0bcde86
import
*
as
React
from
'
react
'
;
import
*
as
React
from
'
react
'
;
import
{
Stack
,
Panel
,
PrimaryButton
}
from
'
@fluentui/react
'
;
import
{
Stack
,
Panel
,
PrimaryButton
}
from
'
@fluentui/react
'
;
import
{
EXPERIMENT
}
from
'
../../static/datamodel
'
;
import
MonacoEditor
from
'
react-monaco-editor
'
;
import
{
MONACO
}
from
'
../../static/const
'
;
import
{
convertDuration
,
caclMonacoEditorHeight
}
from
'
../../static/function
'
;
import
{
prettyStringify
}
from
'
../../static/json_util
'
;
import
lodash
from
'
lodash
'
;
import
lodash
from
'
lodash
'
;
import
'
../../static/style/logDrawer.scss
'
;
import
MonacoEditor
from
'
react-monaco-editor
'
;
import
{
EXPERIMENT
}
from
'
@static/datamodel
'
;
import
{
MONACO
}
from
'
@static/const
'
;
import
{
convertDuration
,
caclMonacoEditorHeight
}
from
'
@static/function
'
;
import
{
prettyStringify
}
from
'
@static/jsonutil
'
;
import
'
@static/style/logPanel.scss
'
;
interface
LogDrawerProps
{
interface
LogDrawerProps
{
hideConfigPanel
:
()
=>
void
;
hideConfigPanel
:
()
=>
void
;
...
...
ts/webui/src/components/public-child/IntermediateVal.tsx
deleted
100644 → 0
View file @
b4d8aebb
import
*
as
React
from
'
react
'
;
import
{
TRIALS
}
from
'
../../static/datamodel
'
;
interface
IntermediateValProps
{
trialId
:
string
;
}
class
IntermediateVal
extends
React
.
Component
<
IntermediateValProps
,
{}
>
{
constructor
(
props
:
IntermediateValProps
)
{
super
(
props
);
}
render
():
React
.
ReactNode
{
return
<
div
>
{
TRIALS
.
getTrial
(
this
.
props
.
trialId
).
formatLatestAccuracy
()
}
</
div
>;
}
}
export
default
IntermediateVal
;
ts/webui/src/index.tsx
View file @
b0bcde86
...
@@ -3,11 +3,11 @@ import ReactDOM from 'react-dom';
...
@@ -3,11 +3,11 @@ 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
,
Switch
}
from
'
react-router-dom
'
;
const
Overview
=
lazy
(()
=>
import
(
'
./components/Overview
'
));
const
Overview
=
lazy
(()
=>
import
(
'
./components/
experiment/overview/
Overview
'
));
const
TrialsDetail
=
lazy
(()
=>
import
(
'
./components/TrialsDetail
'
));
const
TrialsDetail
=
lazy
(()
=>
import
(
'
./components/
experiment/trialdetail/
TrialsDetail
'
));
const
Experiment
=
lazy
(()
=>
import
(
'
./components/
m
anagement
Exp
/ExperimentManager
'
));
const
Experiment
ManagerIndex
=
lazy
(()
=>
import
(
'
./components/
experimentM
anagement/ExperimentManager
Index
'
));
import
'
.
/index.css
'
;
import
'
@style
/index.css
'
;
import
'
./static/
style/loading.scss
'
;
import
'
@
style/loading.scss
'
;
import
*
as
serviceWorker
from
'
./serviceWorker
'
;
import
*
as
serviceWorker
from
'
./serviceWorker
'
;
const
path
=
getPrefix
();
const
path
=
getPrefix
();
...
@@ -21,7 +21,7 @@ ReactDOM.render(
...
@@ -21,7 +21,7 @@ ReactDOM.render(
</
div
>
</
div
>
}
}
>
>
<
Route
path
=
'/experiment'
component
=
{
Experiment
}
exact
/>
<
Route
path
=
'/experiment'
component
=
{
Experiment
ManagerIndex
}
exact
/>
<
Switch
>
<
Switch
>
<
App
>
<
App
>
<
Route
path
=
'/'
component
=
{
Overview
}
exact
/>
<
Route
path
=
'/'
component
=
{
Overview
}
exact
/>
...
...
ts/webui/src/static/json
_
util.ts
→
ts/webui/src/static/jsonutil.ts
View file @
b0bcde86
File moved
ts/webui/src/App.scss
→
ts/webui/src/
static/style/
App.scss
View file @
b0bcde86
File moved
ts/webui/src/static/style/common.scss
→
ts/webui/src/static/style/common
/common
.scss
View file @
b0bcde86
File moved
ts/webui/src/static/style/
overview/proba
r.scss
→
ts/webui/src/static/style/
common/experimentStatusColo
r.scss
View file @
b0bcde86
...
@@ -36,6 +36,7 @@ $error: #a4262c;
...
@@ -36,6 +36,7 @@ $error: #a4262c;
}
}
}
}
/* set color for experiment best-metric value in overview page */
.bestMetric
{
.bestMetric
{
.DONE
,
.DONE
,
.STOPPED
,
.STOPPED
,
...
...
ts/webui/src/static/style/
table
Status.css
→
ts/webui/src/static/style/
common/trial
Status.css
View file @
b0bcde86
/* all t
able
status font-color */
/* all t
rial
status font-color
in the table
*/
.RUNNING
,
.RUNNING
,
.USER_CANCELED
{
.USER_CANCELED
{
color
:
#0071bc
;
color
:
#0071bc
;
...
...
ts/webui/src/static/style/overview/basic.scss
→
ts/webui/src/static/style/
experiment/
overview/basic.scss
View file @
b0bcde86
File moved
ts/webui/src/static/style/overview/command.scss
→
ts/webui/src/static/style/
experiment/
overview/command.scss
View file @
b0bcde86
File moved
ts/webui/src/static/style/overview/count.scss
→
ts/webui/src/static/style/
experiment/
overview/count.scss
View file @
b0bcde86
File moved
ts/webui/src/static/style/overview/overview.scss
→
ts/webui/src/static/style/
experiment/
overview/overview.scss
View file @
b0bcde86
File moved
ts/webui/src/static/style/overview/overviewTitle.scss
→
ts/webui/src/static/style/
experiment/
overview/overviewTitle.scss
View file @
b0bcde86
File moved
ts/webui/src/static/style/succTable.scss
→
ts/webui/src/static/style/
experiment/overview/
succTable.scss
View file @
b0bcde86
File moved
ts/webui/src/static/style/overview/topTrial.scss
→
ts/webui/src/static/style/
experiment/
overview/topTrial.scss
View file @
b0bcde86
File moved
ts/webui/src/static/style/compare.scss
→
ts/webui/src/static/style/
experiment/trialdetail/
compare.scss
View file @
b0bcde86
File moved
ts/webui/src/
components/modals
/customized.scss
→
ts/webui/src/
static/style/experiment/trialdetail
/customized.scss
View file @
b0bcde86
File moved
Prev
1
2
3
4
5
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