".github/vscode:/vscode.git/clone" did not exist on "eb24e4bdb26156d8ac1d435c1472b01a79009596"
Unverified Commit c444e862 authored by Lijiaoa's avatar Lijiaoa Committed by GitHub
Browse files

[2.0a2] fix bugs of experiment managerment page on webui (#3230)

parent 9f9aa43e
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
/* nav bar: 56 + marginTop: 24 */ /* nav bar: 56 + marginTop: 24 */
margin-top: 80px; margin-top: 80px;
margin-bottom: 30px;
} }
.bottomDiv { .bottomDiv {
......
...@@ -145,7 +145,7 @@ class NavCon extends React.Component<NavProps, NavState> { ...@@ -145,7 +145,7 @@ class NavCon extends React.Component<NavProps, NavState> {
<CommandBarButton iconProps={infoIconAbout} text='About' menuProps={aboutProps} /> <CommandBarButton iconProps={infoIconAbout} text='About' menuProps={aboutProps} />
<Link to='/experiment' className='experiment'> <Link to='/experiment' className='experiment'>
<div className='expNavTitle'> <div className='expNavTitle'>
<span>All experiment</span> <span>All experiments</span>
{ChevronRightMed} {ChevronRightMed}
</div> </div>
</Link> </Link>
......
...@@ -82,7 +82,7 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> { ...@@ -82,7 +82,7 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
</Pivot> </Pivot>
</div> </div>
{/* trial table list */} {/* trial table list */}
<div style={{ backgroundColor: '#fff', marginTop: 10 }}> <div className='detailTable' style={{ marginTop: 10 }}>
<TableList <TableList
tableSource={source} tableSource={source}
trialsUpdateBroadcast={this.context.trialsUpdateBroadcast} trialsUpdateBroadcast={this.context.trialsUpdateBroadcast}
......
...@@ -9,6 +9,8 @@ import { MAXSCREENCOLUMNWIDHT, MINSCREENCOLUMNWIDHT } from './experimentConst'; ...@@ -9,6 +9,8 @@ import { MAXSCREENCOLUMNWIDHT, MINSCREENCOLUMNWIDHT } from './experimentConst';
import { Hearder } from './Header'; import { Hearder } from './Header';
import NameColumn from './TrialIdColumn'; import NameColumn from './TrialIdColumn';
import FilterBtns from './FilterBtns'; import FilterBtns from './FilterBtns';
import { TitleContext } from '../overview/TitleContext';
import { Title } from '../overview/Title';
import '../../App.scss'; import '../../App.scss';
import '../../static/style/nav/nav.scss'; import '../../static/style/nav/nav.scss';
import '../../static/style/experiment/experiment.scss'; import '../../static/style/experiment/experiment.scss';
...@@ -82,13 +84,17 @@ class Experiment extends React.Component<{}, ExpListState> { ...@@ -82,13 +84,17 @@ class Experiment extends React.Component<{}, ExpListState> {
</div> </div>
) : null} ) : null}
<Stack className='contentBox expBackground'> <Stack className='contentBox expBackground'>
<Stack className='content'> {/* 56px: navBarHeight; 48: marginTop & Bottom */}
<Stack className='content' styles={{ root: { minHeight: window.innerHeight - 104 } }}>
<Stack className='experimentList'> <Stack className='experimentList'>
<TitleContext.Provider value={{ text: 'All experiments', icon: 'CustomList' }}>
<Title />
</TitleContext.Provider>
<Stack className='box' horizontal> <Stack className='box' horizontal>
<div className='search'> <div className='search'>
<SearchBox <SearchBox
className='search-input' className='search-input'
placeholder='Search the experiment by name and ID' placeholder='Search the experiment by name or ID'
onEscape={this.setOriginSource.bind(this)} onEscape={this.setOriginSource.bind(this)}
onClear={this.setOriginSource.bind(this)} onClear={this.setOriginSource.bind(this)}
onChange={this.searchNameAndId.bind(this)} onChange={this.searchNameAndId.bind(this)}
...@@ -126,6 +132,7 @@ class Experiment extends React.Component<{}, ExpListState> { ...@@ -126,6 +132,7 @@ class Experiment extends React.Component<{}, ExpListState> {
compact={true} compact={true}
selectionMode={0} // close selector function selectionMode={0} // close selector function
className='table' className='table'
onActiveItemChanged={this.experimentClicked}
/> />
</Stack> </Stack>
</Stack> </Stack>
...@@ -251,6 +258,15 @@ class Experiment extends React.Component<{}, ExpListState> { ...@@ -251,6 +258,15 @@ class Experiment extends React.Component<{}, ExpListState> {
} }
]; ];
private experimentClicked = (item?: any, _index?: number, _ev?: React.FocusEvent<HTMLElement>): void => {
if (item.status !== 'STOPPED' && item.port !== undefined) {
const hostname = window.location.hostname;
const protocol = window.location.protocol;
const webuiPortal = `${protocol}//${hostname}:${item.port}/oview`;
window.open(webuiPortal);
}
};
private clickFilter(_e: any): void { private clickFilter(_e: any): void {
const { hideFilter } = this.state; const { hideFilter } = this.state;
if (!hideFilter === true) { if (!hideFilter === true) {
...@@ -277,10 +293,11 @@ class Experiment extends React.Component<{}, ExpListState> { ...@@ -277,10 +293,11 @@ class Experiment extends React.Component<{}, ExpListState> {
if (newValue === '') { if (newValue === '') {
this.setOriginSource(); this.setOriginSource();
} else { } else {
const searchInput = newValue.trim();
let result = originExperimentList.filter( let result = originExperimentList.filter(
item => item =>
item.experimentName.toLowerCase().includes(newValue.toLowerCase()) || item.experimentName.toLowerCase().includes(searchInput.toLowerCase()) ||
item.id.toLowerCase().includes(newValue.toLowerCase()) item.id.toLowerCase().includes(searchInput.toLowerCase())
); );
result = this.commonSelectString(result, ''); result = this.commonSelectString(result, '');
const sortedResult = getSortedSource(result, sortInfo); const sortedResult = getSortedSource(result, sortInfo);
...@@ -290,7 +307,7 @@ class Experiment extends React.Component<{}, ExpListState> { ...@@ -290,7 +307,7 @@ class Experiment extends React.Component<{}, ExpListState> {
})); }));
} }
this.setState(() => ({ this.setState(() => ({
searchInputVal: newValue searchInputVal: newValue.trim()
})); }));
} }
} }
...@@ -414,7 +431,9 @@ class Experiment extends React.Component<{}, ExpListState> { ...@@ -414,7 +431,9 @@ class Experiment extends React.Component<{}, ExpListState> {
// reset // reset
private setSearchSource(): void { private setSearchSource(): void {
const { sortInfo, searchInputVal, originExperimentList } = this.state; const { sortInfo, originExperimentList } = this.state;
let { searchInputVal } = this.state;
searchInputVal = searchInputVal.trim();
// hert re-search data for fix this status: filter first -> searchBox search result null -> close filter // hert re-search data for fix this status: filter first -> searchBox search result null -> close filter
const result = originExperimentList.filter( const result = originExperimentList.filter(
item => item =>
......
...@@ -19,9 +19,14 @@ class TrialIdColumn extends React.Component<TrialIdColumnProps, {}> { ...@@ -19,9 +19,14 @@ class TrialIdColumn extends React.Component<TrialIdColumnProps, {}> {
return ( return (
<div className='succeed-padding ellipsis'> <div className='succeed-padding ellipsis'>
{status === 'STOPPED' ? ( {status === 'STOPPED' ? (
<div>{id}</div> <div className='idColor'>{id}</div>
) : ( ) : (
<a href={webuiPortal} className='link' target='_blank' rel='noopener noreferrer'> <a
href={webuiPortal}
className='link toAnotherExp idColor'
target='_blank'
rel='noopener noreferrer'
>
{id} {id}
</a> </a>
)} )}
......
$pageMargin: 24px;
.expBackground { .expBackground {
background: #f2f2f2; background: #f2f2f2;
height: 100%; height: 100%;
.content { .content {
/* TODO: here is 32 rather than $pageMargin is because experiment page `content` position */
margin-top: 32px;
margin-bottom: $pageMargin;
background: #fff; background: #fff;
} }
} }
.experimentList { .experimentList {
padding: 42px; padding: $pageMargin 42px;
.box { .box {
margin-top: 20px;
.search { .search {
width: 90%; width: 90%;
&-input { &-input {
width: 330px; width: 330px;
} }
...@@ -51,14 +60,22 @@ ...@@ -51,14 +60,22 @@
margin-left: 10px; margin-left: 10px;
} }
.tagContainer { .idColor {
width: 100%; color: #615f5d !important;
}
.toAnotherExp {
&:hover {
color: #333231 !important;
}
.tag { &:hover {
font-weight: 500; color: #615f5d !important;
background: #f2f2f2;
margin: 0 4px;
padding: 0 6px;
} }
} }
.ms-DetailsRow:focus {
background: #e1dfdd;
}
} }
...@@ -51,6 +51,11 @@ ...@@ -51,6 +51,11 @@
} }
} }
.detailTable {
margin-bottom: 24px;
background: #fff;
}
.detailTabs { .detailTabs {
padding-left: 6px; padding-left: 6px;
padding-right: 18px; padding-right: 18px;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment