"git@developer.sourcefind.cn:OpenDAS/nni.git" did not exist on "21e3f27e8eb9fe0b6b2afa1f08622f10dff30ece"
Commit 2c1811b3 authored by Lijiao's avatar Lijiao Committed by Yan Ni
Browse files

[webui] UX refine based on v0.9 bug bash feedbacks (#1221)

* fix some comments

* update picture in webui document
parent ec5c35dc
docs/img/webui-img/addColumn.png

35.7 KB | W: | H:

docs/img/webui-img/addColumn.png

42 KB | W: | H:

docs/img/webui-img/addColumn.png
docs/img/webui-img/addColumn.png
docs/img/webui-img/addColumn.png
docs/img/webui-img/addColumn.png
  • 2-up
  • Swipe
  • Onion skin
docs/img/webui-img/compare.png

61.7 KB | W: | H:

docs/img/webui-img/compare.png

49.9 KB | W: | H:

docs/img/webui-img/compare.png
docs/img/webui-img/compare.png
docs/img/webui-img/compare.png
docs/img/webui-img/compare.png
  • 2-up
  • Swipe
  • Onion skin
docs/img/webui-img/detail-local.png

37.2 KB | W: | H:

docs/img/webui-img/detail-local.png

21.7 KB | W: | H:

docs/img/webui-img/detail-local.png
docs/img/webui-img/detail-local.png
docs/img/webui-img/detail-local.png
docs/img/webui-img/detail-local.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -127,7 +127,7 @@ class Compare extends React.Component<CompareProps, {}> { ...@@ -127,7 +127,7 @@ class Compare extends React.Component<CompareProps, {}> {
<td /> <td />
{Object.keys(idList).map(key => { {Object.keys(idList).map(key => {
return ( return (
<td className="value" key={key}>{idList[key]}</td> <td className="value idList" key={key}>{idList[key]}</td>
); );
})} })}
</tr> </tr>
...@@ -193,6 +193,7 @@ class Compare extends React.Component<CompareProps, {}> { ...@@ -193,6 +193,7 @@ class Compare extends React.Component<CompareProps, {}> {
destroyOnClose={true} destroyOnClose={true}
maskClosable={false} maskClosable={false}
width="90%" width="90%"
// centered={true}
> >
<Row>{this.intermediate()}</Row> <Row>{this.intermediate()}</Row>
<Row>{this.initColumn()}</Row> <Row>{this.initColumn()}</Row>
......
...@@ -4,7 +4,7 @@ import axios from 'axios'; ...@@ -4,7 +4,7 @@ import axios from 'axios';
import { MANAGER_IP } from '../static/const'; import { MANAGER_IP } from '../static/const';
import MediaQuery from 'react-responsive'; import MediaQuery from 'react-responsive';
import { DOWNLOAD_IP } from '../static/const'; import { DOWNLOAD_IP } from '../static/const';
import { Row, Col, Menu, Dropdown, Icon, Select } from 'antd'; import { Row, Col, Menu, Dropdown, Icon, Select, Button } from 'antd';
const { SubMenu } = Menu; const { SubMenu } = Menu;
const { Option } = Select; const { Option } = Select;
import '../static/style/slideBar.scss'; import '../static/style/slideBar.scss';
...@@ -14,6 +14,7 @@ interface SliderState { ...@@ -14,6 +14,7 @@ interface SliderState {
version: string; version: string;
menuVisible: boolean; menuVisible: boolean;
navBarVisible: boolean; navBarVisible: boolean;
isdisabledFresh: boolean;
} }
interface SliderProps { interface SliderProps {
...@@ -37,6 +38,7 @@ class SlideBar extends React.Component<SliderProps, SliderState> { ...@@ -37,6 +38,7 @@ class SlideBar extends React.Component<SliderProps, SliderState> {
version: '', version: '',
menuVisible: false, menuVisible: false,
navBarVisible: false, navBarVisible: false,
isdisabledFresh: false
}; };
} }
...@@ -224,9 +226,6 @@ class SlideBar extends React.Component<SliderProps, SliderState> { ...@@ -224,9 +226,6 @@ class SlideBar extends React.Component<SliderProps, SliderState> {
<Menu onClick={this.handleMenuClick} className="menuModal"> <Menu onClick={this.handleMenuClick} className="menuModal">
<Menu.Item key="overview"><Link to={'/oview'}>Overview</Link></Menu.Item> <Menu.Item key="overview"><Link to={'/oview'}>Overview</Link></Menu.Item>
<Menu.Item key="detail"><Link to={'/detail'}>Trials detail</Link></Menu.Item> <Menu.Item key="detail"><Link to={'/detail'}>Trials detail</Link></Menu.Item>
<Menu.Item key="fresh">
<span className="fresh" onClick={this.fresh}><span>Fresh</span></span>
</Menu.Item>
<Menu.Item key="feedback"> <Menu.Item key="feedback">
<a href={feedBackLink} target="_blank">Feedback</a> <a href={feedBackLink} target="_blank">Feedback</a>
</Menu.Item> </Menu.Item>
...@@ -249,25 +248,41 @@ class SlideBar extends React.Component<SliderProps, SliderState> { ...@@ -249,25 +248,41 @@ class SlideBar extends React.Component<SliderProps, SliderState> {
} }
select = () => { select = () => {
const { isdisabledFresh } = this.state;
return ( return (
<Select <div className="interval">
onSelect={this.getInterval} <Button
defaultValue="Refresh every 10s" className="fresh"
className="interval" onClick={this.fresh}
> type="ghost"
<Option value="close">Disable Auto Refresh</Option> disabled={isdisabledFresh}
<Option value="10">Refresh every 10s</Option> >
<Option value="20">Refresh every 20s</Option> <Icon type="sync" /><span>Refresh</span>
<Option value="30">Refresh every 30s</Option> </Button>
<Option value="60">Refresh every 1min</Option> <Select
</Select> onSelect={this.getInterval}
defaultValue="Refresh every 10s"
>
<Option value="close">Disable Auto Refresh</Option>
<Option value="10">Refresh every 10s</Option>
<Option value="20">Refresh every 20s</Option>
<Option value="30">Refresh every 30s</Option>
<Option value="60">Refresh every 1min</Option>
</Select>
</div>
); );
} }
fresh = (event: React.SyntheticEvent<EventTarget>) => { fresh = (event: React.SyntheticEvent<EventTarget>) => {
event.preventDefault(); event.preventDefault();
const whichPage = window.location.pathname; event.stopPropagation();
this.props.changeFresh(whichPage); if (this._isMounted) {
this.setState({ isdisabledFresh: true }, () => {
const whichPage = window.location.pathname;
this.props.changeFresh(whichPage);
setTimeout(() => { this.setState(() => ({ isdisabledFresh: false })); }, 1000);
});
}
} }
componentDidMount() { componentDidMount() {
...@@ -284,74 +299,75 @@ class SlideBar extends React.Component<SliderProps, SliderState> { ...@@ -284,74 +299,75 @@ class SlideBar extends React.Component<SliderProps, SliderState> {
const feed = `https://github.com/Microsoft/nni/issues/new?labels=${version}`; const feed = `https://github.com/Microsoft/nni/issues/new?labels=${version}`;
return ( return (
<Row> <Row>
<MediaQuery query="(min-width: 1299px)"> <Col span={18}>
<Row className="nav"> <MediaQuery query="(min-width: 1299px)">
<ul className="link"> <Row className="nav">
<li className="logo"> <ul className="link">
<li className="logo">
<Link to={'/oview'}>
<img
src={require('../static/img/logo2.png')}
style={{ width: 88 }}
alt="NNI logo"
/>
</Link>
</li>
<li className="tab firstTab">
<Link to={'/oview'} activeClassName="high">
Overview
</Link>
</li>
<li className="tab">
<Link to={'/detail'} activeClassName="high">
Trials detail
</Link>
</li>
<li className="feedback">
<Dropdown
className="dropdown"
overlay={this.menu()}
onVisibleChange={this.handleVisibleChange}
visible={menuVisible}
trigger={['click']}
>
<a className="ant-dropdown-link" href="#">
Download <Icon type="down" />
</a>
</Dropdown>
<a href={feed} target="_blank">
<img
src={require('../static/img/icon/issue.png')}
alt="NNI github issue"
/>
Feedback
</a>
<span className="version">Version: {version}</span>
</li>
</ul>
</Row>
</MediaQuery>
</Col>
<Col span={18}>
<MediaQuery query="(max-width: 1299px)">
<Row className="little">
<Col span={1} className="menu">
<Dropdown overlay={this.navigationBar()} trigger={['click']}>
<Icon type="unordered-list" className="more" />
</Dropdown>
</Col>
<Col span={14} className="logo">
<Link to={'/oview'}> <Link to={'/oview'}>
<img <img
src={require('../static/img/logo2.png')} src={require('../static/img/logo2.png')}
style={{ width: 88 }} style={{ width: 80 }}
alt="NNI logo" alt="NNI logo"
/> />
</Link> </Link>
</li> </Col>
<li className="tab firstTab"> </Row>
<Link to={'/oview'} activeClassName="high"> </MediaQuery>
Overview </Col>
</Link> <Col span={3}> {this.select()} </Col>
</li>
<li className="tab">
<Link to={'/detail'} activeClassName="high">
Trials detail
</Link>
</li>
<li className="feedback">
<span className="fresh" onClick={this.fresh}>
<Icon type="sync" /><span>Fresh</span>
</span>
<Dropdown
className="dropdown"
overlay={this.menu()}
onVisibleChange={this.handleVisibleChange}
visible={menuVisible}
trigger={['click']}
>
<a className="ant-dropdown-link" href="#">
Download <Icon type="down" />
</a>
</Dropdown>
<a href={feed} target="_blank">
<img
src={require('../static/img/icon/issue.png')}
alt="NNI github issue"
/>
Feedback
</a>
<span className="version">Version: {version}</span>
</li>
</ul>
</Row>
</MediaQuery>
<MediaQuery query="(max-width: 1299px)">
<Row className="little">
<Col span={6} className="menu">
<Dropdown overlay={this.navigationBar()} trigger={['click']}>
<Icon type="unordered-list" className="more" />
</Dropdown>
</Col>
<Col span={10} className="logo">
<Link to={'/oview'}>
<img
src={require('../static/img/logo2.png')}
style={{ width: 88 }}
alt="NNI logo"
/>
</Link>
</Col>
</Row>
</MediaQuery>
{this.select()}
</Row> </Row>
); );
} }
......
...@@ -394,15 +394,13 @@ class TrialsDetail extends React.Component<TrialsDetailProps, TrialDetailState> ...@@ -394,15 +394,13 @@ class TrialsDetail extends React.Component<TrialsDetailProps, TrialDetailState>
</Col> </Col>
<Col span={14} className="right"> <Col span={14} className="right">
<Button <Button
type="primary" className="common"
className="tableButton editStyle"
onClick={this.tableList ? this.tableList.addColumn : this.test} onClick={this.tableList ? this.tableList.addColumn : this.test}
> >
Add column Add column
</Button> </Button>
<Button <Button
type="primary" className="mediateBtn common"
className="tableButton editStyle mediateBtn"
// use child-component tableList's function, the function is in child-component. // use child-component tableList's function, the function is in child-component.
onClick={this.tableList ? this.tableList.compareBtn : this.test} onClick={this.tableList ? this.tableList.compareBtn : this.test}
> >
......
...@@ -163,9 +163,9 @@ class Duration extends React.Component<DurationProps, DurationState> { ...@@ -163,9 +163,9 @@ class Duration extends React.Component<DurationProps, DurationState> {
} }
shouldComponentUpdate(nextProps: DurationProps, nextState: DurationState) { shouldComponentUpdate(nextProps: DurationProps, nextState: DurationState) {
const { whichGraph, source } = nextProps; const { whichGraph, source } = nextProps;
if (whichGraph === '3') { if (whichGraph === '3') {
const beforeSource = this.props.source; const beforeSource = this.props.source;
if (whichGraph !== this.props.whichGraph) { if (whichGraph !== this.props.whichGraph) {
return true; return true;
...@@ -174,13 +174,14 @@ class Duration extends React.Component<DurationProps, DurationState> { ...@@ -174,13 +174,14 @@ class Duration extends React.Component<DurationProps, DurationState> {
if (source.length !== beforeSource.length) { if (source.length !== beforeSource.length) {
return true; return true;
} }
if (source[source.length - 1].duration !== beforeSource[beforeSource.length - 1].duration) {
return true;
}
if (source[source.length - 1].status !== beforeSource[beforeSource.length - 1].status) { if (beforeSource[beforeSource.length - 1] !== undefined) {
return true; if (source[source.length - 1].duration !== beforeSource[beforeSource.length - 1].duration) {
return true;
}
if (source[source.length - 1].status !== beforeSource[beforeSource.length - 1].status) {
return true;
}
} }
} }
return false; return false;
......
...@@ -12,7 +12,7 @@ interface IntermediateState { ...@@ -12,7 +12,7 @@ interface IntermediateState {
eachIntermediateNum: number; // trial's intermediate number count eachIntermediateNum: number; // trial's intermediate number count
isLoadconfirmBtn: boolean; isLoadconfirmBtn: boolean;
isFilter: boolean; isFilter: boolean;
length: number; length: number;
clickCounts: number; // user filter intermediate click confirm btn's counts clickCounts: number; // user filter intermediate click confirm btn's counts
} }
...@@ -136,7 +136,7 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState> ...@@ -136,7 +136,7 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState>
}, },
yAxis: { yAxis: {
type: 'value', type: 'value',
name: 'Scape' name: 'metric'
} }
}; };
if (this._isMounted) { if (this._isMounted) {
...@@ -209,7 +209,7 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState> ...@@ -209,7 +209,7 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState>
componentWillReceiveProps(nextProps: IntermediateProps, nextState: IntermediateState) { componentWillReceiveProps(nextProps: IntermediateProps, nextState: IntermediateState) {
const { isFilter, filterSource } = nextState; const { isFilter, filterSource } = nextState;
const { whichGraph, source } = nextProps; const { whichGraph, source } = nextProps;
if (whichGraph === '4') { if (whichGraph === '4') {
if (isFilter === true) { if (isFilter === true) {
const pointVal = this.pointInput !== null ? this.pointInput.value : ''; const pointVal = this.pointInput !== null ? this.pointInput.value : '';
...@@ -226,16 +226,14 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState> ...@@ -226,16 +226,14 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState>
} }
shouldComponentUpdate(nextProps: IntermediateProps, nextState: IntermediateState) { shouldComponentUpdate(nextProps: IntermediateProps, nextState: IntermediateState) {
const { whichGraph } = nextProps; const { whichGraph, source } = nextProps;
const beforeGraph = this.props.whichGraph; const beforeGraph = this.props.whichGraph;
if (whichGraph === '4') { if (whichGraph === '4') {
const { source } = nextProps;
const { isFilter, length, clickCounts } = nextState; const { isFilter, length, clickCounts } = nextState;
const beforeLength = this.state.length; const beforeLength = this.state.length;
const beforeSource = this.state.detailSource; const beforeSource = this.props.source;
const beforeClickCounts = this.state.clickCounts; const beforeClickCounts = this.state.clickCounts;
if (isFilter !== this.state.isFilter) { if (isFilter !== this.state.isFilter) {
return true; return true;
} }
...@@ -243,7 +241,7 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState> ...@@ -243,7 +241,7 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState>
if (clickCounts !== beforeClickCounts) { if (clickCounts !== beforeClickCounts) {
return true; return true;
} }
if (isFilter === false) { if (isFilter === false) {
if (whichGraph !== beforeGraph) { if (whichGraph !== beforeGraph) {
return true; return true;
...@@ -251,15 +249,20 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState> ...@@ -251,15 +249,20 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState>
if (length !== beforeLength) { if (length !== beforeLength) {
return true; return true;
} }
if (source[source.length - 1].description.intermediate.length !== if (beforeSource.length !== source.length) {
beforeSource[beforeSource.length - 1].description.intermediate.length) {
return true; return true;
} }
if (source[source.length - 1].duration !== beforeSource[beforeSource.length - 1].duration) { if (beforeSource[beforeSource.length - 1] !== undefined) {
return true; if (source[source.length - 1].description.intermediate.length !==
} beforeSource[beforeSource.length - 1].description.intermediate.length) {
if (source[source.length - 1].status !== beforeSource[beforeSource.length - 1].status) { return true;
return true; }
if (source[source.length - 1].duration !== beforeSource[beforeSource.length - 1].duration) {
return true;
}
if (source[source.length - 1].status !== beforeSource[beforeSource.length - 1].status) {
return true;
}
} }
} }
} }
...@@ -291,7 +294,7 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState> ...@@ -291,7 +294,7 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState>
? ?
<div> <div>
<Col span={3}> <Col span={3}>
<span>Scape</span> <span>Step</span>
<input <input
placeholder="point" placeholder="point"
ref={input => this.pointInput = input} ref={input => this.pointInput = input}
......
.compare{ .compare{
width: 92%; width: 92%;
table-layout: fixed;
margin: 0 auto; margin: 0 auto;
color: #333; color: #333;
tr{ tr{
line-height: 30px; line-height: 30px;
border-bottom: 1px solid #ccc; }
tr:nth-of-type(even){
background-color: gainsboro;
} }
.column{ .column{
width: 124px; max-width: 124px;
padding-left: 18px; padding-left: 18px;
font-weight: 700; font-weight: 700;
} }
.value{ .value{
width: 152px; max-width: 152px;
padding-right: 18px; padding-right: 18px;
text-align: right; text-align: left;
}
.idList{
font-weight: 700;
} }
} }
...@@ -4,6 +4,13 @@ ...@@ -4,6 +4,13 @@
margin: 0 auto; margin: 0 auto;
.right{ .right{
text-align: right; text-align: right;
.common{
border-radius: 0;
}
.common:hover{
color: #0071BC;
border-radius: 0;
}
} }
.entry{ .entry{
width: 120px; width: 120px;
...@@ -31,8 +38,9 @@ ...@@ -31,8 +38,9 @@
} }
} }
/* compare button style */
Button.mediateBtn{ Button.mediateBtn{
margin: 0 32px; margin: 0 2px 0 8px;
} }
/* each row's Intermediate btn -> Modal*/ /* each row's Intermediate btn -> Modal*/
......
...@@ -34,18 +34,10 @@ $drowHoverBgColor: #e2e2e2; ...@@ -34,18 +34,10 @@ $drowHoverBgColor: #e2e2e2;
.feedback{ .feedback{
position: fixed; position: fixed;
right: 19%; right: 26%;
line-height: $barHeight; line-height: $barHeight;
font-size: 16px; font-size: 16px;
color: #fff; color: #fff;
.fresh{
span{
margin: 0 10px 0 3px;
}
}
.fresh:hover{
cursor: pointer;
}
a{ a{
color: #fff; color: #fff;
text-decoration: none; text-decoration: none;
...@@ -60,6 +52,17 @@ $drowHoverBgColor: #e2e2e2; ...@@ -60,6 +52,17 @@ $drowHoverBgColor: #e2e2e2;
} }
} }
/* refresh button */
.fresh{
border: none;
color: #fff;
font-size: 16px;
padding: 0;
}
.fresh:hover{
color: #fff;
}
.link li{ .link li{
float: left; float: left;
} }
...@@ -70,8 +73,10 @@ $drowHoverBgColor: #e2e2e2; ...@@ -70,8 +73,10 @@ $drowHoverBgColor: #e2e2e2;
} }
.interval{ .interval{
position: fixed; position: fixed;
right: 7%; right: 6%;
top: 12px; top: 12px;
font-size: 16px;
color: #fff;
.ant-select-selection{ .ant-select-selection{
background-color: transparent; background-color: transparent;
border: none; border: none;
...@@ -82,6 +87,10 @@ $drowHoverBgColor: #e2e2e2; ...@@ -82,6 +87,10 @@ $drowHoverBgColor: #e2e2e2;
.ant-select-arrow{ .ant-select-arrow{
color: #fff; color: #fff;
} }
.ant-btn-ghost[disabled]{
background-color: transparent;
color: #fff;
}
} }
/* set select bgcolor */ /* set select bgcolor */
.ant-select-dropdown-menu{ .ant-select-dropdown-menu{
...@@ -120,8 +129,9 @@ $drowHoverBgColor: #e2e2e2; ...@@ -120,8 +129,9 @@ $drowHoverBgColor: #e2e2e2;
/* nav style*/ /* nav style*/
.little{ .little{
width: 100%; width: 90%;
.menu{ .menu{
margin-left: 33px;
.more{ .more{
color: #fff; color: #fff;
font-size: 24px; font-size: 24px;
...@@ -132,10 +142,10 @@ $drowHoverBgColor: #e2e2e2; ...@@ -132,10 +142,10 @@ $drowHoverBgColor: #e2e2e2;
} }
} }
.logo{ .logo{
text-align: center; text-align: right;
} }
} }
.menuModal{ .menuModal{
width: 180px; width: 198px;
} }
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