提交 a30e6d6b 编写于 作者: J jsers

fix: type and query filter does not work (#104)

上级 8b0e2b80
......@@ -106,6 +106,7 @@ export default {
'7天': '7days',
'30天': '30days',
'其它': 'other',
'自定义': 'custom',
'menu.endpoints': 'Endpoints',
'menu.endpoints.all': 'All endpoints',
......
......@@ -106,6 +106,7 @@ export default {
'7天': '7天',
'30天': '30天',
'其它': '其它',
'自定义': '自定义',
'menu.endpoints': '监控对象',
'menu.endpoints.all': '全部对象',
......
......@@ -89,9 +89,9 @@ class index extends Component<Props & WrappedComponentProps, State> {
getQuery() {
const { nodepath } = this.props;
const { stime, etime, priorities } = this.state;
const { stime, etime, priorities, type, searchValue } = this.state;
return { stime, etime, priorities, nodepath };
return { stime, etime, priorities, nodepath, type, query: searchValue };
}
updateTime = (cbk?: () => void) => {
......@@ -268,9 +268,7 @@ class index extends Component<Props & WrappedComponentProps, State> {
const now = moment();
const nStime = now.clone().subtract(val, 'hours').unix();
const nEtime = now.clone().unix();
this.setState({ customTime: false, stime: nStime, etime: nEtime }, () => {
this.fetchTable.reload();
});
this.setState({ customTime: false, stime: nStime, etime: nEtime });
} else {
this.setState({ customTime: true });
}
......@@ -293,9 +291,7 @@ class index extends Component<Props & WrappedComponentProps, State> {
placeholder="Start"
onChange={(val) => {
if (val) {
this.setState({ stime: val.unix() }, () => {
this.fetchTable.reload();
});
this.setState({ stime: val.unix() });
}
}}
/>
......@@ -307,9 +303,7 @@ class index extends Component<Props & WrappedComponentProps, State> {
placeholder="End"
onChange={(val) => {
if (val) {
this.setState({ etime: val.unix() }, () => {
this.fetchTable.reload();
});
this.setState({ etime: val.unix() });
}
}}
/>
......@@ -324,9 +318,7 @@ class index extends Component<Props & WrappedComponentProps, State> {
value={type}
onChange={(value: string) => {
this.updateTime(() => {
this.setState({ type: value }, () => {
this.fetchTable.reload();
});
this.setState({ type: value });
});
}}
>
......@@ -345,9 +337,7 @@ class index extends Component<Props & WrappedComponentProps, State> {
value={priorities ? _.map(_.split(priorities, ','), _.toNumber) : []}
onChange={(value: number) => {
this.updateTime(() => {
this.setState({ priorities: !_.isEmpty(value) ? _.join(value, ',') : undefined }, () => {
this.fetchTable.reload();
});
this.setState({ priorities: !_.isEmpty(value) ? _.join(value, ',') : undefined });
});
}}
>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册