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
36e6e350
Unverified
Commit
36e6e350
authored
Dec 19, 2019
by
SparkSnail
Committed by
GitHub
Dec 19, 2019
Browse files
Merge pull request #221 from microsoft/master
merge master
parents
543239c6
7cbde508
Changes
74
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
1785 additions
and
265 deletions
+1785
-265
src/webui/.eslintrc
src/webui/.eslintrc
+38
-0
src/webui/config/paths.js
src/webui/config/paths.js
+0
-1
src/webui/config/webpack.config.dev.js
src/webui/config/webpack.config.dev.js
+1
-1
src/webui/config/webpack.config.prod.js
src/webui/config/webpack.config.prod.js
+1
-1
src/webui/package.json
src/webui/package.json
+7
-3
src/webui/src/App.tsx
src/webui/src/App.tsx
+0
-1
src/webui/src/components/overview/TrialProfile.tsx
src/webui/src/components/overview/TrialProfile.tsx
+0
-1
src/webui/src/registerServiceWorker.ts
src/webui/src/registerServiceWorker.ts
+28
-29
src/webui/src/static/function.ts
src/webui/src/static/function.ts
+2
-2
src/webui/src/static/interface.ts
src/webui/src/static/interface.ts
+0
-2
src/webui/src/static/model/trial.ts
src/webui/src/static/model/trial.ts
+1
-1
src/webui/src/static/model/trialmanager.ts
src/webui/src/static/model/trialmanager.ts
+12
-12
src/webui/tslint.json
src/webui/tslint.json
+0
-111
src/webui/yarn.lock
src/webui/yarn.lock
+1695
-100
No files found.
src/webui/.eslintrc
0 → 100644
View file @
36e6e350
{
"env": {
"browser": true,
"es6": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-namespace": 0,
"@typescript-eslint/consistent-type-assertions": 0,
"@typescript-eslint/no-inferrable-types": 0,
"no-inner-declarations": 0,
"@typescript-eslint/no-var-requires": 0
},
"ignorePatterns": [
"node_modules/",
"build/",
"**/*.js"
],
"settings": {
"react": {
"version": "detect"
}
}
}
src/webui/config/paths.js
View file @
36e6e350
...
@@ -52,7 +52,6 @@ module.exports = {
...
@@ -52,7 +52,6 @@ module.exports = {
appNodeModules
:
resolveApp
(
'
node_modules
'
),
appNodeModules
:
resolveApp
(
'
node_modules
'
),
appTsConfig
:
resolveApp
(
'
tsconfig.json
'
),
appTsConfig
:
resolveApp
(
'
tsconfig.json
'
),
appTsProdConfig
:
resolveApp
(
'
tsconfig.prod.json
'
),
appTsProdConfig
:
resolveApp
(
'
tsconfig.prod.json
'
),
appTsLint
:
resolveApp
(
'
tslint.json
'
),
publicUrl
:
getPublicUrl
(
resolveApp
(
'
package.json
'
)),
publicUrl
:
getPublicUrl
(
resolveApp
(
'
package.json
'
)),
servedPath
:
getServedPath
(
resolveApp
(
'
package.json
'
)),
servedPath
:
getServedPath
(
resolveApp
(
'
package.json
'
)),
};
};
src/webui/config/webpack.config.dev.js
View file @
36e6e350
...
@@ -186,7 +186,7 @@ module.exports = {
...
@@ -186,7 +186,7 @@ module.exports = {
async
:
false
,
async
:
false
,
watch
:
paths
.
appSrc
,
watch
:
paths
.
appSrc
,
tsconfig
:
paths
.
appTsConfig
,
tsconfig
:
paths
.
appTsConfig
,
t
slint
:
paths
.
appTsLint
,
e
slint
:
false
}),
}),
],
],
// Some libraries import Node modules but don't use them in the browser.
// Some libraries import Node modules but don't use them in the browser.
...
...
src/webui/config/webpack.config.prod.js
View file @
36e6e350
...
@@ -231,7 +231,7 @@ module.exports = {
...
@@ -231,7 +231,7 @@ module.exports = {
new
ForkTsCheckerWebpackPlugin
({
new
ForkTsCheckerWebpackPlugin
({
async
:
false
,
async
:
false
,
tsconfig
:
paths
.
appTsProdConfig
,
tsconfig
:
paths
.
appTsProdConfig
,
t
slint
:
paths
.
appTsLint
,
e
slint
:
false
}),
}),
],
],
// Some libraries import Node modules but don't use them in the browser.
// Some libraries import Node modules but don't use them in the browser.
...
...
src/webui/package.json
View file @
36e6e350
...
@@ -43,8 +43,6 @@
...
@@ -43,8 +43,6 @@
"ts-import-plugin"
:
"^1.4.3"
,
"ts-import-plugin"
:
"^1.4.3"
,
"ts-loader"
:
"^6.0.4"
,
"ts-loader"
:
"^6.0.4"
,
"tsconfig-paths-webpack-plugin"
:
"^3.2.0"
,
"tsconfig-paths-webpack-plugin"
:
"^3.2.0"
,
"tslint"
:
"^5.7.0"
,
"tslint-react"
:
"^4.0.0"
,
"url-loader"
:
"^2.1.0"
,
"url-loader"
:
"^2.1.0"
,
"webpack"
:
"^4.39.1"
,
"webpack"
:
"^4.39.1"
,
"webpack-dev-server"
:
"^3.7.2"
,
"webpack-dev-server"
:
"^3.7.2"
,
...
@@ -53,7 +51,8 @@
...
@@ -53,7 +51,8 @@
},
},
"scripts"
:
{
"scripts"
:
{
"build"
:
"node scripts/build.js"
,
"build"
:
"node scripts/build.js"
,
"start"
:
"node --trace-warnings scripts/start.js"
"start"
:
"node --trace-warnings scripts/start.js"
,
"eslint"
:
"npx eslint ./ --ext .tsx,.ts"
},
},
"devDependencies"
:
{
"devDependencies"
:
{
"@types/node"
:
"^10.14.14"
,
"@types/node"
:
"^10.14.14"
,
...
@@ -62,6 +61,11 @@
...
@@ -62,6 +61,11 @@
"@types/react-json-tree"
:
"^0.6.11"
,
"@types/react-json-tree"
:
"^0.6.11"
,
"@types/react-responsive"
:
"^3.0.3"
,
"@types/react-responsive"
:
"^3.0.3"
,
"@types/react-router"
:
"^3.0.20"
,
"@types/react-router"
:
"^3.0.20"
,
"@typescript-eslint/eslint-plugin"
:
"^2.11.0"
,
"@typescript-eslint/parser"
:
"^2.11.0"
,
"eslint"
:
"^6.7.2"
,
"eslint-plugin-react"
:
"^7.17.0"
,
"npx"
:
"^10.2.0"
,
"typescript"
:
"^3.5.3"
"typescript"
:
"^3.5.3"
},
},
"resolutions"
:
{
"resolutions"
:
{
...
...
src/webui/src/App.tsx
View file @
36e6e350
...
@@ -60,7 +60,6 @@ class App extends React.Component<{}, AppState> {
...
@@ -60,7 +60,6 @@ class App extends React.Component<{}, AppState> {
}
}
const
reactPropsChildren
=
React
.
Children
.
map
(
this
.
props
.
children
,
child
=>
const
reactPropsChildren
=
React
.
Children
.
map
(
this
.
props
.
children
,
child
=>
React
.
cloneElement
(
React
.
cloneElement
(
// tslint:disable-next-line:no-any
child
as
React
.
ReactElement
<
any
>
,
{
child
as
React
.
ReactElement
<
any
>
,
{
interval
,
interval
,
columnList
,
changeColumn
:
this
.
changeColumn
,
columnList
,
changeColumn
:
this
.
changeColumn
,
...
...
src/webui/src/components/overview/TrialProfile.tsx
View file @
36e6e350
...
@@ -19,7 +19,6 @@ class TrialInfo extends React.Component<TrialInfoProps, {}> {
...
@@ -19,7 +19,6 @@ class TrialInfo extends React.Component<TrialInfoProps, {}> {
'
id
'
,
'
logDir
'
,
'
startTime
'
,
'
endTime
'
,
'
id
'
,
'
logDir
'
,
'
startTime
'
,
'
endTime
'
,
'
experimentName
'
,
'
searchSpace
'
,
'
trainingServicePlatform
'
'
experimentName
'
,
'
searchSpace
'
,
'
trainingServicePlatform
'
];
];
// tslint:disable-next-line:no-any
const
filter
=
(
key
:
string
,
val
:
any
)
=>
{
const
filter
=
(
key
:
string
,
val
:
any
)
=>
{
if
(
key
===
'
trialConcurrency
'
)
{
if
(
key
===
'
trialConcurrency
'
)
{
return
this
.
props
.
concurrency
;
return
this
.
props
.
concurrency
;
...
...
src/webui/src/registerServiceWorker.ts
View file @
36e6e350
// tslint:disable:no-console
// In production, we register a service worker to serve assets from local cache.
// In production, we register a service worker to serve assets from local cache.
// This lets the app load faster on subsequent visits in production, and gives
// This lets the app load faster on subsequent visits in production, and gives
...
@@ -19,34 +18,6 @@ const isLocalhost = Boolean(
...
@@ -19,34 +18,6 @@ const isLocalhost = Boolean(
)
)
);
);
export
default
function
register
()
{
if
(
process
.
env
.
NODE_ENV
===
'
production
'
&&
'
serviceWorker
'
in
navigator
)
{
// The URL constructor is available in all browsers that support SW.
const
publicUrl
=
new
URL
(
process
.
env
.
PUBLIC_URL
!
,
window
.
location
.
toString
()
);
if
(
publicUrl
.
origin
!==
window
.
location
.
origin
)
{
// Our service worker won't work if PUBLIC_URL is on a different origin
// from what our page is served on. This might happen if a CDN is used to
// serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374
return
;
}
window
.
addEventListener
(
'
load
'
,
()
=>
{
const
swUrl
=
`
${
process
.
env
.
PUBLIC_URL
}
/service-worker.js`
;
if
(
!
isLocalhost
)
{
// Is not local host. Just register service worker
registerValidSW
(
swUrl
);
}
else
{
// This is running on localhost. Lets check if a service worker still exists or not.
checkValidServiceWorker
(
swUrl
);
}
});
}
}
function
registerValidSW
(
swUrl
:
string
)
{
function
registerValidSW
(
swUrl
:
string
)
{
navigator
.
serviceWorker
navigator
.
serviceWorker
.
register
(
swUrl
)
.
register
(
swUrl
)
...
@@ -105,6 +76,34 @@ function checkValidServiceWorker(swUrl: string) {
...
@@ -105,6 +76,34 @@ function checkValidServiceWorker(swUrl: string) {
});
});
}
}
export
default
function
register
()
{
if
(
process
.
env
.
NODE_ENV
===
'
production
'
&&
'
serviceWorker
'
in
navigator
)
{
// The URL constructor is available in all browsers that support SW.
const
publicUrl
=
new
URL
(
process
.
env
.
PUBLIC_URL
!
,
window
.
location
.
toString
()
);
if
(
publicUrl
.
origin
!==
window
.
location
.
origin
)
{
// Our service worker won't work if PUBLIC_URL is on a different origin
// from what our page is served on. This might happen if a CDN is used to
// serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374
return
;
}
window
.
addEventListener
(
'
load
'
,
()
=>
{
const
swUrl
=
`
${
process
.
env
.
PUBLIC_URL
}
/service-worker.js`
;
if
(
!
isLocalhost
)
{
// Is not local host. Just register service worker
registerValidSW
(
swUrl
);
}
else
{
// This is running on localhost. Lets check if a service worker still exists or not.
checkValidServiceWorker
(
swUrl
);
}
});
}
}
export
function
unregister
()
{
export
function
unregister
()
{
if
(
'
serviceWorker
'
in
navigator
)
{
if
(
'
serviceWorker
'
in
navigator
)
{
navigator
.
serviceWorker
.
ready
.
then
(
registration
=>
{
navigator
.
serviceWorker
.
ready
.
then
(
registration
=>
{
...
...
src/webui/src/static/function.ts
View file @
36e6e350
...
@@ -24,7 +24,7 @@ const convertDuration = (num: number) => {
...
@@ -24,7 +24,7 @@ const convertDuration = (num: number) => {
const
hour
=
Math
.
floor
(
num
/
3600
);
const
hour
=
Math
.
floor
(
num
/
3600
);
const
minute
=
Math
.
floor
(
num
/
60
%
60
);
const
minute
=
Math
.
floor
(
num
/
60
%
60
);
const
second
=
Math
.
floor
(
num
%
60
);
const
second
=
Math
.
floor
(
num
%
60
);
le
t
result
=
[
];
cons
t
result
=
[
];
if
(
hour
>
0
)
{
if
(
hour
>
0
)
{
result
.
push
(
`
${
hour
}
h`
);
result
.
push
(
`
${
hour
}
h`
);
}
}
...
@@ -163,7 +163,7 @@ const downFile = (content: string, fileName: string) => {
...
@@ -163,7 +163,7 @@ const downFile = (content: string, fileName: string) => {
downTag
.
download
=
fileName
;
downTag
.
download
=
fileName
;
downTag
.
href
=
URL
.
createObjectURL
(
file
);
downTag
.
href
=
URL
.
createObjectURL
(
file
);
});
});
le
t
eventMouse
=
document
.
createEvent
(
'
MouseEvents
'
);
cons
t
eventMouse
=
document
.
createEvent
(
'
MouseEvents
'
);
eventMouse
.
initEvent
(
'
click
'
,
false
,
false
);
eventMouse
.
initEvent
(
'
click
'
,
false
,
false
);
downTag
.
dispatchEvent
(
eventMouse
);
downTag
.
dispatchEvent
(
eventMouse
);
}
}
...
...
src/webui/src/static/interface.ts
View file @
36e6e350
// tslint:disable:no-any
// draw accuracy graph data interface
// draw accuracy graph data interface
interface
TableObj
{
interface
TableObj
{
key
:
number
;
key
:
number
;
...
...
src/webui/src/static/model/trial.ts
View file @
36e6e350
...
@@ -109,7 +109,7 @@ class Trial implements TableObj {
...
@@ -109,7 +109,7 @@ class Trial implements TableObj {
}
}
get
description
():
Parameters
{
get
description
():
Parameters
{
le
t
ret
:
Parameters
=
{
cons
t
ret
:
Parameters
=
{
parameters
:
{
},
parameters
:
{
},
intermediate
:
[
],
intermediate
:
[
],
multiProgress
:
1
multiProgress
:
1
...
...
src/webui/src/static/model/trialmanager.ts
View file @
36e6e350
...
@@ -3,6 +3,18 @@ import { MANAGER_IP, METRIC_GROUP_UPDATE_THRESHOLD, METRIC_GROUP_UPDATE_SIZE } f
...
@@ -3,6 +3,18 @@ import { MANAGER_IP, METRIC_GROUP_UPDATE_THRESHOLD, METRIC_GROUP_UPDATE_SIZE } f
import
{
MetricDataRecord
,
TableRecord
,
TrialJobInfo
}
from
'
../interface
'
;
import
{
MetricDataRecord
,
TableRecord
,
TrialJobInfo
}
from
'
../interface
'
;
import
{
Trial
}
from
'
./trial
'
;
import
{
Trial
}
from
'
./trial
'
;
function
groupMetricsByTrial
(
metrics
:
MetricDataRecord
[]):
Map
<
string
,
MetricDataRecord
[]
>
{
const
ret
=
new
Map
<
string
,
MetricDataRecord
[]
>
();
for
(
const
metric
of
metrics
)
{
if
(
ret
.
has
(
metric
.
trialJobId
))
{
ret
.
get
(
metric
.
trialJobId
)
!
.
push
(
metric
);
}
else
{
ret
.
set
(
metric
.
trialJobId
,
[
metric
]);
}
}
return
ret
;
}
class
TrialManager
{
class
TrialManager
{
private
trials
:
Map
<
string
,
Trial
>
=
new
Map
<
string
,
Trial
>
();
private
trials
:
Map
<
string
,
Trial
>
=
new
Map
<
string
,
Trial
>
();
private
infoInitialized
:
boolean
=
false
;
private
infoInitialized
:
boolean
=
false
;
...
@@ -141,16 +153,4 @@ class TrialManager {
...
@@ -141,16 +153,4 @@ class TrialManager {
}
}
}
}
function
groupMetricsByTrial
(
metrics
:
MetricDataRecord
[]):
Map
<
string
,
MetricDataRecord
[]
>
{
const
ret
=
new
Map
<
string
,
MetricDataRecord
[]
>
();
for
(
const
metric
of
metrics
)
{
if
(
ret
.
has
(
metric
.
trialJobId
))
{
ret
.
get
(
metric
.
trialJobId
)
!
.
push
(
metric
);
}
else
{
ret
.
set
(
metric
.
trialJobId
,
[
metric
]);
}
}
return
ret
;
}
export
{
TrialManager
};
export
{
TrialManager
};
src/webui/tslint.json
deleted
100644 → 0
View file @
543239c6
{
"extends"
:
[
"tslint-react"
],
"rules"
:
{
"align"
:
[
true
,
"parameters"
,
"arguments"
,
"statements"
],
"ban"
:
false
,
"class-name"
:
true
,
"curly"
:
true
,
"eofline"
:
false
,
"forin"
:
true
,
"indent"
:
[
true
,
"spaces"
],
"interface-name"
:
[
true
,
"never-prefix"
],
"jsdoc-format"
:
true
,
"jsx-no-lambda"
:
false
,
"jsx-no-multiline-js"
:
false
,
"label-position"
:
true
,
"max-line-length"
:
[
true
,
120
],
"member-ordering"
:
[
true
,
"public-before-private"
,
"static-before-instance"
,
"variables-before-functions"
],
"no-arg"
:
true
,
"no-bitwise"
:
true
,
"no-console"
:
false
,
"no-consecutive-blank-lines"
:
true
,
"no-construct"
:
true
,
"no-debugger"
:
true
,
"no-duplicate-variable"
:
true
,
"no-empty"
:
true
,
"no-eval"
:
true
,
"no-shadowed-variable"
:
true
,
"no-string-literal"
:
true
,
"no-switch-case-fall-through"
:
true
,
"no-trailing-whitespace"
:
false
,
"no-unused-expression"
:
true
,
"one-line"
:
[
true
,
"check-catch"
,
"check-else"
,
"check-open-brace"
,
"check-whitespace"
],
"quotemark"
:
[
true
,
"single"
,
"jsx-double"
],
"radix"
:
true
,
"semicolon"
:
[
true
,
"always"
],
"switch-default"
:
true
,
"trailing-comma"
:
[
false
],
"triple-equals"
:
[
true
,
"allow-null-check"
],
"typedef"
:
[
true
,
"parameter"
,
"property-declaration"
],
"typedef-whitespace"
:
[
true
,
{
"call-signature"
:
"nospace"
,
"index-signature"
:
"nospace"
,
"parameter"
:
"nospace"
,
"property-declaration"
:
"nospace"
,
"variable-declaration"
:
"nospace"
}
],
"variable-name"
:
[
true
,
"ban-keywords"
,
"check-format"
,
"allow-leading-underscore"
,
"allow-pascal-case"
],
"whitespace"
:
[
true
,
"check-branch"
,
"check-decl"
,
"check-module"
,
"check-operator"
,
"check-separator"
,
"check-type"
,
"check-typecast"
]
}
}
src/webui/yarn.lock
View file @
36e6e350
This diff is collapsed.
Click to expand it.
Prev
1
2
3
4
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