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
c05a9228
Unverified
Commit
c05a9228
authored
May 27, 2021
by
Lijiaoa
Committed by
GitHub
May 27, 2021
Browse files
update prefix rest api format and fix getPrefix function bug (#3674)
Co-authored-by:
Lijiao
<
Lijiaoa@outlook.com
>
parent
964d9a92
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
ts/webui/src/static/const.ts
ts/webui/src/static/const.ts
+2
-2
ts/webui/src/static/function.ts
ts/webui/src/static/function.ts
+7
-6
No files found.
ts/webui/src/static/const.ts
View file @
c05a9228
...
@@ -5,8 +5,8 @@ const METRIC_GROUP_UPDATE_THRESHOLD = 100;
...
@@ -5,8 +5,8 @@ const METRIC_GROUP_UPDATE_THRESHOLD = 100;
const
METRIC_GROUP_UPDATE_SIZE
=
20
;
const
METRIC_GROUP_UPDATE_SIZE
=
20
;
const
prefix
=
getPrefix
();
const
prefix
=
getPrefix
();
const
RESTAPI
=
'
/api/v1/nni
'
;
const
MANAGER_IP
=
prefix
===
undefined
?
'
/api/v1/nni
'
:
`
${
prefix
}
`
;
const
MANAGER_IP
=
prefix
===
undefined
?
RESTAPI
:
`
${
prefix
}
${
RESTAPI
}
`
;
const
DOWNLOAD_IP
=
`/logs`
;
const
DOWNLOAD_IP
=
`/logs`
;
const
WEBUIDOC
=
'
https://nni.readthedocs.io/en/latest/Tutorial/WebUI.html
'
;
const
WEBUIDOC
=
'
https://nni.readthedocs.io/en/latest/Tutorial/WebUI.html
'
;
...
...
ts/webui/src/static/function.ts
View file @
c05a9228
...
@@ -8,12 +8,13 @@ import { MetricDataRecord, FinalType, TableObj, Tensorboard } from './interface'
...
@@ -8,12 +8,13 @@ import { MetricDataRecord, FinalType, TableObj, Tensorboard } from './interface'
function
getPrefix
():
string
|
undefined
{
function
getPrefix
():
string
|
undefined
{
const
pathName
=
window
.
location
.
pathname
;
const
pathName
=
window
.
location
.
pathname
;
let
newPathName
=
pathName
;
let
newPathName
=
pathName
;
const
pathArr
:
string
[]
=
[
'
/oview
'
,
'
/detail
'
,
'
/experiment
'
];
if
(
pathName
.
endsWith
(
'
/oview
'
)
||
pathName
.
endsWith
(
'
/detail
'
)
||
pathName
.
endsWith
(
'
/experiment
'
))
{
pathArr
.
forEach
(
item
=>
{
newPathName
=
pathName
.
replace
(
'
/oview
'
||
'
/detail
'
||
'
/experiment
'
,
''
);
if
(
pathName
.
endsWith
(
item
))
{
}
newPathName
=
pathName
.
replace
(
item
,
''
);
}
return
newPathName
===
''
?
undefined
:
newPathName
;
});
return
newPathName
===
''
||
newPathName
===
'
/
'
?
undefined
:
newPathName
;
}
}
async
function
requestAxios
(
url
:
string
):
Promise
<
any
>
{
async
function
requestAxios
(
url
:
string
):
Promise
<
any
>
{
...
...
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