Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DiDi
kafka-manager
提交
b3f8b46f
K
kafka-manager
项目概览
DiDi
/
kafka-manager
9 个月 前同步成功
通知
58
Star
6372
Fork
1229
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kafka-manager
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
b3f8b46f
编写于
9月 13, 2022
作者:
G
GraceWalk
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 修复扩缩/迁移副本无法选中默认 Topic 的问题 & 迁移副本 Topic 迁移时间单位支持分钟粒度
上级
8d22a066
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
60 addition
and
19 deletion
+60
-19
km-console/packages/layout-clusters-fe/src/components/TopicJob/ReplicaChange.tsx
...out-clusters-fe/src/components/TopicJob/ReplicaChange.tsx
+3
-4
km-console/packages/layout-clusters-fe/src/components/TopicJob/ReplicaMove.tsx
...ayout-clusters-fe/src/components/TopicJob/ReplicaMove.tsx
+38
-7
km-console/packages/layout-clusters-fe/src/components/TopicJob/index.less
...ges/layout-clusters-fe/src/components/TopicJob/index.less
+14
-5
km-console/packages/layout-clusters-fe/src/pages/TestingProduce/component/EditTable.tsx
...sters-fe/src/pages/TestingProduce/component/EditTable.tsx
+5
-3
未找到文件。
km-console/packages/layout-clusters-fe/src/components/TopicJob/ReplicaChange.tsx
浏览文件 @
b3f8b46f
...
...
@@ -30,8 +30,8 @@ const { TextArea } = Input;
const
{
Option
}
=
Select
;
const
jobNameMap
:
any
=
{
expandAndReduce
:
'
批量
扩缩副本
'
,
transfer
:
'
批量
迁移副本
'
,
expandAndReduce
:
'
扩缩副本
'
,
transfer
:
'
迁移副本
'
,
};
interface
DefaultConfig
{
...
...
@@ -325,8 +325,7 @@ export default (props: DefaultConfig) => {
!
jobId
&&
Utils
.
request
(
Api
.
getTopicMetaData
(
+
routeParams
.
clusterId
))
.
then
((
res
:
any
)
=>
{
const
filterRes
=
res
.
filter
((
item
:
any
)
=>
item
.
type
!==
1
);
const
topics
=
(
filterRes
||
[]).
map
((
item
:
any
)
=>
{
const
topics
=
(
res
||
[]).
map
((
item
:
any
)
=>
{
return
{
label
:
item
.
topicName
,
value
:
item
.
topicName
,
...
...
km-console/packages/layout-clusters-fe/src/components/TopicJob/ReplicaMove.tsx
浏览文件 @
b3f8b46f
...
...
@@ -19,6 +19,7 @@ import {
Divider
,
Transfer
,
IconFont
,
Tooltip
,
}
from
'
knowdesign
'
;
import
'
./index.less
'
;
import
Api
,
{
MetricType
}
from
'
@src/api/index
'
;
...
...
@@ -31,8 +32,8 @@ const { TextArea } = Input;
const
{
Option
}
=
Select
;
const
jobNameMap
:
any
=
{
expandAndReduce
:
'
批量
扩缩副本
'
,
transfer
:
'
批量
迁移副本
'
,
expandAndReduce
:
'
扩缩副本
'
,
transfer
:
'
迁移副本
'
,
};
interface
DefaultConfig
{
...
...
@@ -56,6 +57,7 @@ export default (props: DefaultConfig) => {
const
[
topicNewReplicas
,
setTopicNewReplicas
]
=
useState
([]);
const
[
needMovePartitions
,
setNeedMovePartitions
]
=
useState
([]);
const
[
moveDataTimeRanges
,
setMoveDataTimeRanges
]
=
useState
([]);
const
[
moveDataTimeRangesType
,
setMoveDataTimeRangesType
]
=
useState
([]);
const
[
form
]
=
Form
.
useForm
();
const
[
global
]
=
AppContainer
.
useGlobalValue
();
const
[
loadingTopic
,
setLoadingTopic
]
=
useState
<
boolean
>
(
true
);
...
...
@@ -142,8 +144,23 @@ export default (props: DefaultConfig) => {
title
:
'
迁移数据时间范围
'
,
dataIndex
:
'
newRetentionMs
'
,
render
:
(
v
:
any
,
r
:
any
,
i
:
number
)
=>
{
const
selectAfter
=
(
<
Select
onChange
=
{
(
n
:
any
)
=>
{
const
moveDataTimeRangesCopyType
=
JSON
.
parse
(
JSON
.
stringify
(
moveDataTimeRangesType
));
moveDataTimeRangesCopyType
[
i
]
=
n
===
'
h
'
?
1
:
60
;
setMoveDataTimeRangesType
(
moveDataTimeRangesCopyType
);
}
}
defaultValue
=
"h"
style
=
{
{
width
:
82
}
}
>
<
Option
value
=
"m"
>
Minute
</
Option
>
<
Option
value
=
"h"
>
Hour
</
Option
>
</
Select
>
);
return
(
<
InputNumber
width
=
{
80
}
min
=
{
0
}
max
=
{
99999
}
defaultValue
=
{
moveDataTimeRanges
[
i
]
}
...
...
@@ -153,8 +170,10 @@ export default (props: DefaultConfig) => {
moveDataTimeRangesCopy
[
i
]
=
n
;
setMoveDataTimeRanges
(
moveDataTimeRangesCopy
);
}
}
formatter
=
{
(
value
)
=>
(
value
?
`
${
value
}
h`
:
''
)
}
parser
=
{
(
value
)
=>
value
.
replace
(
'
h
'
,
''
)
}
className
=
{
'
move-dete-time-tanges
'
}
// formatter={(value) => (value ? `${value} h` : '')}
// parser={(value) => value.replace('h', '')}
addonAfter
=
{
selectAfter
}
></
InputNumber
>
);
},
...
...
@@ -319,8 +338,7 @@ export default (props: DefaultConfig) => {
drawerVisible
&&
Utils
.
request
(
Api
.
getTopicMetaData
(
+
routeParams
.
clusterId
))
.
then
((
res
:
any
)
=>
{
const
filterRes
=
res
.
filter
((
item
:
any
)
=>
item
.
type
!==
1
);
const
topics
=
(
filterRes
||
[]).
map
((
item
:
any
)
=>
{
const
topics
=
(
res
||
[]).
map
((
item
:
any
)
=>
{
return
{
label
:
item
.
topicName
,
value
:
item
.
topicName
,
...
...
@@ -402,7 +420,7 @@ export default (props: DefaultConfig) => {
originalBrokerIdList
:
taskPlanData
[
index
].
currentBrokerIdList
,
reassignBrokerIdList
:
taskPlanData
[
index
].
reassignBrokerIdList
,
originalRetentionTimeUnitMs
:
topicData
[
index
].
retentionMs
,
reassignRetentionTimeUnitMs
:
moveDataTimeRanges
[
index
]
*
60
*
60
*
1000
,
reassignRetentionTimeUnitMs
:
(
moveDataTimeRanges
[
index
]
*
60
*
60
*
1000
)
/
(
moveDataTimeRangesType
[
index
]
||
1
)
,
latestDaysAvgBytesInList
:
topicData
[
index
].
latestDaysAvgBytesInList
,
latestDaysMaxBytesInList
:
topicData
[
index
].
latestDaysMaxBytesInList
,
partitionPlanList
:
taskPlanData
[
index
].
partitionPlanList
,
...
...
@@ -476,6 +494,19 @@ export default (props: DefaultConfig) => {
setTopicSelectValue
(
v
);
}
}
options
=
{
topicMetaData
}
// 点击Tooltip会触发Select的下拉
// maxTagPlaceholder={(v) => {
// const tooltipValue = v
// .map((item) => {
// return item.value;
// })
// .join('、');
// return (
// <Tooltip visible={true} placement="topLeft" key={tooltipValue} title={tooltipValue}>
// <span>{'+' + v.length + '...'}</span>
// </Tooltip>
// );
// }}
></
Select
>
</
Form
.
Item
>
</
Col
>
...
...
km-console/packages/layout-clusters-fe/src/components/TopicJob/index.less
浏览文件 @
b3f8b46f
...
...
@@ -64,11 +64,6 @@
.task-form {
margin-top: 16px;
}
.dcloud-select-selector {
max-height: 100px;
overflow: scroll;
}
}
.preview-task-plan-drawer {
...
...
@@ -80,4 +75,18 @@
background: #F8F9FA;
}
}
}
.move-dete-time-tanges{
.dcloud-input-number-input-wrap{
width: 80px;
}
.dcloud-input-number-wrapper{
.dcloud-select-selector{
border-top-left-radius: 0 !important;
border-bottom-left-radius: 0 !important;
background-color: inherit !important;
background: #F8F9FA;
}
}
}
\ No newline at end of file
km-console/packages/layout-clusters-fe/src/pages/TestingProduce/component/EditTable.tsx
浏览文件 @
b3f8b46f
/* eslint-disable react/display-name */
import
React
,
{
useState
}
from
'
react
'
;
import
{
Table
,
Input
,
InputNumber
,
Popconfirm
,
Form
,
Typography
,
Button
,
message
,
IconFont
}
from
'
knowdesign
'
;
import
{
Table
,
Input
,
InputNumber
,
Popconfirm
,
Form
,
Typography
,
Button
,
message
,
IconFont
,
Select
}
from
'
knowdesign
'
;
import
'
./style/edit-table.less
'
;
import
{
CheckOutlined
,
CloseOutlined
,
PlusSquareOutlined
}
from
'
@ant-design/icons
'
;
const
EditableCell
=
({
editing
,
dataIndex
,
title
,
inputType
,
placeholder
,
record
,
index
,
children
,
...
restProps
}:
any
)
=>
{
const
EditableCell
=
({
editing
,
dataIndex
,
title
,
inputType
,
placeholder
,
record
,
index
,
children
,
options
,
...
restProps
}:
any
)
=>
{
const
inputNode
=
inputType
===
'
number
'
?
(
<
InputNumber
style
=
{
{
width
:
'
130px
'
}
}
autoComplete
=
"off"
placeholder
=
{
placeholder
}
/>
<
InputNumber
min
=
{
0
}
precision
=
{
0
}
style
=
{
{
width
:
'
130px
'
}
}
autoComplete
=
"off"
placeholder
=
{
placeholder
}
/>
)
:
inputType
===
'
select
'
?
(
<
Select
style
=
{
{
width
:
'
140px
'
}
}
options
=
{
options
||
[]
}
placeholder
=
{
placeholder
}
/>
)
:
(
<
Input
autoComplete
=
"off"
placeholder
=
{
placeholder
}
/>
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录