From 20756a3453f98a589ca1af564443bb1f6c1f3400 Mon Sep 17 00:00:00 2001 From: GraceWalk Date: Tue, 13 Sep 2022 14:35:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=87=8D=E7=BD=AE=20Offset=20=E9=83=A8?= =?UTF-8?q?=E5=88=86=20partationId=20=E4=BF=AE=E6=94=B9=E4=B8=BA=20Select?= =?UTF-8?q?=20&=20Offset=20=E6=95=B0=E5=80=BC=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/pages/Consumers/ResetOffsetDrawer.tsx | 22 +++++++++++++++++-- .../src/pages/Consumers/index.tsx | 2 +- .../src/style-addition.less | 5 +++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/km-console/packages/layout-clusters-fe/src/pages/Consumers/ResetOffsetDrawer.tsx b/km-console/packages/layout-clusters-fe/src/pages/Consumers/ResetOffsetDrawer.tsx index 32cf4f83..c079393b 100644 --- a/km-console/packages/layout-clusters-fe/src/pages/Consumers/ResetOffsetDrawer.tsx +++ b/km-console/packages/layout-clusters-fe/src/pages/Consumers/ResetOffsetDrawer.tsx @@ -1,5 +1,5 @@ import React, { useState, useEffect } from 'react'; -import { Button, DatePicker, Drawer, Form, notification, Radio, Utils, Space, Divider } from 'knowdesign'; +import { Button, DatePicker, Drawer, Form, notification, Radio, Utils, Space, Divider, message } from 'knowdesign'; import { useParams } from 'react-router-dom'; import EditTable from '../TestingProduce/component/EditTable'; import Api from '@src/api/index'; @@ -53,11 +53,28 @@ export default (props: any) => { const [resetOffsetVisible, setResetOffsetVisible] = useState(false); const customFormRef: any = React.createRef(); const clusterPhyId = Number(routeParams.clusterId); + const [partitionIdList, setPartitionIdList] = useState([]); useEffect(() => { form.setFieldsValue({ resetType: defaultResetType, }); }, []); + + useEffect(() => { + Utils.request(Api.getTopicsMetaData(record?.topicName, +routeParams.clusterId)) + .then((res: any) => { + const partitionLists = (res?.partitionIdList || []).map((item: any) => { + return { + label: item, + value: item, + }; + }); + setPartitionIdList(partitionLists); + }) + .catch((err) => { + message.error(err); + }); + }, []); const confirm = () => { let tableData; if (customFormRef.current) { @@ -160,8 +177,9 @@ export default (props: any) => { colCustomConfigs={[ { title: 'PartitionID', - inputType: 'number', + inputType: 'select', placeholder: '请输入Partition', + options: partitionIdList, }, { title: 'Offset', diff --git a/km-console/packages/layout-clusters-fe/src/pages/Consumers/index.tsx b/km-console/packages/layout-clusters-fe/src/pages/Consumers/index.tsx index 46a77761..df077fe7 100644 --- a/km-console/packages/layout-clusters-fe/src/pages/Consumers/index.tsx +++ b/km-console/packages/layout-clusters-fe/src/pages/Consumers/index.tsx @@ -30,7 +30,7 @@ const AutoPage = (props: any) => { const searchFn = () => { const params: getOperatingStateListParams = { - pageNo: pageIndex, + pageNo: 1, pageSize, fuzzySearchDTOList: [], }; diff --git a/km-console/packages/layout-clusters-fe/src/style-addition.less b/km-console/packages/layout-clusters-fe/src/style-addition.less index a8580040..e2c1eb34 100644 --- a/km-console/packages/layout-clusters-fe/src/style-addition.less +++ b/km-console/packages/layout-clusters-fe/src/style-addition.less @@ -651,3 +651,8 @@ } } } + + +.@{ant-prefix}-empty-img-default{ + width: 100% !important; +} \ No newline at end of file