From 39015b5100d5f968fa464aca4f7ab3bb9f87ec8a Mon Sep 17 00:00:00 2001 From: GraceWalk Date: Thu, 22 Sep 2022 15:18:13 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A4=9A=E9=9B=86=E7=BE=A4=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=88=97=E8=A1=A8=E9=A1=B5=E5=A2=9E=E5=8A=A0=E6=89=8B?= =?UTF-8?q?=E5=8A=A8=E5=88=B7=E6=96=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/constants/common.ts | 3 + .../layout-clusters-fe/src/index.less | 35 +++++++++ .../pages/BrokerControllerChangeLog/index.tsx | 36 +++++---- .../src/pages/BrokerList/index.tsx | 40 +++++----- .../src/pages/Consumers/index.less | 12 +-- .../src/pages/Consumers/index.tsx | 28 +++---- .../src/pages/Jobs/index.tsx | 66 ++++++++++------- .../src/pages/LoadRebalance/index.tsx | 18 ++++- .../src/pages/SecurityACLs/index.less | 5 -- .../src/pages/SecurityACLs/index.tsx | 73 +++++++++++-------- .../src/pages/SecurityUsers/index.less | 9 --- .../src/pages/SecurityUsers/index.tsx | 64 +++++++++------- .../src/pages/TopicList/index.less | 47 +----------- .../src/pages/TopicList/index.tsx | 30 +++----- 14 files changed, 243 insertions(+), 223 deletions(-) diff --git a/km-console/packages/layout-clusters-fe/src/constants/common.ts b/km-console/packages/layout-clusters-fe/src/constants/common.ts index 3a75c14d..367d490c 100755 --- a/km-console/packages/layout-clusters-fe/src/constants/common.ts +++ b/km-console/packages/layout-clusters-fe/src/constants/common.ts @@ -261,3 +261,6 @@ export const timeFormater = function formatDuring(mss: number) { .map((o: any) => `${o.v}${o.unit}`) .join(); }; + +// 列表页Header布局前缀 +export const tableHeaderPrefix = 'table-header-layout'; diff --git a/km-console/packages/layout-clusters-fe/src/index.less b/km-console/packages/layout-clusters-fe/src/index.less index 52f048f1..c219a44f 100644 --- a/km-console/packages/layout-clusters-fe/src/index.less +++ b/km-console/packages/layout-clusters-fe/src/index.less @@ -280,3 +280,38 @@ li { line-height: 20px; } } + + +// Table Header 布局样式 +.table-header-layout { + display: flex; + justify-content: space-between; + margin-bottom: 12px; + &-left, + &-right { + display: flex; + align-items: center; + } + &-left { + &-refresh{ + font-size: 20px; + color: #74788d; + cursor: pointer; + } + } + + &-right{ + &>*{ + margin-left: 8px; + } + + .search-input { + width: 248px; + } + } + + &-divider{ + height: 20px; + top: 0 + } +} diff --git a/km-console/packages/layout-clusters-fe/src/pages/BrokerControllerChangeLog/index.tsx b/km-console/packages/layout-clusters-fe/src/pages/BrokerControllerChangeLog/index.tsx index 7782bc15..1403fb5b 100644 --- a/km-console/packages/layout-clusters-fe/src/pages/BrokerControllerChangeLog/index.tsx +++ b/km-console/packages/layout-clusters-fe/src/pages/BrokerControllerChangeLog/index.tsx @@ -1,12 +1,13 @@ import React, { useState, useEffect } from 'react'; import { useParams, useHistory, useLocation } from 'react-router-dom'; -import { ProTable, Utils, AppContainer } from 'knowdesign'; +import { ProTable, Utils, AppContainer, SearchInput, IconFont } from 'knowdesign'; import API from '../../api'; import { getControllerChangeLogListColumns, defaultPagination } from './config'; import BrokerDetail from '../BrokerDetail'; import BrokerHealthCheck from '@src/components/CardBar/BrokerHealthCheck'; import DBreadcrumb from 'knowdesign/es/extend/d-breadcrumb'; import './index.less'; +import { tableHeaderPrefix } from '@src/constants/common'; const { request } = Utils; const ControllerChangeLogList: React.FC = (props: any) => { @@ -89,26 +90,35 @@ const ControllerChangeLogList: React.FC = (props: any) => {
+
+
+
genData({ pageNo: pagination.current, pageSize: pagination.pageSize })} + > + +
+
+
+ +
+
{ if (urlParams?.clusterId === undefined) return; // filters = filters || filteredInfo; setLoading(true); - // const params = dealTableRequestParams({ searchKeywords, pageNo, pageSize }); const params = { searchKeywords: searchKeywords.slice(0, 128), pageNo, @@ -99,29 +98,36 @@ const BrokerList: React.FC = (props: any) => {
+
+
+
genData({ pageNo: pagination.current, pageSize: pagination.pageSize })} + > + +
+
+
+ +
+
{
{/* */} {scene !== 'topicDetail' && ( -
-
- {/* { - setShowMode(e.target.value); - }} - value={showMode} - /> */} - +
+
+
searchFn()}> + +
+ +
{ }} onPressEnter={searchFn} /> - - { }} onPressEnter={searchFn} /> - +
{/* */}
-
+ {/*
*/}
)} {/* diff --git a/km-console/packages/layout-clusters-fe/src/pages/Jobs/index.tsx b/km-console/packages/layout-clusters-fe/src/pages/Jobs/index.tsx index 84e70298..5432b434 100644 --- a/km-console/packages/layout-clusters-fe/src/pages/Jobs/index.tsx +++ b/km-console/packages/layout-clusters-fe/src/pages/Jobs/index.tsx @@ -1,6 +1,6 @@ import React, { useState, useEffect, memo } from 'react'; import { useParams, useHistory, useLocation } from 'react-router-dom'; -import { ProTable, Drawer, Utils, AppContainer, Form, Select, Input, Button, message, Modal } from 'knowdesign'; +import { ProTable, Drawer, Utils, AppContainer, Form, Select, Input, Button, message, Modal, IconFont, Divider } from 'knowdesign'; import API from '../../api'; import { getJobsListColumns, defaultPagination, runningStatus, jobType } from './config'; import JobsCheck from '@src/components/CardBar/JobsCheck'; @@ -10,6 +10,7 @@ import './index.less'; import ReplicaChange from '@src/components/TopicJob/ReplicaChange'; import ReplicaMove from '@src/components/TopicJob/ReplicaMove'; import BalanceDrawer from '../LoadRebalance/BalanceDrawer'; +import { tableHeaderPrefix } from '@src/constants/common'; const { request } = Utils; const JobsList: React.FC = (props: any) => { @@ -171,35 +172,44 @@ const JobsList: React.FC = (props: any) => { {/* */}
-
- - - - - - + + + + + + @@ -354,8 +365,7 @@ const LoadBalance: React.FC = (props: any) => { */} - -
+
{
-
-
getACLs({ page: 1 })}> - - - - - - - - - - - +
+
+
getACLs()}> + +
+ +
getACLs({ page: 1 })}> + + + + + + + + + + +
+
+ +
{ const maxPos = chars.length; @@ -426,34 +427,41 @@ const SecurityUsers = (): JSX.Element => { ]} />
-
- { - setSearchKeywords(searchKeywordsInput); - }} - style={{ fontSize: '16px' }} - /> - } - placeholder="请输入 Kafka User" - value={searchKeywordsInput} - onPressEnter={(_) => { - setSearchKeywords(searchKeywordsInput); - }} - onChange={(e) => { - setSearchKeywordsInput(e.target.value); - }} - /> - +
+
+
getKafkaUserList()}> + +
+
+
+ { + setSearchKeywords(searchKeywordsInput); + }} + style={{ fontSize: '16px' }} + /> + } + placeholder="请输入 Kafka User" + value={searchKeywordsInput} + onPressEnter={(_) => { + setSearchKeywords(searchKeywordsInput); + }} + onChange={(e) => { + setSearchKeywordsInput(e.target.value); + }} + /> + +
span { - margin-left: 4px; - color: #74788d; - } - } - } - .right { - display: flex; - align-items: center; - .dcloud-form-item { - margin-bottom: 0; - } - .search-input { - width: 248px; - margin-right: 8px; - } - .search-input-short { - width: 120px; - margin-right: 8px; - } - .batch-btn { - margin-right: 8px; - } - .add-btn { - width: 117px; - } + > span { + margin-left: 4px; + color: #74788d; } } .operation-list { diff --git a/km-console/packages/layout-clusters-fe/src/pages/TopicList/index.tsx b/km-console/packages/layout-clusters-fe/src/pages/TopicList/index.tsx index 5bce3d6c..692da9c2 100644 --- a/km-console/packages/layout-clusters-fe/src/pages/TopicList/index.tsx +++ b/km-console/packages/layout-clusters-fe/src/pages/TopicList/index.tsx @@ -1,7 +1,7 @@ /* eslint-disable react/display-name */ import React, { useState, useEffect } from 'react'; import { useHistory, useParams } from 'react-router-dom'; -import { AppContainer, IconFont, Input, ProTable, Select, Switch, Tooltip, Utils, Dropdown, Menu, Button } from 'knowdesign'; +import { AppContainer, IconFont, Input, ProTable, Select, Switch, Tooltip, Utils, Dropdown, Menu, Button, Divider } from 'knowdesign'; import Create from './Create'; import './index.less'; import Api from '@src/api/index'; @@ -16,6 +16,7 @@ import SmallChart from '@src/components/SmallChart'; import ReplicaMove from '@src/components/TopicJob/ReplicaMove'; import { formatAssignSize } from '../Jobs/config'; import { DownOutlined } from '@ant-design/icons'; +import { tableHeaderPrefix } from '@src/constants/common'; const { Option } = Select; @@ -66,6 +67,7 @@ const AutoPage = (props: any) => { // params.sortField = sortObj.sortField; // params.sortType = sortObj.sortType || 'desc'; // } + setTopicListLoading(true); Utils.post(Api.getTopicsList(Number(routeParams.clusterId)), params) .then((data: any) => { setTopicListLoading(false); @@ -79,7 +81,6 @@ const AutoPage = (props: any) => { }); }; useEffect(() => { - setTopicListLoading(true); getTopicsList(); }, [sortObj, showInternalTopics, searchKeywords, pageIndex, pageSize]); @@ -285,26 +286,17 @@ const AutoPage = (props: any) => {
-
-
+
+
{/* 批量扩缩副本 */} {/* 批量迁移 */} - {/* */} - {/* - - */} - {/*
*/} + +
getTopicsList()}> + +
+
{ 展示系统Topic
-
+