Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DiDi
kafka-manager
提交
8ef549de
K
kafka-manager
项目概览
DiDi
/
kafka-manager
8 个月 前同步成功
通知
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 搜索 >>
提交
8ef549de
编写于
6月 05, 2020
作者:
E
eilenexuzhe
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat bugfix
上级
e82437a2
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
45 addition
and
18 deletion
+45
-18
console/src/container/admin-home/index.tsx
console/src/container/admin-home/index.tsx
+3
-2
console/src/container/admin-usermanage/index.tsx
console/src/container/admin-usermanage/index.tsx
+3
-3
console/src/container/broker-info/base-info.tsx
console/src/container/broker-info/base-info.tsx
+18
-8
console/src/container/modal/leader-rebalance.tsx
console/src/container/modal/leader-rebalance.tsx
+7
-2
console/src/store/broker.ts
console/src/store/broker.ts
+13
-2
console/src/store/users.ts
console/src/store/users.ts
+1
-1
未找到文件。
console/src/container/admin-home/index.tsx
浏览文件 @
8ef549de
...
...
@@ -10,7 +10,7 @@ import { IClusterData } from 'types/base-type';
const
TabPane
=
Tabs
.
TabPane
;
const
detailUrl
=
'
/admin/cluster_detail?clusterId=
'
;
const
detailUrl
=
'
/admin/cluster_detail?clusterId=
'
;
const
collectionColumns
:
Array
<
ColumnProps
<
IClusterData
>>
=
[
{
...
...
@@ -24,7 +24,8 @@ const collectionColumns: Array<ColumnProps<IClusterData>> = [
key
:
'
clusterName
'
,
sorter
:
(
a
:
IClusterData
,
b
:
IClusterData
)
=>
a
.
clusterName
.
charCodeAt
(
0
)
-
b
.
clusterName
.
charCodeAt
(
0
),
render
:
(
text
,
record
)
=>
{
return
<
a
href
=
{
`
${
detailUrl
}${
record
.
clusterId
}
`
}
>
{
record
.
clusterName
}
</
a
>;
const
url
=
`
${
detailUrl
}${
record
.
clusterId
}
&clusterName=
${
record
.
clusterName
}
`
;
return
<
a
href
=
{
encodeURI
(
url
)
}
>
{
record
.
clusterName
}
</
a
>;
},
},
{
...
...
console/src/container/admin-usermanage/index.tsx
浏览文件 @
8ef549de
...
...
@@ -39,10 +39,10 @@ export class UserManage extends SearchAndFilter {
public
renderColumns
=
()
=>
{
const
role
=
Object
.
assign
({
title
:
'
角色
'
,
key
:
'
role
'
,
dataIndex
:
'
role
'
,
key
:
'
role
Name
'
,
dataIndex
:
'
role
Name
'
,
filters
:
users
.
filterRole
,
onFilter
:
(
value
:
string
,
record
:
any
)
=>
record
.
role
.
indexOf
(
value
)
===
0
,
onFilter
:
(
value
:
string
,
record
:
any
)
=>
record
.
role
Name
.
indexOf
(
value
)
===
0
,
},
this
.
renderColumnsFilter
(
'
filterVisible
'
));
return
[
...
...
console/src/container/broker-info/base-info.tsx
浏览文件 @
8ef549de
import
*
as
React
from
'
react
'
;
import
'
./index.less
'
;
import
{
Table
,
Modal
,
notification
,
PaginationConfig
,
Button
}
from
'
component/antd
'
;
import
{
Table
,
Modal
,
notification
,
PaginationConfig
,
Button
,
Spin
}
from
'
component/antd
'
;
import
{
broker
,
IBroker
,
IBrokerNetworkInfo
,
IBrokerPartition
}
from
'
store/broker
'
;
import
{
observer
}
from
'
mobx-react
'
;
import
{
StatusGraghCom
}
from
'
component/flow-table
'
;
...
...
@@ -49,10 +49,19 @@ export class BrokerList extends SearchAndFilter {
const
status
=
Object
.
assign
({
title
:
'
已同步
'
,
dataIndex
:
'
status
'
,
key
:
'
status
'
,
filters
:
[{
text
:
'
是
'
,
value
:
'
是
'
},
{
text
:
'
否
'
,
value
:
'
否
'
}],
onFilter
:
(
value
:
string
,
record
:
IBrokerPartition
)
=>
record
.
status
===
value
,
dataIndex
:
'
underReplicatedPartitionCount
'
,
key
:
'
underReplicatedPartitionCount
'
,
filters
:
[{
text
:
'
是
'
,
value
:
'
1
'
},
{
text
:
'
否
'
,
value
:
'
0
'
}],
onFilter
:
(
value
:
string
,
record
:
IBrokerPartition
)
=>
{
// underReplicatedPartitionCount > 0 表示未同步完成
const
syncStatus
=
record
.
underReplicatedPartitionCount
?
'
0
'
:
'
1
'
;
return
syncStatus
===
value
;
},
render
:
(
text
:
number
)
=>
(
<>
<
span
style
=
{
{
marginRight
:
8
}
}
>
{
text
?
'
否
'
:
'
是
'
}
</
span
>
</>
),
},
this
.
renderColumnsFilter
(
'
filterVisible
'
));
return
[{
...
...
@@ -80,7 +89,8 @@ export class BrokerList extends SearchAndFilter {
title
:
'
未同步副本数量
'
,
dataIndex
:
'
notUnderReplicatedPartitionCount
'
,
key
:
'
notUnderReplicatedPartitionCount
'
,
sorter
:
(
a
:
IBrokerPartition
,
b
:
IBrokerPartition
)
=>
a
.
notUnderReplicatedPartitionCount
-
b
.
notUnderReplicatedPartitionCount
,
sorter
:
(
a
:
IBrokerPartition
,
b
:
IBrokerPartition
)
=>
a
.
notUnderReplicatedPartitionCount
-
b
.
notUnderReplicatedPartitionCount
,
},
status
,
region
,
...
...
@@ -205,7 +215,7 @@ export class BrokerList extends SearchAndFilter {
const
dataPartitions
=
this
.
state
.
searchId
!==
''
?
broker
.
partitions
.
filter
((
d
)
=>
d
.
brokerId
===
+
this
.
state
.
searchId
)
:
broker
.
partitions
;
return
(
<>
<
Spin
spinning
=
{
broker
.
loading
}
>
<
div
className
=
"k-row"
>
<
ul
className
=
"k-tab"
>
<
li
>
Broker概览
</
li
>
...
...
@@ -239,7 +249,7 @@ export class BrokerList extends SearchAndFilter {
pagination
=
{
pagination
}
/>
</
div
>
</>
</
Spin
>
);
}
}
console/src/container/modal/leader-rebalance.tsx
浏览文件 @
8ef549de
...
...
@@ -45,14 +45,19 @@ class LeaderRebalance extends React.Component<any> {
constructor
(
props
:
any
)
{
super
(
props
);
const
url
=
Url
();
this
.
clusterName
=
decodeURI
(
atob
(
url
.
search
.
clusterName
));
if
(
url
.
search
.
clusterName
)
{
this
.
clusterName
=
decodeURI
(
url
.
search
.
clusterName
);
}
this
.
clusterId
=
Number
(
url
.
search
.
clusterId
);
}
public
handleSubmit
=
(
e
:
React
.
MouseEvent
<
any
,
MouseEvent
>
)
=>
{
e
.
preventDefault
();
this
.
setState
({
loading
:
true
});
this
.
props
.
form
.
validateFieldsAndScroll
((
err
:
any
,
values
:
any
)
=>
{
if
(
err
)
{
return
;
}
this
.
setState
({
loading
:
true
});
this
.
brokerId
=
Number
(
values
.
brokerId
);
addRebalance
({
brokerId
:
this
.
brokerId
,
clusterId
:
this
.
clusterId
,
dimension
:
0
}).
then
(()
=>
{
cluster
.
getRebalance
(
this
.
clusterId
).
then
(()
=>
{
...
...
console/src/store/broker.ts
浏览文件 @
8ef549de
...
...
@@ -35,6 +35,7 @@ export interface IBrokerPartition extends IBroker {
leaderCount
:
number
;
partitionCount
:
number
;
notUnderReplicatedPartitionCount
:
number
;
underReplicatedPartitionCount
?:
number
;
regionName
:
string
;
bytesInPerSec
:
number
;
}
...
...
@@ -74,6 +75,9 @@ interface IBrokerOption {
}
class
Broker
{
@
observable
public
loading
:
boolean
=
false
;
@
observable
public
brokerBaseInfo
:
IBrokerBaseInfo
=
{}
as
IBrokerBaseInfo
;
...
...
@@ -119,6 +123,11 @@ class Broker {
@
observable
public
BrokerOptions
:
IValueLabel
[]
=
[{
value
:
null
,
label
:
'
请选择Broker
'
}];
@
action
.
bound
public
setLoading
(
value
:
boolean
)
{
this
.
loading
=
value
;
}
@
action
.
bound
public
setBrokerBaseInfo
(
data
:
IBrokerBaseInfo
)
{
data
.
startTime
=
moment
(
data
.
startTime
).
format
(
'
YYYY-MM-DD HH:mm:ss
'
),
...
...
@@ -216,7 +225,8 @@ class Broker {
}
public
getBrokerList
(
clusterId
:
number
)
{
getBrokerList
(
clusterId
).
then
(
this
.
setBrokerList
);
this
.
setLoading
(
true
);
getBrokerList
(
clusterId
).
then
(
this
.
setBrokerList
).
finally
(()
=>
this
.
setLoading
(
false
));
}
public
getBrokerNetwork
(
clusterId
:
number
)
{
...
...
@@ -224,7 +234,8 @@ class Broker {
}
public
getBrokerPartition
(
clusterId
:
number
)
{
getBrokerPartition
(
clusterId
).
then
(
this
.
setBrokerPartition
);
this
.
setLoading
(
true
);
getBrokerPartition
(
clusterId
).
then
(
this
.
setBrokerPartition
).
finally
(()
=>
this
.
setLoading
(
false
));
}
public
getOneBrokerNetwork
(
clusterId
:
number
,
brokerId
:
number
)
{
...
...
console/src/store/users.ts
浏览文件 @
8ef549de
...
...
@@ -17,7 +17,7 @@ export class Users {
@
action
.
bound
public
setUserData
(
data
:
[])
{
this
.
userData
=
data
.
map
((
d
:
any
)
=>
{
d
.
role
=
this
.
roleMap
[
d
.
role
];
d
.
role
Name
=
this
.
roleMap
[
d
.
role
];
return
d
;
});
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录