From a30e6d6be7cee18aedf64d3c76f5ce4a16fbf6e4 Mon Sep 17 00:00:00 2001 From: jsers Date: Mon, 27 Apr 2020 13:56:29 +0800 Subject: [PATCH] fix: type and query filter does not work (#104) --- web/src/locales/en.ts | 1 + web/src/locales/zh.ts | 1 + web/src/pages/Monitor/History/List.tsx | 24 +++++++----------------- 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/web/src/locales/en.ts b/web/src/locales/en.ts index 94113cdf..faab88a7 100644 --- a/web/src/locales/en.ts +++ b/web/src/locales/en.ts @@ -106,6 +106,7 @@ export default { '7天': '7days', '30天': '30days', '其它': 'other', + '自定义': 'custom', 'menu.endpoints': 'Endpoints', 'menu.endpoints.all': 'All endpoints', diff --git a/web/src/locales/zh.ts b/web/src/locales/zh.ts index 1008667b..18b5418c 100644 --- a/web/src/locales/zh.ts +++ b/web/src/locales/zh.ts @@ -106,6 +106,7 @@ export default { '7天': '7天', '30天': '30天', '其它': '其它', + '自定义': '自定义', 'menu.endpoints': '监控对象', 'menu.endpoints.all': '全部对象', diff --git a/web/src/pages/Monitor/History/List.tsx b/web/src/pages/Monitor/History/List.tsx index 8178f71c..d61e3f1b 100644 --- a/web/src/pages/Monitor/History/List.tsx +++ b/web/src/pages/Monitor/History/List.tsx @@ -89,9 +89,9 @@ class index extends Component { 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 { 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 { 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 { 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 { 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 { 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 }); }); }} >