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

master
jsers 5 years ago
parent 8b0e2b8042
commit a30e6d6be7

@ -106,6 +106,7 @@ export default {
'7天': '7days', '7天': '7days',
'30天': '30days', '30天': '30days',
'其它': 'other', '其它': 'other',
'自定义': 'custom',
'menu.endpoints': 'Endpoints', 'menu.endpoints': 'Endpoints',
'menu.endpoints.all': 'All endpoints', 'menu.endpoints.all': 'All endpoints',

@ -106,6 +106,7 @@ export default {
'7天': '7天', '7天': '7天',
'30天': '30天', '30天': '30天',
'其它': '其它', '其它': '其它',
'自定义': '自定义',
'menu.endpoints': '监控对象', 'menu.endpoints': '监控对象',
'menu.endpoints.all': '全部对象', 'menu.endpoints.all': '全部对象',

@ -89,9 +89,9 @@ class index extends Component<Props & WrappedComponentProps, State> {
getQuery() { getQuery() {
const { nodepath } = this.props; 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) => { updateTime = (cbk?: () => void) => {
@ -268,9 +268,7 @@ class index extends Component<Props & WrappedComponentProps, State> {
const now = moment(); const now = moment();
const nStime = now.clone().subtract(val, 'hours').unix(); const nStime = now.clone().subtract(val, 'hours').unix();
const nEtime = now.clone().unix(); const nEtime = now.clone().unix();
this.setState({ customTime: false, stime: nStime, etime: nEtime }, () => { this.setState({ customTime: false, stime: nStime, etime: nEtime });
this.fetchTable.reload();
});
} else { } else {
this.setState({ customTime: true }); this.setState({ customTime: true });
} }
@ -293,9 +291,7 @@ class index extends Component<Props & WrappedComponentProps, State> {
placeholder="Start" placeholder="Start"
onChange={(val) => { onChange={(val) => {
if (val) { if (val) {
this.setState({ stime: val.unix() }, () => { this.setState({ stime: val.unix() });
this.fetchTable.reload();
});
} }
}} }}
/> />
@ -307,9 +303,7 @@ class index extends Component<Props & WrappedComponentProps, State> {
placeholder="End" placeholder="End"
onChange={(val) => { onChange={(val) => {
if (val) { if (val) {
this.setState({ etime: val.unix() }, () => { this.setState({ etime: val.unix() });
this.fetchTable.reload();
});
} }
}} }}
/> />
@ -324,9 +318,7 @@ class index extends Component<Props & WrappedComponentProps, State> {
value={type} value={type}
onChange={(value: string) => { onChange={(value: string) => {
this.updateTime(() => { this.updateTime(() => {
this.setState({ type: value }, () => { this.setState({ type: value });
this.fetchTable.reload();
});
}); });
}} }}
> >
@ -345,9 +337,7 @@ class index extends Component<Props & WrappedComponentProps, State> {
value={priorities ? _.map(_.split(priorities, ','), _.toNumber) : []} value={priorities ? _.map(_.split(priorities, ','), _.toNumber) : []}
onChange={(value: number) => { onChange={(value: number) => {
this.updateTime(() => { this.updateTime(() => {
this.setState({ priorities: !_.isEmpty(value) ? _.join(value, ',') : undefined }, () => { this.setState({ priorities: !_.isEmpty(value) ? _.join(value, ',') : undefined });
this.fetchTable.reload();
});
}); });
}} }}
> >

Loading…
Cancel
Save