Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DiDi
kafka-manager
提交
00654383
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 搜索 >>
未验证
提交
00654383
编写于
1月 25, 2021
作者:
E
EricZeng
提交者:
GitHub
1月 25, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #132 from lucasun/dev_2.2.0_fe
add fe page
上级
850d43df
7f115c1b
变更
35
隐藏空白更改
内联
并排
Showing
35 changed file
with
329 addition
and
225 deletion
+329
-225
kafka-manager-console/src/component/x-form/index.tsx
kafka-manager-console/src/component/x-form/index.tsx
+2
-1
kafka-manager-console/src/constants/table.ts
kafka-manager-console/src/constants/table.ts
+1
-1
kafka-manager-console/src/container/admin/cluster-detail/cluster-consumer.tsx
...e/src/container/admin/cluster-detail/cluster-consumer.tsx
+2
-2
kafka-manager-console/src/container/admin/cluster-detail/cluster-topic.tsx
...sole/src/container/admin/cluster-detail/cluster-topic.tsx
+2
-3
kafka-manager-console/src/container/admin/cluster-detail/exclusive-cluster.tsx
.../src/container/admin/cluster-detail/exclusive-cluster.tsx
+1
-1
kafka-manager-console/src/container/admin/cluster-detail/logical-cluster.tsx
...le/src/container/admin/cluster-detail/logical-cluster.tsx
+4
-4
kafka-manager-console/src/container/admin/cluster-list/index.tsx
...anager-console/src/container/admin/cluster-list/index.tsx
+11
-9
kafka-manager-console/src/container/admin/individual-bill.tsx
...a-manager-console/src/container/admin/individual-bill.tsx
+5
-5
kafka-manager-console/src/container/alarm/add-alarm/filter-form.tsx
...ger-console/src/container/alarm/add-alarm/filter-form.tsx
+37
-23
kafka-manager-console/src/container/alarm/add-alarm/index.less
...-manager-console/src/container/alarm/add-alarm/index.less
+8
-6
kafka-manager-console/src/container/alarm/add-alarm/index.tsx
...a-manager-console/src/container/alarm/add-alarm/index.tsx
+12
-9
kafka-manager-console/src/container/alarm/add-alarm/strategy-form.tsx
...r-console/src/container/alarm/add-alarm/strategy-form.tsx
+39
-5
kafka-manager-console/src/container/alarm/add-alarm/type-form.tsx
...nager-console/src/container/alarm/add-alarm/type-form.tsx
+17
-17
kafka-manager-console/src/container/cluster/cluster-detail/cluster-overview.tsx
...src/container/cluster/cluster-detail/cluster-overview.tsx
+5
-5
kafka-manager-console/src/container/cluster/config.tsx
kafka-manager-console/src/container/cluster/config.tsx
+20
-20
kafka-manager-console/src/container/cluster/my-cluster.tsx
kafka-manager-console/src/container/cluster/my-cluster.tsx
+2
-2
kafka-manager-console/src/container/drawer/data-migration.tsx
...a-manager-console/src/container/drawer/data-migration.tsx
+3
-3
kafka-manager-console/src/container/modal/admin/cluster.ts
kafka-manager-console/src/container/modal/admin/cluster.ts
+45
-18
kafka-manager-console/src/container/modal/admin/expand-partition.tsx
...er-console/src/container/modal/admin/expand-partition.tsx
+5
-2
kafka-manager-console/src/container/modal/admin/task.ts
kafka-manager-console/src/container/modal/admin/task.ts
+7
-7
kafka-manager-console/src/container/modal/app.tsx
kafka-manager-console/src/container/modal/app.tsx
+1
-1
kafka-manager-console/src/container/modal/cluster.tsx
kafka-manager-console/src/container/modal/cluster.tsx
+3
-3
kafka-manager-console/src/container/modal/topic.tsx
kafka-manager-console/src/container/modal/topic.tsx
+21
-18
kafka-manager-console/src/container/topic/config.tsx
kafka-manager-console/src/container/topic/config.tsx
+1
-2
kafka-manager-console/src/container/topic/topic-all.tsx
kafka-manager-console/src/container/topic/topic-all.tsx
+1
-1
kafka-manager-console/src/container/topic/topic-detail/base-information.tsx
...ole/src/container/topic/topic-detail/base-information.tsx
+1
-1
kafka-manager-console/src/container/topic/topic-detail/bill-information.tsx
...ole/src/container/topic/topic-detail/bill-information.tsx
+15
-15
kafka-manager-console/src/container/topic/topic-detail/index.tsx
...anager-console/src/container/topic/topic-detail/index.tsx
+18
-8
kafka-manager-console/src/container/topic/topic-mine.tsx
kafka-manager-console/src/container/topic/topic-mine.tsx
+13
-13
kafka-manager-console/src/container/user-center/my-bill.tsx
kafka-manager-console/src/container/user-center/my-bill.tsx
+5
-5
kafka-manager-console/src/lib/fetch.ts
kafka-manager-console/src/lib/fetch.ts
+1
-0
kafka-manager-console/src/store/alarm.ts
kafka-manager-console/src/store/alarm.ts
+2
-1
kafka-manager-console/src/store/cluster.ts
kafka-manager-console/src/store/cluster.ts
+13
-13
kafka-manager-console/src/types/alarm.ts
kafka-manager-console/src/types/alarm.ts
+1
-0
kafka-manager-console/src/types/base-type.ts
kafka-manager-console/src/types/base-type.ts
+5
-1
未找到文件。
kafka-manager-console/src/component/x-form/index.tsx
浏览文件 @
00654383
...
@@ -2,6 +2,7 @@ import * as React from 'react';
...
@@ -2,6 +2,7 @@ import * as React from 'react';
import
{
Select
,
Input
,
InputNumber
,
Form
,
Switch
,
Checkbox
,
DatePicker
,
Radio
,
Upload
,
Button
,
Icon
,
Tooltip
}
from
'
component/antd
'
;
import
{
Select
,
Input
,
InputNumber
,
Form
,
Switch
,
Checkbox
,
DatePicker
,
Radio
,
Upload
,
Button
,
Icon
,
Tooltip
}
from
'
component/antd
'
;
import
Monacoeditor
from
'
component/editor/monacoEditor
'
;
import
Monacoeditor
from
'
component/editor/monacoEditor
'
;
import
{
searchProps
}
from
'
constants/table
'
;
import
{
searchProps
}
from
'
constants/table
'
;
import
{
version
}
from
'
store/version
'
;
import
'
./index.less
'
;
import
'
./index.less
'
;
const
TextArea
=
Input
.
TextArea
;
const
TextArea
=
Input
.
TextArea
;
...
@@ -189,7 +190,7 @@ class XForm extends React.Component<IXFormProps> {
...
@@ -189,7 +190,7 @@ class XForm extends React.Component<IXFormProps> {
case
FormItemType
.
upload
:
case
FormItemType
.
upload
:
return
(
return
(
<
Upload
beforeUpload
=
{
(
file
:
any
)
=>
false
}
{
...
item
.
attrs
}
>
<
Upload
beforeUpload
=
{
(
file
:
any
)
=>
false
}
{
...
item
.
attrs
}
>
<
Button
><
Icon
type
=
"upload"
/>
上传
</
Button
>
<
Button
><
Icon
type
=
"upload"
/>
上传
</
Button
>
{
version
.
fileSuffix
&&
<
span
style
=
{
{
color
:
'
#fb3939
'
,
padding
:
'
0 0 0 10px
'
}
}
>
{
`请上传
${
version
.
fileSuffix
}
文件`
}
</
span
>
}
</
Upload
>
</
Upload
>
);
);
}
}
...
...
kafka-manager-console/src/constants/table.ts
浏览文件 @
00654383
...
@@ -19,7 +19,7 @@ export const cellStyle = {
...
@@ -19,7 +19,7 @@ export const cellStyle = {
overflow
:
'
hidden
'
,
overflow
:
'
hidden
'
,
whiteSpace
:
'
nowrap
'
,
whiteSpace
:
'
nowrap
'
,
textOverflow
:
'
ellipsis
'
,
textOverflow
:
'
ellipsis
'
,
cursor
:
'
pointer
'
,
//
cursor: 'pointer',
};
};
export
const
searchProps
=
{
export
const
searchProps
=
{
...
...
kafka-manager-console/src/container/admin/cluster-detail/cluster-consumer.tsx
浏览文件 @
00654383
...
@@ -38,7 +38,7 @@ export class ClusterConsumer extends SearchAndFilterContainer {
...
@@ -38,7 +38,7 @@ export class ClusterConsumer extends SearchAndFilterContainer {
key
:
'
operation
'
,
key
:
'
operation
'
,
width
:
'
10%
'
,
width
:
'
10%
'
,
render
:
(
t
:
string
,
item
:
IOffset
)
=>
{
render
:
(
t
:
string
,
item
:
IOffset
)
=>
{
return
(<
a
onClick
=
{
()
=>
this
.
getConsumeDetails
(
item
)
}
>
详情
</
a
>);
return
(<
a
onClick
=
{
()
=>
this
.
getConsumeDetails
(
item
)
}
>
消费
详情
</
a
>);
},
},
}];
}];
private
xFormModal
:
IXFormWrapper
;
private
xFormModal
:
IXFormWrapper
;
...
@@ -110,7 +110,7 @@ export class ClusterConsumer extends SearchAndFilterContainer {
...
@@ -110,7 +110,7 @@ export class ClusterConsumer extends SearchAndFilterContainer {
/>
/>
</
div
>
</
div
>
<
Modal
<
Modal
title
=
"消费
的Topic
"
title
=
"消费
详情
"
visible
=
{
this
.
state
.
detailsVisible
}
visible
=
{
this
.
state
.
detailsVisible
}
onOk
=
{
()
=>
this
.
handleDetailsOk
()
}
onOk
=
{
()
=>
this
.
handleDetailsOk
()
}
onCancel
=
{
()
=>
this
.
handleDetailsCancel
()
}
onCancel
=
{
()
=>
this
.
handleDetailsCancel
()
}
...
...
kafka-manager-console/src/container/admin/cluster-detail/cluster-topic.tsx
浏览文件 @
00654383
...
@@ -2,7 +2,7 @@ import * as React from 'react';
...
@@ -2,7 +2,7 @@ import * as React from 'react';
import
Url
from
'
lib/url-parser
'
;
import
Url
from
'
lib/url-parser
'
;
import
{
region
}
from
'
store
'
;
import
{
region
}
from
'
store
'
;
import
{
admin
}
from
'
store/admin
'
;
import
{
admin
}
from
'
store/admin
'
;
import
{
topic
}
from
'
store/topic
'
;
import
{
app
}
from
'
store/app
'
;
import
{
Table
,
notification
,
Tooltip
,
Popconfirm
}
from
'
antd
'
;
import
{
Table
,
notification
,
Tooltip
,
Popconfirm
}
from
'
antd
'
;
import
{
pagination
,
cellStyle
}
from
'
constants/table
'
;
import
{
pagination
,
cellStyle
}
from
'
constants/table
'
;
import
{
observer
}
from
'
mobx-react
'
;
import
{
observer
}
from
'
mobx-react
'
;
...
@@ -56,8 +56,6 @@ export class ClusterTopic extends SearchAndFilterContainer {
...
@@ -56,8 +56,6 @@ export class ClusterTopic extends SearchAndFilterContainer {
public
expandPartition
(
item
:
IClusterTopics
)
{
public
expandPartition
(
item
:
IClusterTopics
)
{
// getTopicBasicInfo
// getTopicBasicInfo
admin
.
getTopicsBasicInfo
(
item
.
clusterId
,
item
.
topicName
).
then
(
data
=>
{
admin
.
getTopicsBasicInfo
(
item
.
clusterId
,
item
.
topicName
).
then
(
data
=>
{
console
.
log
(
admin
.
topicsBasic
);
console
.
log
(
admin
.
basicInfo
);
this
.
clusterTopicsFrom
=
item
;
this
.
clusterTopicsFrom
=
item
;
this
.
setState
({
this
.
setState
({
expandVisible
:
true
,
expandVisible
:
true
,
...
@@ -114,6 +112,7 @@ export class ClusterTopic extends SearchAndFilterContainer {
...
@@ -114,6 +112,7 @@ export class ClusterTopic extends SearchAndFilterContainer {
public
componentDidMount
()
{
public
componentDidMount
()
{
admin
.
getClusterTopics
(
this
.
clusterId
);
admin
.
getClusterTopics
(
this
.
clusterId
);
app
.
getAdminAppList
()
}
}
public
renderClusterTopicList
()
{
public
renderClusterTopicList
()
{
...
...
kafka-manager-console/src/container/admin/cluster-detail/exclusive-cluster.tsx
浏览文件 @
00654383
...
@@ -159,7 +159,6 @@ export class ExclusiveCluster extends SearchAndFilterContainer {
...
@@ -159,7 +159,6 @@ export class ExclusiveCluster extends SearchAndFilterContainer {
public
handleDeleteRegion
=
(
record
:
IBrokersRegions
)
=>
{
public
handleDeleteRegion
=
(
record
:
IBrokersRegions
)
=>
{
const
filterRegion
=
admin
.
logicalClusters
.
filter
(
item
=>
item
.
regionIdList
.
includes
(
record
.
id
));
const
filterRegion
=
admin
.
logicalClusters
.
filter
(
item
=>
item
.
regionIdList
.
includes
(
record
.
id
));
if
(
!
filterRegion
)
{
if
(
!
filterRegion
)
{
return
;
return
;
}
}
...
@@ -335,6 +334,7 @@ export class ExclusiveCluster extends SearchAndFilterContainer {
...
@@ -335,6 +334,7 @@ export class ExclusiveCluster extends SearchAndFilterContainer {
{
this
.
renderSearch
(
''
,
'
请输入Region名称/broker ID
'
)
}
{
this
.
renderSearch
(
''
,
'
请输入Region名称/broker ID
'
)
}
</
ul
>
</
ul
>
{
this
.
renderRegion
()
}
{
this
.
renderRegion
()
}
{
this
.
renderDeleteRegionModal
()
}
</
div
>
</
div
>
);
);
}
}
...
...
kafka-manager-console/src/container/admin/cluster-detail/logical-cluster.tsx
浏览文件 @
00654383
...
@@ -40,15 +40,15 @@ export class LogicalCluster extends SearchAndFilterContainer {
...
@@ -40,15 +40,15 @@ export class LogicalCluster extends SearchAndFilterContainer {
key
:
'
logicalClusterId
'
,
key
:
'
logicalClusterId
'
,
},
},
{
{
title
:
'
逻辑集群
中文
名称
'
,
title
:
'
逻辑集群名称
'
,
dataIndex
:
'
logicalClusterName
'
,
dataIndex
:
'
logicalClusterName
'
,
key
:
'
logicalClusterName
'
,
key
:
'
logicalClusterName
'
,
width
:
'
150px
'
width
:
'
150px
'
},
},
{
{
title
:
'
逻辑集群
英文名称
'
,
title
:
'
逻辑集群
标识
'
,
dataIndex
:
'
logicalCluster
Name
'
,
dataIndex
:
'
logicalCluster
Identification
'
,
key
:
'
logicalCluster
Name1
'
,
key
:
'
logicalCluster
Identification
'
,
width
:
'
150px
'
width
:
'
150px
'
},
},
{
{
...
...
kafka-manager-console/src/container/admin/cluster-list/index.tsx
浏览文件 @
00654383
import
*
as
React
from
'
react
'
;
import
*
as
React
from
'
react
'
;
import
{
Modal
,
Table
,
Button
,
notification
,
message
,
Tooltip
,
Icon
,
Popconfirm
,
Alert
}
from
'
component/antd
'
;
import
{
Modal
,
Table
,
Button
,
notification
,
message
,
Tooltip
,
Icon
,
Popconfirm
,
Alert
,
Popover
}
from
'
component/antd
'
;
import
{
wrapper
}
from
'
store
'
;
import
{
wrapper
}
from
'
store
'
;
import
{
observer
}
from
'
mobx-react
'
;
import
{
observer
}
from
'
mobx-react
'
;
import
{
IXFormWrapper
,
IMetaData
,
IRegister
}
from
'
types/base-type
'
;
import
{
IXFormWrapper
,
IMetaData
,
IRegister
}
from
'
types/base-type
'
;
...
@@ -58,7 +58,7 @@ export class ClusterList extends SearchAndFilterContainer {
...
@@ -58,7 +58,7 @@ export class ClusterList extends SearchAndFilterContainer {
message
:
'
请输入zookeeper地址
'
,
message
:
'
请输入zookeeper地址
'
,
}],
}],
attrs
:
{
attrs
:
{
placeholder
:
'
请输入zookeeper地址
'
,
placeholder
:
'
请输入zookeeper地址
,例如:192.168.0.1:2181,192.168.0.2/logi-kafka
'
,
rows
:
2
,
rows
:
2
,
disabled
:
item
?
true
:
false
,
disabled
:
item
?
true
:
false
,
},
},
...
@@ -72,7 +72,7 @@ export class ClusterList extends SearchAndFilterContainer {
...
@@ -72,7 +72,7 @@ export class ClusterList extends SearchAndFilterContainer {
message
:
'
请输入bootstrapServers
'
,
message
:
'
请输入bootstrapServers
'
,
}],
}],
attrs
:
{
attrs
:
{
placeholder
:
'
请输入bootstrapServers
'
,
placeholder
:
'
请输入bootstrapServers
,例如:192.168.1.1:9092,192.168.1.2:9092
'
,
rows
:
2
,
rows
:
2
,
disabled
:
item
?
true
:
false
,
disabled
:
item
?
true
:
false
,
},
},
...
@@ -131,7 +131,7 @@ export class ClusterList extends SearchAndFilterContainer {
...
@@ -131,7 +131,7 @@ export class ClusterList extends SearchAndFilterContainer {
{
{
"security.protocol": "SASL_PLAINTEXT",
"security.protocol": "SASL_PLAINTEXT",
"sasl.mechanism": "PLAIN",
"sasl.mechanism": "PLAIN",
"sasl.jaas.config": "org.apache.kafka.common.security.plain.PlainLoginModule required username=\
"xxxxxx\" password=\"xxxxxx
\";"
"sasl.jaas.config": "org.apache.kafka.common.security.plain.PlainLoginModule required username=\
\"xxxxxx\\" password=\\"xxxxxx\
\";"
}`
,
}`
,
rows
:
8
,
rows
:
8
,
},
},
...
@@ -271,11 +271,13 @@ export class ClusterList extends SearchAndFilterContainer {
...
@@ -271,11 +271,13 @@ export class ClusterList extends SearchAndFilterContainer {
cancelText
=
"取消"
cancelText
=
"取消"
okText
=
"确认"
okText
=
"确认"
>
>
<
a
<
Tooltip
title
=
"暂停监控将无法正常监控指标信息,建议开启监控"
>
className
=
"action-button"
<
a
>
className
=
"action-button"
{
item
.
status
===
1
?
'
暂停监控
'
:
'
开始监控
'
}
>
</
a
>
{
item
.
status
===
1
?
'
暂停监控
'
:
'
开始监控
'
}
</
a
>
</
Tooltip
>
</
Popconfirm
>
</
Popconfirm
>
<
a
onClick
=
{
this
.
showMonitor
.
bind
(
this
,
item
)
}
>
<
a
onClick
=
{
this
.
showMonitor
.
bind
(
this
,
item
)
}
>
删除
删除
...
...
kafka-manager-console/src/container/admin/individual-bill.tsx
浏览文件 @
00654383
...
@@ -79,7 +79,7 @@ export class IndividualBill extends React.Component {
...
@@ -79,7 +79,7 @@ export class IndividualBill extends React.Component {
}
}
public
renderTableList
()
{
public
renderTableList
()
{
const
adminUrl
=
`
${
urlPrefix
}
/admin/bill-detail`
const
adminUrl
=
`
${
urlPrefix
}
/admin/bill-detail`
return
(
return
(
<
Table
<
Table
rowKey
=
"key"
rowKey
=
"key"
...
@@ -89,11 +89,11 @@ export class IndividualBill extends React.Component {
...
@@ -89,11 +89,11 @@ export class IndividualBill extends React.Component {
/>
/>
);
);
}
}
public
renderChart
()
{
public
renderChart
()
{
return
(
return
(
<
div
className
=
"chart-box"
>
<
div
className
=
"chart-box"
>
<
BarChartComponet
ref
=
{
(
ref
)
=>
this
.
chart
=
ref
}
getChartData
=
{
this
.
getData
.
bind
(
this
,
null
)
}
/>
<
BarChartComponet
ref
=
{
(
ref
)
=>
this
.
chart
=
ref
}
getChartData
=
{
this
.
getData
.
bind
(
this
,
null
)
}
/>
</
div
>
</
div
>
);
);
}
}
...
@@ -132,7 +132,7 @@ export class IndividualBill extends React.Component {
...
@@ -132,7 +132,7 @@ export class IndividualBill extends React.Component {
<>
<>
<
div
className
=
"container"
>
<
div
className
=
"container"
>
<
Tabs
defaultActiveKey
=
"1"
type
=
"card"
>
<
Tabs
defaultActiveKey
=
"1"
type
=
"card"
>
<
TabPane
<
TabPane
tab
=
{
<>
tab
=
{
<>
<
span
>
账单趋势
</
span
>
<
span
>
账单趋势
</
span
>
<
a
<
a
...
@@ -142,7 +142,7 @@ export class IndividualBill extends React.Component {
...
@@ -142,7 +142,7 @@ export class IndividualBill extends React.Component {
>
>
<
Icon
type
=
"question-circle"
/>
<
Icon
type
=
"question-circle"
/>
</
a
>
</
a
>
</>
}
</>
}
key
=
"1"
key
=
"1"
>
>
{
this
.
renderDatePick
()
}
{
this
.
renderDatePick
()
}
...
...
kafka-manager-console/src/container/alarm/add-alarm/filter-form.tsx
浏览文件 @
00654383
...
@@ -11,6 +11,7 @@ import { filterKeys } from 'constants/strategy';
...
@@ -11,6 +11,7 @@ import { filterKeys } from 'constants/strategy';
import
{
VirtualScrollSelect
}
from
'
component/virtual-scroll-select
'
;
import
{
VirtualScrollSelect
}
from
'
component/virtual-scroll-select
'
;
import
{
IsNotNaN
}
from
'
lib/utils
'
;
import
{
IsNotNaN
}
from
'
lib/utils
'
;
import
{
searchProps
}
from
'
constants/table
'
;
import
{
searchProps
}
from
'
constants/table
'
;
import
{
toJS
}
from
'
mobx
'
;
interface
IDynamicProps
{
interface
IDynamicProps
{
form
?:
any
;
form
?:
any
;
...
@@ -33,6 +34,7 @@ export class DynamicSetFilter extends React.Component<IDynamicProps> {
...
@@ -33,6 +34,7 @@ export class DynamicSetFilter extends React.Component<IDynamicProps> {
public
monitorType
:
string
=
null
;
public
monitorType
:
string
=
null
;
public
clusterId
:
number
=
null
;
public
clusterId
:
number
=
null
;
public
clusterName
:
string
=
null
;
public
clusterName
:
string
=
null
;
public
clusterIdentification
:
string
|
number
=
null
;
public
topicName
:
string
=
null
;
public
topicName
:
string
=
null
;
public
consumerGroup
:
string
=
null
;
public
consumerGroup
:
string
=
null
;
public
location
:
string
=
null
;
public
location
:
string
=
null
;
...
@@ -45,16 +47,18 @@ export class DynamicSetFilter extends React.Component<IDynamicProps> {
...
@@ -45,16 +47,18 @@ export class DynamicSetFilter extends React.Component<IDynamicProps> {
this
.
props
.
form
.
validateFields
((
err
:
Error
,
values
:
any
)
=>
{
this
.
props
.
form
.
validateFields
((
err
:
Error
,
values
:
any
)
=>
{
if
(
!
err
)
{
if
(
!
err
)
{
monitorType
=
values
.
monitorType
;
monitorType
=
values
.
monitorType
;
const
index
=
cluster
.
clusterData
.
findIndex
(
item
=>
item
.
clusterId
===
values
.
cluster
);
const
index
=
cluster
.
clusterData
.
findIndex
(
item
=>
item
.
clusterId
entification
===
values
.
cluster
);
if
(
index
>
-
1
)
{
if
(
index
>
-
1
)
{
values
.
clusterIdentification
=
cluster
.
clusterData
[
index
].
clusterIdentification
;
values
.
clusterName
=
cluster
.
clusterData
[
index
].
clusterName
;
values
.
clusterName
=
cluster
.
clusterData
[
index
].
clusterName
;
}
}
for
(
const
key
of
Object
.
keys
(
values
))
{
for
(
const
key
of
Object
.
keys
(
values
))
{
if
(
filterKeys
.
indexOf
(
key
)
>
-
1
)
{
// 只有这几种值可以设置
if
(
filterKeys
.
indexOf
(
key
)
>
-
1
)
{
// 只有这几种值可以设置
filterList
.
push
({
filterList
.
push
({
tkey
:
key
===
'
clusterName
'
?
'
cluster
'
:
key
,
//
传参需要将clusterName转成cluster
tkey
:
key
===
'
clusterName
'
?
'
cluster
'
:
key
,
//
clusterIdentification
topt
:
'
=
'
,
topt
:
'
=
'
,
tval
:
[
values
[
key
]],
tval
:
[
values
[
key
]],
clusterIdentification
:
values
.
clusterIdentification
});
});
}
}
}
}
...
@@ -74,13 +78,13 @@ export class DynamicSetFilter extends React.Component<IDynamicProps> {
...
@@ -74,13 +78,13 @@ export class DynamicSetFilter extends React.Component<IDynamicProps> {
public
resetFormValue
(
public
resetFormValue
(
monitorType
:
string
=
null
,
monitorType
:
string
=
null
,
clusterId
:
number
=
null
,
clusterId
entification
:
any
=
null
,
topicName
:
string
=
null
,
topicName
:
string
=
null
,
consumerGroup
:
string
=
null
,
consumerGroup
:
string
=
null
,
location
:
string
=
null
)
{
location
:
string
=
null
)
{
const
{
setFieldsValue
}
=
this
.
props
.
form
;
const
{
setFieldsValue
}
=
this
.
props
.
form
;
setFieldsValue
({
setFieldsValue
({
cluster
:
clusterId
,
cluster
:
clusterId
entification
,
topic
:
topicName
,
topic
:
topicName
,
consumerGroup
,
consumerGroup
,
location
,
location
,
...
@@ -88,18 +92,18 @@ export class DynamicSetFilter extends React.Component<IDynamicProps> {
...
@@ -88,18 +92,18 @@ export class DynamicSetFilter extends React.Component<IDynamicProps> {
});
});
}
}
public
getClusterId
=
(
clusterName
:
string
)
=>
{
public
getClusterId
=
async
(
clusterIdentification
:
any
)
=>
{
let
clusterId
=
null
;
let
clusterId
=
null
;
const
index
=
cluster
.
clusterData
.
findIndex
(
item
=>
item
.
cluster
Name
===
clusterName
);
const
index
=
cluster
.
clusterData
.
findIndex
(
item
=>
item
.
cluster
Identification
===
clusterIdentification
);
if
(
index
>
-
1
)
{
if
(
index
>
-
1
)
{
clusterId
=
cluster
.
clusterData
[
index
].
clusterId
;
clusterId
=
cluster
.
clusterData
[
index
].
clusterId
;
}
}
if
(
clusterId
)
{
if
(
clusterId
)
{
cluster
.
getClusterMetaTopics
(
clusterId
);
await
cluster
.
getClusterMetaTopics
(
clusterId
);
this
.
clusterId
=
clusterId
;
this
.
clusterId
=
clusterId
;
return
this
.
clusterId
;
return
this
.
clusterId
;
}
}
;
return
this
.
clusterId
=
cluster
Name
as
any
;
return
this
.
clusterId
=
cluster
Id
as
any
;
}
}
public
async
initFormValue
(
monitorRule
:
IRequestParams
)
{
public
async
initFormValue
(
monitorRule
:
IRequestParams
)
{
...
@@ -108,17 +112,19 @@ export class DynamicSetFilter extends React.Component<IDynamicProps> {
...
@@ -108,17 +112,19 @@ export class DynamicSetFilter extends React.Component<IDynamicProps> {
const
topicFilter
=
strategyFilterList
.
filter
(
item
=>
item
.
tkey
===
'
topic
'
)[
0
];
const
topicFilter
=
strategyFilterList
.
filter
(
item
=>
item
.
tkey
===
'
topic
'
)[
0
];
const
consumerFilter
=
strategyFilterList
.
filter
(
item
=>
item
.
tkey
===
'
consumerGroup
'
)[
0
];
const
consumerFilter
=
strategyFilterList
.
filter
(
item
=>
item
.
tkey
===
'
consumerGroup
'
)[
0
];
const
cluster
Name
=
clusterFilter
?
clusterFilter
.
tval
[
0
]
:
null
;
const
cluster
Identification
=
clusterFilter
?
clusterFilter
.
tval
[
0
]
:
null
;
const
topic
=
topicFilter
?
topicFilter
.
tval
[
0
]
:
null
;
const
topic
=
topicFilter
?
topicFilter
.
tval
[
0
]
:
null
;
const
consumerGroup
=
consumerFilter
?
consumerFilter
.
tval
[
0
]
:
null
;
const
consumerGroup
=
consumerFilter
?
consumerFilter
.
tval
[
0
]
:
null
;
const
location
:
string
=
null
;
const
location
:
string
=
null
;
const
monitorType
=
monitorRule
.
strategyExpressionList
[
0
].
metric
;
const
monitorType
=
monitorRule
.
strategyExpressionList
[
0
].
metric
;
alarm
.
changeMonitorStrategyType
(
monitorType
);
alarm
.
changeMonitorStrategyType
(
monitorType
);
//增加clusterIdentification替代原来的clusterName
await
this
.
getClusterId
(
clusterName
);
this
.
clusterIdentification
=
clusterIdentification
;
await
this
.
getClusterId
(
this
.
clusterIdentification
);
//
await
this
.
handleSelectChange
(
topic
,
'
topic
'
);
await
this
.
handleSelectChange
(
topic
,
'
topic
'
);
await
this
.
handleSelectChange
(
consumerGroup
,
'
consumerGroup
'
);
await
this
.
handleSelectChange
(
consumerGroup
,
'
consumerGroup
'
);
this
.
resetFormValue
(
monitorType
,
this
.
clusterId
,
topic
,
consumerGroup
,
location
);
this
.
resetFormValue
(
monitorType
,
this
.
clusterId
entification
,
topic
,
consumerGroup
,
location
);
}
}
public
clearFormData
()
{
public
clearFormData
()
{
...
@@ -130,11 +136,12 @@ export class DynamicSetFilter extends React.Component<IDynamicProps> {
...
@@ -130,11 +136,12 @@ export class DynamicSetFilter extends React.Component<IDynamicProps> {
this
.
resetFormValue
();
this
.
resetFormValue
();
}
}
public
async
handleClusterChange
(
e
:
number
)
{
public
async
handleClusterChange
(
e
:
any
)
{
this
.
clusterId
=
e
;
this
.
clusterId
entification
=
e
;
this
.
topicName
=
null
;
this
.
topicName
=
null
;
topic
.
setLoading
(
true
);
topic
.
setLoading
(
true
);
await
cluster
.
getClusterMetaTopics
(
e
);
const
clusterId
=
await
this
.
getClusterId
(
e
);
await
cluster
.
getClusterMetaTopics
(
clusterId
);
this
.
resetFormValue
(
this
.
monitorType
,
e
,
null
,
this
.
consumerGroup
,
this
.
location
);
this
.
resetFormValue
(
this
.
monitorType
,
e
,
null
,
this
.
consumerGroup
,
this
.
location
);
topic
.
setLoading
(
false
);
topic
.
setLoading
(
false
);
}
}
...
@@ -170,7 +177,7 @@ export class DynamicSetFilter extends React.Component<IDynamicProps> {
...
@@ -170,7 +177,7 @@ export class DynamicSetFilter extends React.Component<IDynamicProps> {
}
}
this
.
consumerGroup
=
null
;
this
.
consumerGroup
=
null
;
this
.
location
=
null
;
this
.
location
=
null
;
this
.
resetFormValue
(
this
.
monitorType
,
this
.
clusterId
,
this
.
topicName
);
this
.
resetFormValue
(
this
.
monitorType
,
this
.
clusterId
entification
,
this
.
topicName
);
topic
.
setLoading
(
false
);
topic
.
setLoading
(
false
);
}
}
...
@@ -213,17 +220,24 @@ export class DynamicSetFilter extends React.Component<IDynamicProps> {
...
@@ -213,17 +220,24 @@ export class DynamicSetFilter extends React.Component<IDynamicProps> {
},
},
rules
:
[{
required
:
true
,
message
:
'
请选择监控指标
'
}],
rules
:
[{
required
:
true
,
message
:
'
请选择监控指标
'
}],
}
as
IVritualScrollSelect
;
}
as
IVritualScrollSelect
;
const
clusterData
=
toJS
(
cluster
.
clusterData
);
const
options
=
clusterData
?.
length
?
clusterData
.
map
(
item
=>
{
return
{
label
:
`
${
item
.
clusterName
}${
item
.
description
?
'
(
'
+
item
.
description
+
'
)
'
:
''
}
`
,
value
:
item
.
clusterIdentification
}
})
:
null
;
const
clusterItem
=
{
const
clusterItem
=
{
label
:
'
集群
'
,
label
:
'
集群
'
,
options
:
cluster
.
clusterData
,
options
,
defaultValue
:
this
.
clusterId
,
defaultValue
:
this
.
clusterId
entification
,
rules
:
[{
required
:
true
,
message
:
'
请选择集群
'
}],
rules
:
[{
required
:
true
,
message
:
'
请选择集群
'
}],
attrs
:
{
attrs
:
{
placeholder
:
'
请选择集群
'
,
placeholder
:
'
请选择集群
'
,
className
:
'
middl
e-size
'
,
className
:
'
larg
e-size
'
,
disabled
:
this
.
isDetailPage
,
disabled
:
this
.
isDetailPage
,
onChange
:
(
e
:
number
)
=>
this
.
handleClusterChange
(
e
),
onChange
:
(
e
:
any
)
=>
this
.
handleClusterChange
(
e
),
},
},
key
:
'
cluster
'
,
key
:
'
cluster
'
,
}
as
unknown
as
IVritualScrollSelect
;
}
as
unknown
as
IVritualScrollSelect
;
...
@@ -241,7 +255,7 @@ export class DynamicSetFilter extends React.Component<IDynamicProps> {
...
@@ -241,7 +255,7 @@ export class DynamicSetFilter extends React.Component<IDynamicProps> {
}),
}),
attrs
:
{
attrs
:
{
placeholder
:
'
请选择Topic
'
,
placeholder
:
'
请选择Topic
'
,
className
:
'
middl
e-size
'
,
className
:
'
larg
e-size
'
,
disabled
:
this
.
isDetailPage
,
disabled
:
this
.
isDetailPage
,
onChange
:
(
e
:
string
)
=>
this
.
handleSelectChange
(
e
,
'
topic
'
),
onChange
:
(
e
:
string
)
=>
this
.
handleSelectChange
(
e
,
'
topic
'
),
},
},
...
@@ -329,7 +343,7 @@ export class DynamicSetFilter extends React.Component<IDynamicProps> {
...
@@ -329,7 +343,7 @@ export class DynamicSetFilter extends React.Component<IDynamicProps> {
key
=
{
v
.
value
||
v
.
key
||
index
}
key
=
{
v
.
value
||
v
.
key
||
index
}
value
=
{
v
.
value
}
value
=
{
v
.
value
}
>
>
{
v
.
label
.
length
>
25
?
<
Tooltip
placement
=
"bottomLeft"
title
=
{
v
.
label
}
>
{
v
.
label
?
.
length
>
25
?
<
Tooltip
placement
=
"bottomLeft"
title
=
{
v
.
label
}
>
{
v
.
label
}
{
v
.
label
}
</
Tooltip
>
:
v
.
label
}
</
Tooltip
>
:
v
.
label
}
</
Select
.
Option
>
</
Select
.
Option
>
...
...
kafka-manager-console/src/container/alarm/add-alarm/index.less
浏览文件 @
00654383
...
@@ -43,21 +43,23 @@
...
@@ -43,21 +43,23 @@
Icon {
Icon {
margin-left: 8px;
margin-left: 8px;
}
}
.ant-form-item-label {
// padding-left: 10px;
width: 118px;
text-align: right !important;
}
&.type-form {
&.type-form {
padding-top: 10px;
padding-top: 10px;
.ant-form{
.ant-form{
min-width: 755px;
min-width: 755px;
}
}
.ant-form-item {
.ant-form-item {
width:
30
%;
width:
45
%;
min-width: 360px;
min-width: 360px;
}
}
.ant-form-item-label {
padding-left: 10px;
}
.ant-form-item-control {
.ant-form-item-control {
width:
22
0px;
width:
30
0px;
}
}
}
}
...
...
kafka-manager-console/src/container/alarm/add-alarm/index.tsx
浏览文件 @
00654383
...
@@ -12,7 +12,6 @@ import { alarm } from 'store/alarm';
...
@@ -12,7 +12,6 @@ import { alarm } from 'store/alarm';
import
{
app
}
from
'
store/app
'
;
import
{
app
}
from
'
store/app
'
;
import
Url
from
'
lib/url-parser
'
;
import
Url
from
'
lib/url-parser
'
;
import
{
IStrategyExpression
,
IRequestParams
}
from
'
types/alarm
'
;
import
{
IStrategyExpression
,
IRequestParams
}
from
'
types/alarm
'
;
@
observer
@
observer
export
class
AddAlarm
extends
SearchAndFilterContainer
{
export
class
AddAlarm
extends
SearchAndFilterContainer
{
public
isDetailPage
=
window
.
location
.
pathname
.
includes
(
'
/alarm-detail
'
);
// 判断是否为详情
public
isDetailPage
=
window
.
location
.
pathname
.
includes
(
'
/alarm-detail
'
);
// 判断是否为详情
...
@@ -90,8 +89,8 @@ export class AddAlarm extends SearchAndFilterContainer {
...
@@ -90,8 +89,8 @@ export class AddAlarm extends SearchAndFilterContainer {
const
filterObj
=
this
.
typeForm
.
getFormData
().
filterObj
;
const
filterObj
=
this
.
typeForm
.
getFormData
().
filterObj
;
// tslint:disable-next-line:max-line-length
// tslint:disable-next-line:max-line-length
if
(
!
actionValue
||
!
timeValue
||
!
typeValue
||
!
strategyList
.
length
||
!
filterObj
||
!
filterObj
.
filterList
.
length
)
{
if
(
!
actionValue
||
!
timeValue
||
!
typeValue
||
!
strategyList
.
length
||
!
filterObj
||
!
filterObj
.
filterList
.
length
)
{
message
.
error
(
'
请正确填写必填项
'
);
message
.
error
(
'
请正确填写必填项
'
);
return
null
;
return
null
;
}
}
if
(
filterObj
.
monitorType
===
'
online-kafka-topic-throttled
'
)
{
if
(
filterObj
.
monitorType
===
'
online-kafka-topic-throttled
'
)
{
...
@@ -101,13 +100,17 @@ export class AddAlarm extends SearchAndFilterContainer {
...
@@ -101,13 +100,17 @@ export class AddAlarm extends SearchAndFilterContainer {
tval
:
[
typeValue
.
app
],
tval
:
[
typeValue
.
app
],
});
});
}
}
this
.
id
&&
filterObj
.
filterList
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
tkey
===
'
cluster
'
)
{
item
.
tval
=
[
item
.
clusterIdentification
]
}
})
strategyList
=
strategyList
.
map
((
row
:
IStrategyExpression
)
=>
{
strategyList
=
strategyList
.
map
((
row
:
IStrategyExpression
)
=>
{
return
{
return
{
...
row
,
...
row
,
metric
:
filterObj
.
monitorType
,
metric
:
filterObj
.
monitorType
,
};
};
});
});
return
{
return
{
appId
:
typeValue
.
app
,
appId
:
typeValue
.
app
,
name
:
typeValue
.
alarmName
,
name
:
typeValue
.
alarmName
,
...
@@ -129,7 +132,7 @@ export class AddAlarm extends SearchAndFilterContainer {
...
@@ -129,7 +132,7 @@ export class AddAlarm extends SearchAndFilterContainer {
public
renderAlarmStrategy
()
{
public
renderAlarmStrategy
()
{
return
(
return
(
<
div
className
=
"config-wrapper"
>
<
div
className
=
"config-wrapper"
>
<
span
className
=
"span-tag"
>
报警策略
</
span
>
<
span
className
=
"span-tag"
data
-
set
=
{
alarm
.
monitorType
}
>
报警策略
</
span
>
<
div
className
=
"info-wrapper"
>
<
div
className
=
"info-wrapper"
>
<
WrappedDynamicSetStrategy
wrappedComponentRef
=
{
(
form
:
any
)
=>
this
.
strategyForm
=
form
}
/>
<
WrappedDynamicSetStrategy
wrappedComponentRef
=
{
(
form
:
any
)
=>
this
.
strategyForm
=
form
}
/>
</
div
>
</
div
>
...
@@ -139,9 +142,9 @@ export class AddAlarm extends SearchAndFilterContainer {
...
@@ -139,9 +142,9 @@ export class AddAlarm extends SearchAndFilterContainer {
public
renderTimeForm
()
{
public
renderTimeForm
()
{
return
(
return
(
<>
<>
<
WrappedTimeForm
wrappedComponentRef
=
{
(
form
:
any
)
=>
this
.
timeForm
=
form
}
/>
<
WrappedTimeForm
wrappedComponentRef
=
{
(
form
:
any
)
=>
this
.
timeForm
=
form
}
/>
</>
</>
);
);
}
}
...
@@ -164,7 +167,7 @@ export class AddAlarm extends SearchAndFilterContainer {
...
@@ -164,7 +167,7 @@ export class AddAlarm extends SearchAndFilterContainer {
{
this
.
renderAlarmStrategy
()
}
{
this
.
renderAlarmStrategy
()
}
{
this
.
renderTimeForm
()
}
{
this
.
renderTimeForm
()
}
<
ActionForm
ref
=
{
(
actionForm
)
=>
this
.
actionForm
=
actionForm
}
/>
<
ActionForm
ref
=
{
(
actionForm
)
=>
this
.
actionForm
=
actionForm
}
/>
</
div
>
</
div
>
</
Spin
>
</
Spin
>
);
);
}
}
...
...
kafka-manager-console/src/container/alarm/add-alarm/strategy-form.tsx
浏览文件 @
00654383
...
@@ -5,6 +5,7 @@ import { IStringMap } from 'types/base-type';
...
@@ -5,6 +5,7 @@ import { IStringMap } from 'types/base-type';
import
{
IRequestParams
}
from
'
types/alarm
'
;
import
{
IRequestParams
}
from
'
types/alarm
'
;
import
{
IFormSelect
,
IFormItem
,
FormItemType
}
from
'
component/x-form
'
;
import
{
IFormSelect
,
IFormItem
,
FormItemType
}
from
'
component/x-form
'
;
import
{
searchProps
}
from
'
constants/table
'
;
import
{
searchProps
}
from
'
constants/table
'
;
import
{
alarm
}
from
'
store/alarm
'
;
interface
IDynamicProps
{
interface
IDynamicProps
{
form
:
any
;
form
:
any
;
...
@@ -27,6 +28,7 @@ class DynamicSetStrategy extends React.Component<IDynamicProps> {
...
@@ -27,6 +28,7 @@ class DynamicSetStrategy extends React.Component<IDynamicProps> {
public
crudList
=
[]
as
ICRUDItem
[];
public
crudList
=
[]
as
ICRUDItem
[];
public
state
=
{
public
state
=
{
shouldUpdate
:
false
,
shouldUpdate
:
false
,
monitorType
:
alarm
.
monitorType
};
};
public
componentDidMount
()
{
public
componentDidMount
()
{
...
@@ -130,7 +132,7 @@ class DynamicSetStrategy extends React.Component<IDynamicProps> {
...
@@ -130,7 +132,7 @@ class DynamicSetStrategy extends React.Component<IDynamicProps> {
if
(
lineValue
.
func
===
'
happen
'
&&
paramsArray
.
length
>
1
&&
paramsArray
[
0
]
<
paramsArray
[
1
])
{
if
(
lineValue
.
func
===
'
happen
'
&&
paramsArray
.
length
>
1
&&
paramsArray
[
0
]
<
paramsArray
[
1
])
{
strategyList
=
[];
// 清空赋值
strategyList
=
[];
// 清空赋值
return
message
.
error
(
'
周期值应大于次数
'
)
;
return
message
.
error
(
'
周期值应大于次数
'
);
}
}
lineValue
.
params
=
paramsArray
.
join
(
'
,
'
);
lineValue
.
params
=
paramsArray
.
join
(
'
,
'
);
...
@@ -292,8 +294,39 @@ class DynamicSetStrategy extends React.Component<IDynamicProps> {
...
@@ -292,8 +294,39 @@ class DynamicSetStrategy extends React.Component<IDynamicProps> {
}
}
return
element
;
return
element
;
}
}
public
unit
(
monitorType
:
string
)
{
public
renderFormList
(
row
:
ICRUDItem
)
{
let
element
=
null
;
switch
(
monitorType
)
{
case
'
online-kafka-topic-msgIn
'
:
element
=
"
条/秒
"
break
;
case
'
online-kafka-topic-bytesIn
'
:
element
=
"
字节/秒
"
break
;
case
'
online-kafka-topic-bytesRejected
'
:
element
=
"
字节/秒
"
break
;
case
'
online-kafka-topic-produce-throttled
'
:
element
=
"
1表示被限流
"
break
;
case
'
online-kafka-topic-fetch-throttled
'
:
element
=
"
1表示被限流
"
break
;
case
'
online-kafka-consumer-maxLag
'
:
element
=
"
条
"
break
;
case
'
online-kafka-consumer-lag
'
:
element
=
"
条
"
break
;
case
'
online-kafka-consumer-maxDelayTime
'
:
element
=
"
秒
"
break
;
}
return
(
<
span
>
{
element
}
</
span
>
)
}
public
renderFormList
(
row
:
ICRUDItem
,
monitorType
:
string
)
{
const
key
=
row
.
id
;
const
key
=
row
.
id
;
const
funcType
=
row
.
func
;
const
funcType
=
row
.
func
;
...
@@ -309,6 +342,7 @@ class DynamicSetStrategy extends React.Component<IDynamicProps> {
...
@@ -309,6 +342,7 @@ class DynamicSetStrategy extends React.Component<IDynamicProps> {
key
:
key
+
'
-func
'
,
key
:
key
+
'
-func
'
,
}
as
IFormSelect
)
}
}
as
IFormSelect
)
}
{
this
.
getFuncItem
(
row
)
}
{
this
.
getFuncItem
(
row
)
}
{
row
.
func
!==
'
c_avg_rate_abs
'
&&
row
.
func
!==
'
pdiff
'
?
this
.
unit
(
monitorType
)
:
null
}
</
div
>
</
div
>
);
);
}
}
...
@@ -340,8 +374,8 @@ class DynamicSetStrategy extends React.Component<IDynamicProps> {
...
@@ -340,8 +374,8 @@ class DynamicSetStrategy extends React.Component<IDynamicProps> {
<
Form
>
<
Form
>
{
crudList
.
map
((
row
,
index
)
=>
{
{
crudList
.
map
((
row
,
index
)
=>
{
return
(
return
(
<
div
key
=
{
index
}
>
<
div
key
=
{
`
${
index
}
-
${
this
.
state
.
monitorType
}
`
}
>
{
this
.
renderFormList
(
row
)
}
{
this
.
renderFormList
(
row
,
alarm
.
monitorType
)
}
{
{
crudList
.
length
>
1
?
(
crudList
.
length
>
1
?
(
<
Icon
<
Icon
...
...
kafka-manager-console/src/container/alarm/add-alarm/type-form.tsx
浏览文件 @
00654383
...
@@ -50,23 +50,23 @@ export class TypeForm extends React.Component {
...
@@ -50,23 +50,23 @@ export class TypeForm extends React.Component {
return
(
return
(
<>
<>
<
div
className
=
"config-wrapper"
>
<
div
className
=
"config-wrapper"
>
<
span
className
=
"span-tag"
>
基本信息
</
span
>
<
span
className
=
"span-tag"
>
基本信息
</
span
>
<
div
className
=
"alarm-x-form type-form"
>
<
div
className
=
"alarm-x-form type-form"
>
<
XFormComponent
<
XFormComponent
ref
=
{
form
=>
this
.
$form
=
form
}
ref
=
{
form
=>
this
.
$form
=
form
}
formData
=
{
formData
}
formData
=
{
formData
}
formMap
=
{
xTypeFormMap
}
formMap
=
{
xTypeFormMap
}
layout
=
"inline"
layout
=
"inline"
/>
/>
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className
=
"config-wrapper"
>
<
div
className
=
"config-wrapper"
>
<
span
className
=
"span-tag"
>
选择指标
</
span
>
<
span
className
=
"span-tag"
>
选择指标
</
span
>
<
div
className
=
"alarm-x-form type-form"
>
<
div
className
=
"alarm-x-form type-form"
>
<
WrappedDynamicSetFilter
wrappedComponentRef
=
{
(
form
:
any
)
=>
this
.
filterForm
=
form
}
/>
<
WrappedDynamicSetFilter
wrappedComponentRef
=
{
(
form
:
any
)
=>
this
.
filterForm
=
form
}
/>
</
div
>
</
div
>
</
div
>
</
div
>
</>
</>
);
);
}
}
...
...
kafka-manager-console/src/container/cluster/cluster-detail/cluster-overview.tsx
浏览文件 @
00654383
...
@@ -31,11 +31,11 @@ export class ClusterOverview extends React.Component<IOverview> {
...
@@ -31,11 +31,11 @@ export class ClusterOverview extends React.Component<IOverview> {
const
content
=
this
.
props
.
basicInfo
as
IBasicInfo
;
const
content
=
this
.
props
.
basicInfo
as
IBasicInfo
;
const
clusterContent
=
[{
const
clusterContent
=
[{
value
:
content
.
clusterName
,
value
:
content
.
clusterName
,
label
:
'
集群
中文
名称
'
,
label
:
'
集群名称
'
,
},
},
{
{
value
:
content
.
cluster
Name
,
value
:
content
.
cluster
Identification
,
label
:
'
集群
英文名称
'
,
label
:
'
集群
标识
'
,
},
},
{
{
value
:
clusterTypeMap
[
content
.
mode
],
value
:
clusterTypeMap
[
content
.
mode
],
...
@@ -44,8 +44,8 @@ export class ClusterOverview extends React.Component<IOverview> {
...
@@ -44,8 +44,8 @@ export class ClusterOverview extends React.Component<IOverview> {
value
:
moment
(
content
.
gmtCreate
).
format
(
timeFormat
),
value
:
moment
(
content
.
gmtCreate
).
format
(
timeFormat
),
label
:
'
接入时间
'
,
label
:
'
接入时间
'
,
},
{
},
{
value
:
content
.
physicalC
lusterId
,
value
:
content
.
c
lusterId
,
label
:
'
物理
集群ID
'
,
label
:
'
集群ID
'
,
}];
}];
const
clusterInfo
=
[{
const
clusterInfo
=
[{
value
:
content
.
clusterVersion
,
value
:
content
.
clusterVersion
,
...
...
kafka-manager-console/src/container/cluster/config.tsx
浏览文件 @
00654383
...
@@ -13,32 +13,14 @@ const { confirm } = Modal;
...
@@ -13,32 +13,14 @@ const { confirm } = Modal;
export
const
getClusterColumns
=
(
urlPrefix
:
string
)
=>
{
export
const
getClusterColumns
=
(
urlPrefix
:
string
)
=>
{
return
[
return
[
{
{
title
:
'
逻辑
集群ID
'
,
title
:
'
集群ID
'
,
dataIndex
:
'
clusterId
'
,
dataIndex
:
'
clusterId
'
,
key
:
'
clusterId
'
,
key
:
'
clusterId
'
,
width
:
'
9%
'
,
width
:
'
9%
'
,
sorter
:
(
a
:
IClusterData
,
b
:
IClusterData
)
=>
b
.
clusterId
-
a
.
clusterId
,
sorter
:
(
a
:
IClusterData
,
b
:
IClusterData
)
=>
b
.
clusterId
-
a
.
clusterId
,
},
},
{
{
title
:
'
逻辑集群中文名称
'
,
title
:
'
集群名称
'
,
dataIndex
:
'
clusterName
'
,
key
:
'
clusterName
'
,
width
:
'
13%
'
,
onCell
:
()
=>
({
style
:
{
maxWidth
:
120
,
...
cellStyle
,
},
}),
sorter
:
(
a
:
IClusterData
,
b
:
IClusterData
)
=>
a
.
clusterName
.
charCodeAt
(
0
)
-
b
.
clusterName
.
charCodeAt
(
0
),
render
:
(
text
:
string
,
record
:
IClusterData
)
=>
(
<
Tooltip
placement
=
"bottomLeft"
title
=
{
text
}
>
<
a
href
=
{
`
${
urlPrefix
}
/cluster/cluster-detail?clusterId=
${
record
.
clusterId
}
`
}
>
{
text
}
</
a
>
</
Tooltip
>
),
},
{
title
:
'
逻辑集群英文名称
'
,
dataIndex
:
'
clusterName
'
,
dataIndex
:
'
clusterName
'
,
key
:
'
clusterName
'
,
key
:
'
clusterName
'
,
width
:
'
13%
'
,
width
:
'
13%
'
,
...
@@ -55,6 +37,24 @@ export const getClusterColumns = (urlPrefix: string) => {
...
@@ -55,6 +37,24 @@ export const getClusterColumns = (urlPrefix: string) => {
</
Tooltip
>
</
Tooltip
>
),
),
},
},
// {
// title: '逻辑集群英文名称',
// dataIndex: 'clusterName',
// key: 'clusterName',
// width: '13%',
// onCell: () => ({
// style: {
// maxWidth: 120,
// ...cellStyle,
// },
// }),
// sorter: (a: IClusterData, b: IClusterData) => a.clusterName.charCodeAt(0) - b.clusterName.charCodeAt(0),
// render: (text: string, record: IClusterData) => (
// <Tooltip placement="bottomLeft" title={text} >
// <a href={`${urlPrefix}/cluster/cluster-detail?clusterId=${record.clusterId}`}> {text} </a>
// </Tooltip>
// ),
// },
{
{
title
:
'
Topic数量
'
,
title
:
'
Topic数量
'
,
dataIndex
:
'
topicNum
'
,
dataIndex
:
'
topicNum
'
,
...
...
kafka-manager-console/src/container/cluster/my-cluster.tsx
浏览文件 @
00654383
...
@@ -78,7 +78,7 @@ export class MyCluster extends SearchAndFilterContainer {
...
@@ -78,7 +78,7 @@ export class MyCluster extends SearchAndFilterContainer {
rules
:
[
rules
:
[
{
{
required
:
true
,
required
:
true
,
pattern
:
/^.
{
5
,}
.$/
,
pattern
:
/^.
{
4
,}
.$/
,
message
:
'
请输入至少5个字符
'
,
message
:
'
请输入至少5个字符
'
,
},
},
],
],
...
@@ -160,7 +160,7 @@ export class MyCluster extends SearchAndFilterContainer {
...
@@ -160,7 +160,7 @@ export class MyCluster extends SearchAndFilterContainer {
data
=
searchKey
?
origin
.
filter
((
item
:
IClusterData
)
=>
data
=
searchKey
?
origin
.
filter
((
item
:
IClusterData
)
=>
(
item
.
clusterName
!==
undefined
&&
item
.
clusterName
!==
null
)
&&
item
.
clusterName
.
toLowerCase
().
includes
(
searchKey
as
string
),
(
item
.
clusterName
!==
undefined
&&
item
.
clusterName
!==
null
)
&&
item
.
clusterName
.
toLowerCase
().
includes
(
searchKey
as
string
),
)
:
origin
;
)
:
origin
;
return
data
;
return
data
;
}
}
...
...
kafka-manager-console/src/container/drawer/data-migration.tsx
浏览文件 @
00654383
...
@@ -127,7 +127,7 @@ class DataMigrationFormTable extends React.Component<IFormTableProps> {
...
@@ -127,7 +127,7 @@ class DataMigrationFormTable extends React.Component<IFormTableProps> {
key
:
'
retentionTime
'
,
// originalRetentionTime
key
:
'
retentionTime
'
,
// originalRetentionTime
width
:
'
132px
'
,
width
:
'
132px
'
,
sorter
:
(
a
:
IRenderData
,
b
:
IRenderData
)
=>
b
.
retentionTime
-
a
.
retentionTime
,
sorter
:
(
a
:
IRenderData
,
b
:
IRenderData
)
=>
b
.
retentionTime
-
a
.
retentionTime
,
render
:
(
time
:
any
)
=>
transMSecondToHour
(
time
),
render
:
(
time
:
any
)
=>
transMSecondToHour
(
time
),
},
{
},
{
title
:
'
BrokerID
'
,
title
:
'
BrokerID
'
,
dataIndex
:
'
brokerIdList
'
,
dataIndex
:
'
brokerIdList
'
,
...
@@ -254,7 +254,7 @@ class DataMigrationFormTable extends React.Component<IFormTableProps> {
...
@@ -254,7 +254,7 @@ class DataMigrationFormTable extends React.Component<IFormTableProps> {
dataSource
=
{
this
.
props
.
data
}
dataSource
=
{
this
.
props
.
data
}
columns
=
{
columns
}
columns
=
{
columns
}
pagination
=
{
false
}
pagination
=
{
false
}
scroll
=
{
{
y
:
520
}
}
scroll
=
{
{
y
:
520
}
}
className
=
"migration-table"
className
=
"migration-table"
/>
/>
</
EditableContext
.
Provider
>
</
EditableContext
.
Provider
>
...
@@ -316,7 +316,7 @@ export class InfoForm extends React.Component<IFormTableProps> {
...
@@ -316,7 +316,7 @@ export class InfoForm extends React.Component<IFormTableProps> {
<
Form
.
Item
label
=
"迁移说明"
key
=
{
2
}
className
=
"form-item"
>
<
Form
.
Item
label
=
"迁移说明"
key
=
{
2
}
className
=
"form-item"
>
{
getFieldDecorator
(
'
description
'
,
{
{
getFieldDecorator
(
'
description
'
,
{
initialValue
:
''
,
initialValue
:
''
,
rules
:
[{
required
:
true
,
message
:
'
请输入至少5个字符
'
,
pattern
:
/^.
{
5
,}
.$/
}],
rules
:
[{
required
:
true
,
message
:
'
请输入至少5个字符
'
,
pattern
:
/^.
{
4
,}
.$/
}],
})(
})(
<
Input
.
TextArea
rows
=
{
5
}
placeholder
=
"请输入至少5个字符"
/>,
<
Input
.
TextArea
rows
=
{
5
}
placeholder
=
"请输入至少5个字符"
/>,
)
}
)
}
...
...
kafka-manager-console/src/container/modal/admin/cluster.ts
浏览文件 @
00654383
...
@@ -23,13 +23,22 @@ export const showEditClusterTopic = (item: IClusterTopics) => {
...
@@ -23,13 +23,22 @@ export const showEditClusterTopic = (item: IClusterTopics) => {
{
{
key
:
'
appId
'
,
key
:
'
appId
'
,
label
:
'
应用ID
'
,
label
:
'
应用ID
'
,
type
:
'
select
'
,
options
:
app
.
adminAppData
.
map
(
item
=>
{
return
{
label
:
item
.
appId
,
value
:
item
.
appId
,
};
}),
rules
:
[{
rules
:
[{
required
:
true
,
required
:
true
,
message
:
'
请输入应用ID
'
,
// message: '请输入应用ID',
// message: '请输入应用ID,应用名称只支持字母、数字、下划线、短划线,长度限制在3-64字符',
// pattern: /[_a-zA-Z0-9_-]{3,64}$/,
}],
}],
attrs
:
{
attrs
:
{
placeholder
:
'
请输入应用ID
'
,
placeholder
:
'
请输入应用ID
'
,
disabled
:
true
,
//
disabled: true,
},
},
},
},
{
{
...
@@ -104,7 +113,7 @@ export const showLogicalClusterOpModal = (clusterId: number, record?: ILogicalCl
...
@@ -104,7 +113,7 @@ export const showLogicalClusterOpModal = (clusterId: number, record?: ILogicalCl
}
}
const
updateFormModal
=
(
isShow
:
boolean
)
=>
{
const
updateFormModal
=
(
isShow
:
boolean
)
=>
{
const
formMap
=
wrapper
.
xFormWrapper
.
formMap
;
const
formMap
=
wrapper
.
xFormWrapper
.
formMap
;
isShow
?
formMap
.
splice
(
2
,
0
,
isShow
?
formMap
.
splice
(
3
,
0
,
{
{
key
:
'
appId
'
,
key
:
'
appId
'
,
label
:
'
所属应用
'
,
label
:
'
所属应用
'
,
...
@@ -119,7 +128,7 @@ export const showLogicalClusterOpModal = (clusterId: number, record?: ILogicalCl
...
@@ -119,7 +128,7 @@ export const showLogicalClusterOpModal = (clusterId: number, record?: ILogicalCl
attrs
:
{
attrs
:
{
placeholder
:
'
请选择所属应用
'
,
placeholder
:
'
请选择所属应用
'
,
},
},
})
:
formMap
.
splice
(
2
,
1
);
})
:
formMap
.
splice
(
3
,
1
);
const
formData
=
wrapper
.
xFormWrapper
.
formData
;
const
formData
=
wrapper
.
xFormWrapper
.
formData
;
wrapper
.
ref
&&
wrapper
.
ref
.
updateFormMap$
(
formMap
,
formData
||
{});
wrapper
.
ref
&&
wrapper
.
ref
.
updateFormMap$
(
formMap
,
formData
||
{});
};
};
...
@@ -129,30 +138,30 @@ export const showLogicalClusterOpModal = (clusterId: number, record?: ILogicalCl
...
@@ -129,30 +138,30 @@ export const showLogicalClusterOpModal = (clusterId: number, record?: ILogicalCl
formMap
:
[
formMap
:
[
{
{
key
:
'
logicalClusterName
'
,
key
:
'
logicalClusterName
'
,
label
:
'
逻辑集群
中文
名称
'
,
label
:
'
逻辑集群名称
'
,
// defaultValue:'',
// defaultValue:'',
rules
:
[{
rules
:
[{
required
:
true
,
required
:
true
,
message
:
'
请输入逻辑集群
中文
名称,支持中文、字母、数字、下划线(_)和短划线(-)组成,长度在3-128字符之间
'
,
// 不能以下划线(_)和短划线(-)开头和结尾
message
:
'
请输入逻辑集群名称,支持中文、字母、数字、下划线(_)和短划线(-)组成,长度在3-128字符之间
'
,
// 不能以下划线(_)和短划线(-)开头和结尾
pattern
:
/^
[
a-zA-Z0-9_
\-\u
4e00-
\u
9fa5
]{3,128}
$/g
,
//(?!(_|\-))(?!.*?(_|\-)$)
pattern
:
/^
[
a-zA-Z0-9_
\-\u
4e00-
\u
9fa5
]{3,128}
$/g
,
//(?!(_|\-))(?!.*?(_|\-)$)
}],
}],
attrs
:
{
attrs
:
{
// disabled: record ? true : false,
// disabled: record ? true : false,
placeholder
:
'
请输入逻辑集群中文
名称
'
placeholder
:
'
请输入逻辑集群
名称
'
},
},
},
},
{
{
key
:
'
logicalCluster
Name1
'
,
key
:
'
logicalCluster
Identification
'
,
label
:
'
逻辑集群
英文名称
'
,
label
:
'
逻辑集群
标识
'
,
// defaultValue:'',
// defaultValue:'',
rules
:
[{
rules
:
[{
required
:
true
,
required
:
true
,
message
:
'
请输入逻辑集群
英文名称
,支持字母、数字、下划线(_)和短划线(-)组成,长度在3-128字符之间
'
,
//不能以下划线(_)和短划线(-)开头和结尾
message
:
'
请输入逻辑集群
标识
,支持字母、数字、下划线(_)和短划线(-)组成,长度在3-128字符之间
'
,
//不能以下划线(_)和短划线(-)开头和结尾
pattern
:
/^
[
a-zA-Z0-9_
\-]{3,128}
$/g
,
//(?!(_|\-))(?!.*?(_|\-)$)
pattern
:
/^
[
a-zA-Z0-9_
\-]{3,128}
$/g
,
//(?!(_|\-))(?!.*?(_|\-)$)
}],
}],
attrs
:
{
attrs
:
{
disabled
:
record
?
true
:
false
,
disabled
:
record
?
true
:
false
,
placeholder
:
'
请输入逻辑集群英文名称
,创建后无法修改
'
placeholder
:
'
请输入逻辑集标识
,创建后无法修改
'
},
},
},
},
{
{
...
@@ -233,7 +242,7 @@ export const showLogicalClusterOpModal = (clusterId: number, record?: ILogicalCl
...
@@ -233,7 +242,7 @@ export const showLogicalClusterOpModal = (clusterId: number, record?: ILogicalCl
id
:
record
?
record
.
logicalClusterId
:
''
,
id
:
record
?
record
.
logicalClusterId
:
''
,
mode
:
value
.
mode
,
mode
:
value
.
mode
,
name
:
value
.
logicalClusterName
,
name
:
value
.
logicalClusterName
,
englishName
:
value
.
logicalClusterEName
,
// 存储逻辑集群英文名称
identification
:
value
.
logicalClusterIdentification
,
regionIdList
:
value
.
regionIdList
,
regionIdList
:
value
.
regionIdList
,
}
as
INewLogical
;
}
as
INewLogical
;
if
(
record
)
{
if
(
record
)
{
...
@@ -246,7 +255,25 @@ export const showLogicalClusterOpModal = (clusterId: number, record?: ILogicalCl
...
@@ -246,7 +255,25 @@ export const showLogicalClusterOpModal = (clusterId: number, record?: ILogicalCl
});
});
},
},
};
};
if
(
record
&&
record
.
mode
!=
0
)
{
isShow
=
true
;
let
formMap
:
any
=
xFormModal
.
formMap
formMap
.
splice
(
3
,
0
,
{
key
:
'
appId
'
,
label
:
'
所属应用
'
,
rules
:
[{
required
:
true
,
message
:
'
请选择所属应用
'
}],
type
:
'
select
'
,
options
:
app
.
adminAppData
.
map
(
item
=>
{
return
{
label
:
item
.
name
,
value
:
item
.
appId
,
};
}),
attrs
:
{
placeholder
:
'
请选择所属应用
'
,
},
})
}
wrapper
.
open
(
xFormModal
);
wrapper
.
open
(
xFormModal
);
};
};
...
...
kafka-manager-console/src/container/modal/admin/expand-partition.tsx
浏览文件 @
00654383
...
@@ -50,7 +50,10 @@ class CustomForm extends React.Component<IXFormProps> {
...
@@ -50,7 +50,10 @@ class CustomForm extends React.Component<IXFormProps> {
notification
.
success
({
message
:
'
扩分成功
'
});
notification
.
success
({
message
:
'
扩分成功
'
});
this
.
props
.
form
.
resetFields
();
this
.
props
.
form
.
resetFields
();
admin
.
getClusterTopics
(
this
.
props
.
clusterId
);
admin
.
getClusterTopics
(
this
.
props
.
clusterId
);
});
}).
catch
(
err
=>
{
notification
.
error
({
message
:
'
扩分成功
'
});
})
}
}
});
});
}
}
...
@@ -93,7 +96,7 @@ class CustomForm extends React.Component<IXFormProps> {
...
@@ -93,7 +96,7 @@ class CustomForm extends React.Component<IXFormProps> {
{
/* 运维管控-topic信息-扩分区操作 */
}
{
/* 运维管控-topic信息-扩分区操作 */
}
<
Form
.
Item
label
=
"所属region"
>
<
Form
.
Item
label
=
"所属region"
>
{
getFieldDecorator
(
'
regionNameList
'
,
{
{
getFieldDecorator
(
'
regionNameList
'
,
{
initialValue
:
admin
.
topicsBasic
?
admin
.
topicsBasic
.
regionNameList
:
'
'
,
initialValue
:
admin
.
topicsBasic
&&
admin
.
topicsBasic
.
regionNameList
.
length
>
0
?
admin
.
topicsBasic
.
regionNameList
.
join
(
'
,
'
)
:
'
'
,
rules
:
[{
required
:
true
,
message
:
'
请输入所属region
'
}],
rules
:
[{
required
:
true
,
message
:
'
请输入所属region
'
}],
})(<
Input
disabled
=
{
true
}
/>)
}
})(<
Input
disabled
=
{
true
}
/>)
}
</
Form
.
Item
>
</
Form
.
Item
>
...
...
kafka-manager-console/src/container/modal/admin/task.ts
浏览文件 @
00654383
...
@@ -186,10 +186,10 @@ export const createMigrationTasks = () => {
...
@@ -186,10 +186,10 @@ export const createMigrationTasks = () => {
label
:
'
初始限流
'
,
label
:
'
初始限流
'
,
rules
:
[{
rules
:
[{
required
:
true
,
required
:
true
,
message
:
'
请输入初始限流
'
,
message
:
'
请输入初始限流
,并按照:“限流上限>初始限流>限流下限”的大小顺序
'
,
}],
}],
attrs
:
{
attrs
:
{
placeholder
:
'
请输入初始限流
'
,
placeholder
:
'
请输入初始限流
,并按照:“限流上限>初始限流>限流下限”的大小顺序
'
,
suffix
:
'
MB/s
'
,
suffix
:
'
MB/s
'
,
},
},
},
},
...
@@ -198,10 +198,10 @@ export const createMigrationTasks = () => {
...
@@ -198,10 +198,10 @@ export const createMigrationTasks = () => {
label
:
'
限流上限
'
,
label
:
'
限流上限
'
,
rules
:
[{
rules
:
[{
required
:
true
,
required
:
true
,
message
:
'
请输入限流上限
'
,
message
:
'
请输入限流上限
,并按照:“限流上限>初始限流>限流下限”的大小顺序
'
,
}],
}],
attrs
:
{
attrs
:
{
placeholder
:
'
请输入限流上限
'
,
placeholder
:
'
请输入限流上限
,并按照:“限流上限>初始限流>限流下限”的大小顺序
'
,
suffix
:
'
MB/s
'
,
suffix
:
'
MB/s
'
,
},
},
},
},
...
@@ -210,10 +210,10 @@ export const createMigrationTasks = () => {
...
@@ -210,10 +210,10 @@ export const createMigrationTasks = () => {
label
:
'
限流下限
'
,
label
:
'
限流下限
'
,
rules
:
[{
rules
:
[{
required
:
true
,
required
:
true
,
message
:
'
请输入限流下限
'
,
message
:
'
请输入限流下限
,并按照:“限流上限>初始限流>限流下限”的大小顺序
'
,
}],
}],
attrs
:
{
attrs
:
{
placeholder
:
'
请输入限流下限
'
,
placeholder
:
'
请输入限流下限
,并按照:“限流上限>初始限流>限流下限”的大小顺序
'
,
suffix
:
'
MB/s
'
,
suffix
:
'
MB/s
'
,
},
},
},
},
...
@@ -224,7 +224,7 @@ export const createMigrationTasks = () => {
...
@@ -224,7 +224,7 @@ export const createMigrationTasks = () => {
rules
:
[{
rules
:
[{
required
:
false
,
required
:
false
,
message
:
'
请输入至少5个字符
'
,
message
:
'
请输入至少5个字符
'
,
pattern
:
/^.
{
5
,}
.$/
,
pattern
:
/^.
{
4
,}
.$/
,
}],
}],
attrs
:
{
attrs
:
{
placeholder
:
'
请输入备注
'
,
placeholder
:
'
请输入备注
'
,
...
...
kafka-manager-console/src/container/modal/app.tsx
浏览文件 @
00654383
...
@@ -29,7 +29,7 @@ export const showEditModal = (record?: IAppItem, from?: string, isDisabled?: boo
...
@@ -29,7 +29,7 @@ export const showEditModal = (record?: IAppItem, from?: string, isDisabled?: boo
rules
:
[{
rules
:
[{
required
:
isDisabled
?
false
:
true
,
required
:
isDisabled
?
false
:
true
,
message
:
'
应用名称只支持中文、字母、数字、下划线、短划线,长度限制在3-64字符
'
,
message
:
'
应用名称只支持中文、字母、数字、下划线、短划线,长度限制在3-64字符
'
,
pattern
:
/
[\u
4e00-
\u
9fa5_a-zA-Z0-9_-
]{3,64}
/
,
pattern
:
/
[\u
4e00-
\u
9fa5_a-zA-Z0-9_-
]{3,64}
$
/
,
}],
}],
attrs
:
{
disabled
:
isDisabled
},
attrs
:
{
disabled
:
isDisabled
},
},
{
},
{
...
...
kafka-manager-console/src/container/modal/cluster.tsx
浏览文件 @
00654383
...
@@ -29,7 +29,7 @@ export const showCpacityModal = (item: IClusterData) => {
...
@@ -29,7 +29,7 @@ export const showCpacityModal = (item: IClusterData) => {
key
:
'
description
'
,
key
:
'
description
'
,
label
:
'
申请原因
'
,
label
:
'
申请原因
'
,
type
:
'
text_area
'
,
type
:
'
text_area
'
,
rules
:
[{
required
:
true
,
pattern
:
/^.
{
5
,}
.$/
,
message
:
'
请输入至少5个字符
'
}],
rules
:
[{
required
:
true
,
pattern
:
/^.
{
4
,}
.$/
,
message
:
'
请输入至少5个字符
'
}],
attrs
:
{
attrs
:
{
placeholder
:
'
请输入至少5个字符
'
,
placeholder
:
'
请输入至少5个字符
'
,
},
},
...
@@ -44,12 +44,12 @@ export const showCpacityModal = (item: IClusterData) => {
...
@@ -44,12 +44,12 @@ export const showCpacityModal = (item: IClusterData) => {
type
:
value
.
type
,
type
:
value
.
type
,
applicant
:
users
.
currentUser
.
username
,
applicant
:
users
.
currentUser
.
username
,
description
:
value
.
description
,
description
:
value
.
description
,
extensions
:
JSON
.
stringify
({
clusterId
:
item
.
clusterId
}),
extensions
:
JSON
.
stringify
({
clusterId
:
item
.
clusterId
}),
};
};
cluster
.
applyCpacity
(
cpacityParams
).
then
(
data
=>
{
cluster
.
applyCpacity
(
cpacityParams
).
then
(
data
=>
{
notification
.
success
({
notification
.
success
({
message
:
`申请
${
value
.
type
===
5
?
'
扩容
'
:
'
缩容
'
}
成功`
,
message
:
`申请
${
value
.
type
===
5
?
'
扩容
'
:
'
缩容
'
}
成功`
,
});
});
window
.
location
.
href
=
`
${
urlPrefix
}
/user/order-detail/?orderId=
${
data
.
id
}
®ion=
${
region
.
currentRegion
}
`
;
window
.
location
.
href
=
`
${
urlPrefix
}
/user/order-detail/?orderId=
${
data
.
id
}
®ion=
${
region
.
currentRegion
}
`
;
});
});
},
},
...
...
kafka-manager-console/src/container/modal/topic.tsx
浏览文件 @
00654383
...
@@ -22,7 +22,7 @@ export const applyTopic = () => {
...
@@ -22,7 +22,7 @@ export const applyTopic = () => {
formMap
:
[
formMap
:
[
{
{
key
:
'
clusterId
'
,
key
:
'
clusterId
'
,
label
:
'
所属
逻辑
集群:
'
,
label
:
'
所属集群:
'
,
type
:
'
select
'
,
type
:
'
select
'
,
options
:
cluster
.
clusterData
,
options
:
cluster
.
clusterData
,
rules
:
[{
required
:
true
,
message
:
'
请选择
'
}],
rules
:
[{
required
:
true
,
message
:
'
请选择
'
}],
...
@@ -75,7 +75,7 @@ export const applyTopic = () => {
...
@@ -75,7 +75,7 @@ export const applyTopic = () => {
key
:
'
description
'
,
key
:
'
description
'
,
label
:
'
申请原因
'
,
label
:
'
申请原因
'
,
type
:
'
text_area
'
,
type
:
'
text_area
'
,
rules
:
[{
required
:
true
,
pattern
:
/^.
{
5
,}
.$/
s
,
message
:
'
请输入至少5个字符
'
}],
rules
:
[{
required
:
true
,
pattern
:
/^.
{
4
,}
.$/
s
,
message
:
'
请输入至少5个字符
'
}],
attrs
:
{
attrs
:
{
placeholder
:
`概要描述Topic的数据源, Topic数据的生产者/消费者, Topic的申请原因及备注信息等。(最多100个字)
placeholder
:
`概要描述Topic的数据源, Topic数据的生产者/消费者, Topic的申请原因及备注信息等。(最多100个字)
例如:
例如:
...
@@ -180,13 +180,14 @@ export const showApplyQuatoModal = (item: ITopic | IAppsIdInfo, record: IQuotaQu
...
@@ -180,13 +180,14 @@ export const showApplyQuatoModal = (item: ITopic | IAppsIdInfo, record: IQuotaQu
const
isConsume
=
item
.
access
===
0
||
item
.
access
===
2
;
const
isConsume
=
item
.
access
===
0
||
item
.
access
===
2
;
const
xFormModal
=
{
const
xFormModal
=
{
formMap
:
[
formMap
:
[
// {
// key: 'clusterName',
// label: '逻辑集群名称',
// rules: [{ required: true, message: '' }],
// attrs: { disabled: true },
// invisible: !item.hasOwnProperty('clusterName'),
// },
{
{
key
:
'
clusterName
'
,
label
:
'
逻辑集群名称
'
,
rules
:
[{
required
:
true
,
message
:
''
}],
attrs
:
{
disabled
:
true
},
invisible
:
!
item
.
hasOwnProperty
(
'
clusterName
'
),
},
{
key
:
'
topicName
'
,
key
:
'
topicName
'
,
label
:
'
Topic名称
'
,
label
:
'
Topic名称
'
,
rules
:
[{
required
:
true
,
message
:
''
}],
rules
:
[{
required
:
true
,
message
:
''
}],
...
@@ -225,7 +226,7 @@ export const showApplyQuatoModal = (item: ITopic | IAppsIdInfo, record: IQuotaQu
...
@@ -225,7 +226,7 @@ export const showApplyQuatoModal = (item: ITopic | IAppsIdInfo, record: IQuotaQu
key
:
'
description
'
,
key
:
'
description
'
,
label
:
'
申请原因
'
,
label
:
'
申请原因
'
,
type
:
'
text_area
'
,
type
:
'
text_area
'
,
rules
:
[{
required
:
true
,
pattern
:
/^.
{
5
,}
.$/
,
message
:
quotaRemarks
}],
rules
:
[{
required
:
true
,
pattern
:
/^.
{
4
,}
.$/
,
message
:
quotaRemarks
}],
attrs
:
{
attrs
:
{
placeholder
:
quotaRemarks
,
placeholder
:
quotaRemarks
,
},
},
...
@@ -292,13 +293,15 @@ const updateFormModal = (appId: string) => {
...
@@ -292,13 +293,15 @@ const updateFormModal = (appId: string) => {
export
const
showTopicApplyQuatoModal
=
(
item
:
ITopic
)
=>
{
export
const
showTopicApplyQuatoModal
=
(
item
:
ITopic
)
=>
{
const
xFormModal
=
{
const
xFormModal
=
{
formMap
:
[
formMap
:
[
// {
// key: 'clusterName',
// label: '逻辑集群名称',
// rules: [{ required: true, message: '' }],
// attrs: { disabled: true },
// defaultValue: item.clusterName,
// // invisible: !item.hasOwnProperty('clusterName'),
// },
{
{
key
:
'
clusterName
'
,
label
:
'
逻辑集群名称
'
,
rules
:
[{
required
:
true
,
message
:
''
}],
attrs
:
{
disabled
:
true
},
// invisible: !item.hasOwnProperty('clusterName'),
},
{
key
:
'
topicName
'
,
key
:
'
topicName
'
,
label
:
'
Topic名称
'
,
label
:
'
Topic名称
'
,
rules
:
[{
required
:
true
,
message
:
''
}],
rules
:
[{
required
:
true
,
message
:
''
}],
...
@@ -530,7 +533,7 @@ const showAllPermission = (appId: string, item: ITopic, access: number) => {
...
@@ -530,7 +533,7 @@ const showAllPermission = (appId: string, item: ITopic, access: number) => {
rules
:
[{
rules
:
[{
required
:
true
,
required
:
true
,
validator
:
(
rule
:
any
,
value
:
string
,
callback
:
any
)
=>
{
validator
:
(
rule
:
any
,
value
:
string
,
callback
:
any
)
=>
{
const
regexp
=
/^.
{
5
,}
.$/
;
const
regexp
=
/^.
{
4
,}
.$/
;
value
=
value
.
trim
();
value
=
value
.
trim
();
if
(
!
regexp
.
test
(
value
))
{
if
(
!
regexp
.
test
(
value
))
{
callback
(
'
请输入至少5个字符
'
);
callback
(
'
请输入至少5个字符
'
);
...
@@ -629,7 +632,7 @@ export const showPermissionModal = (item: ITopic) => {
...
@@ -629,7 +632,7 @@ export const showPermissionModal = (item: ITopic) => {
rules
:
[{
rules
:
[{
required
:
true
,
required
:
true
,
validator
:
(
rule
:
any
,
value
:
string
,
callback
:
any
)
=>
{
validator
:
(
rule
:
any
,
value
:
string
,
callback
:
any
)
=>
{
const
regexp
=
/^.
{
5
,}
.$/
;
const
regexp
=
/^.
{
4
,}
.$/
;
value
=
value
.
trim
();
value
=
value
.
trim
();
if
(
!
regexp
.
test
(
value
))
{
if
(
!
regexp
.
test
(
value
))
{
callback
(
'
请输入至少5个字符
'
);
callback
(
'
请输入至少5个字符
'
);
...
@@ -678,7 +681,7 @@ export const showTopicEditModal = (item: ITopic) => {
...
@@ -678,7 +681,7 @@ export const showTopicEditModal = (item: ITopic) => {
key
:
'
description
'
,
key
:
'
description
'
,
label
:
'
备注
'
,
label
:
'
备注
'
,
type
:
'
text_area
'
,
type
:
'
text_area
'
,
rules
:
[{
required
:
false
},
{
pattern
:
/^.
{
5
,}
.$/
,
message
:
'
请输入至少5个字符
'
}],
rules
:
[{
required
:
false
},
{
pattern
:
/^.
{
4
,}
.$/
,
message
:
'
请输入至少5个字符
'
}],
},
},
],
],
formData
:
{
formData
:
{
...
...
kafka-manager-console/src/container/topic/config.tsx
浏览文件 @
00654383
...
@@ -85,7 +85,6 @@ export const applyQuotaQuery = (item: ITopic) => {
...
@@ -85,7 +85,6 @@ export const applyQuotaQuery = (item: ITopic) => {
};
};
export
const
applyTopicQuotaQuery
=
async
(
item
:
ITopic
)
=>
{
export
const
applyTopicQuotaQuery
=
async
(
item
:
ITopic
)
=>
{
console
.
log
(
item
)
await
app
.
getTopicAppQuota
(
item
.
clusterId
,
item
.
topicName
);
await
app
.
getTopicAppQuota
(
item
.
clusterId
,
item
.
topicName
);
await
showTopicApplyQuatoModal
(
item
);
await
showTopicApplyQuatoModal
(
item
);
};
};
...
@@ -142,7 +141,7 @@ export const getAllTopicColumns = (urlPrefix: string) => {
...
@@ -142,7 +141,7 @@ export const getAllTopicColumns = (urlPrefix: string) => {
<
Tooltip
placement
=
"bottomLeft"
title
=
{
record
.
topicName
}
>
<
Tooltip
placement
=
"bottomLeft"
title
=
{
record
.
topicName
}
>
<
a
<
a
// tslint:disable-next-line:max-line-length
// tslint:disable-next-line:max-line-length
href
=
{
`
${
urlPrefix
}
/topic/topic-detail?clusterId=
${
record
.
clusterId
}
&topic=
${
record
.
topicName
}
®ion=
${
region
.
currentRegion
}
&needAuth=
${
record
.
needAuth
}
&clusterName=
${
record
.
clusterName
}
`
}
href
=
{
`
${
urlPrefix
}
/topic/topic-detail?clusterId=
${
record
.
clusterId
}
&topic=
${
record
.
topicName
}
®ion=
${
region
.
currentRegion
}
&needAuth=
${
record
.
needAuth
}
`
}
>
{
text
}
</
a
>
>
{
text
}
</
a
>
</
Tooltip
>);
</
Tooltip
>);
},
},
...
...
kafka-manager-console/src/container/topic/topic-all.tsx
浏览文件 @
00654383
...
@@ -60,7 +60,7 @@ export class AllTopic extends SearchAndFilterContainer {
...
@@ -60,7 +60,7 @@ export class AllTopic extends SearchAndFilterContainer {
if
(
cluster
.
allActive
!==
-
1
||
searchKey
!==
''
)
{
if
(
cluster
.
allActive
!==
-
1
||
searchKey
!==
''
)
{
data
=
origin
.
filter
(
d
=>
data
=
origin
.
filter
(
d
=>
((
d
.
topicName
!==
undefined
&&
d
.
topicName
!==
null
)
&&
d
.
topicName
.
toLowerCase
().
includes
(
searchKey
as
string
)
((
d
.
topicName
!==
undefined
&&
d
.
topicName
!==
null
)
&&
d
.
topicName
.
toLowerCase
().
includes
(
searchKey
as
string
)
||
((
d
.
appPrincipals
!==
undefined
&&
d
.
appPrincipals
!==
null
)
&&
d
.
appPrincipals
.
toLowerCase
().
includes
(
searchKey
as
string
)))
||
((
d
.
appPrincipals
!==
undefined
&&
d
.
appPrincipals
!==
null
)
&&
d
.
appPrincipals
.
toLowerCase
().
includes
(
searchKey
as
string
)))
&&
(
cluster
.
allActive
===
-
1
||
d
.
clusterId
===
cluster
.
allActive
),
&&
(
cluster
.
allActive
===
-
1
||
d
.
clusterId
===
cluster
.
allActive
),
);
);
}
else
{
}
else
{
...
...
kafka-manager-console/src/container/topic/topic-detail/base-information.tsx
浏览文件 @
00654383
...
@@ -69,7 +69,7 @@ export class BaseInformation extends React.Component<IInfoProps> {
...
@@ -69,7 +69,7 @@ export class BaseInformation extends React.Component<IInfoProps> {
label
:
'
压缩格式
'
,
label
:
'
压缩格式
'
,
value
:
baseInfo
.
topicCodeC
,
value
:
baseInfo
.
topicCodeC
,
},
{
},
{
label
:
'
所属物理
集群ID
'
,
label
:
'
集群ID
'
,
value
:
baseInfo
.
clusterId
,
value
:
baseInfo
.
clusterId
,
},
{
},
{
label
:
'
所属region
'
,
label
:
'
所属region
'
,
...
...
kafka-manager-console/src/container/topic/topic-detail/bill-information.tsx
浏览文件 @
00654383
...
@@ -95,23 +95,23 @@ export class BillInformation extends SearchAndFilterContainer {
...
@@ -95,23 +95,23 @@ export class BillInformation extends SearchAndFilterContainer {
}
}
public
render
()
{
public
render
()
{
return
(
return
(
<>
<>
<
div
className
=
"k-row"
>
<
div
className
=
"k-row"
>
<
ul
className
=
"k-tab"
>
<
ul
className
=
"k-tab"
>
<
li
>
账单信息
<
li
>
账单信息
<
a
<
a
// tslint:disable-next-line:max-line-length
// tslint:disable-next-line:max-line-length
href
=
"https://github.com/didi/kafka-manager"
href
=
"https://github.com/didi/kafka-manager"
target
=
"_blank"
target
=
"_blank"
>
>
<
Icon
type
=
"question-circle"
/>
<
Icon
type
=
"question-circle"
/>
</
a
>
</
a
>
</
li
>
</
li
>
{
this
.
renderDatePick
()
}
{
this
.
renderDatePick
()
}
</
ul
>
</
ul
>
{
this
.
renderChart
()
}
{
this
.
renderChart
()
}
</
div
>
</
div
>
</>
</>
);
);
}
}
...
...
kafka-manager-console/src/container/topic/topic-detail/index.tsx
浏览文件 @
00654383
import
*
as
React
from
'
react
'
;
import
*
as
React
from
'
react
'
;
import
'
./index.less
'
;
import
'
./index.less
'
;
import
{
wrapper
,
region
}
from
'
store
'
;
import
{
wrapper
,
region
}
from
'
store
'
;
import
{
Tabs
,
PageHeader
,
Button
,
notification
,
Drawer
,
message
,
Icon
}
from
'
antd
'
;
import
{
Tabs
,
PageHeader
,
Button
,
notification
,
Drawer
,
message
,
Icon
,
Spin
}
from
'
antd
'
;
import
{
observer
}
from
'
mobx-react
'
;
import
{
observer
}
from
'
mobx-react
'
;
import
{
BaseInformation
}
from
'
./base-information
'
;
import
{
BaseInformation
}
from
'
./base-information
'
;
import
{
StatusChart
}
from
'
./status-chart
'
;
import
{
StatusChart
}
from
'
./status-chart
'
;
...
@@ -44,6 +44,7 @@ export class TopicDetail extends React.Component<any> {
...
@@ -44,6 +44,7 @@ export class TopicDetail extends React.Component<any> {
drawerVisible
:
false
,
drawerVisible
:
false
,
infoVisible
:
false
,
infoVisible
:
false
,
infoTopicList
:
[]
as
IInfoData
[],
infoTopicList
:
[]
as
IInfoData
[],
isExecutionBtn
:
false
};
};
private
$formRef
:
any
;
private
$formRef
:
any
;
...
@@ -54,7 +55,7 @@ export class TopicDetail extends React.Component<any> {
...
@@ -54,7 +55,7 @@ export class TopicDetail extends React.Component<any> {
const
url
=
Url
();
const
url
=
Url
();
this
.
clusterId
=
Number
(
url
.
search
.
clusterId
);
this
.
clusterId
=
Number
(
url
.
search
.
clusterId
);
this
.
needAuth
=
url
.
search
.
needAuth
;
this
.
needAuth
=
url
.
search
.
needAuth
;
this
.
clusterName
=
url
.
search
.
clusterName
;
this
.
clusterName
=
decodeURI
(
decodeURI
(
url
.
search
.
clusterName
))
;
this
.
topicName
=
url
.
search
.
topic
;
this
.
topicName
=
url
.
search
.
topic
;
const
isPhysical
=
Url
().
search
.
hasOwnProperty
(
'
isPhysicalClusterId
'
);
const
isPhysical
=
Url
().
search
.
hasOwnProperty
(
'
isPhysicalClusterId
'
);
this
.
isPhysicalTrue
=
isPhysical
?
'
&isPhysicalClusterId=true
'
:
''
;
this
.
isPhysicalTrue
=
isPhysical
?
'
&isPhysicalClusterId=true
'
:
''
;
...
@@ -197,7 +198,9 @@ export class TopicDetail extends React.Component<any> {
...
@@ -197,7 +198,9 @@ export class TopicDetail extends React.Component<any> {
formData
=
{
formData
}
formData
=
{
formData
}
formMap
=
{
formMap
}
formMap
=
{
formMap
}
/>
/>
<
Button
type
=
"primary"
onClick
=
{
this
.
drawerSubmit
}
className
=
"sample-button"
>
采样
</
Button
>
<
Button
type
=
"primary"
onClick
=
{
this
.
drawerSubmit
}
className
=
"sample-button"
disabled
=
{
this
.
state
.
isExecutionBtn
}
>
{
this
.
state
.
isExecutionBtn
?
(<
span
>
采样中
<
Spin
indicator
=
{
this
.
antIcon
}
size
=
"small"
/></
span
>)
:
'
采 样
'
}
</
Button
>
{
infoVisible
?
this
.
renderInfo
()
:
null
}
{
infoVisible
?
this
.
renderInfo
()
:
null
}
</
Drawer
>
</
Drawer
>
</>
</>
...
@@ -243,7 +246,11 @@ export class TopicDetail extends React.Component<any> {
...
@@ -243,7 +246,11 @@ export class TopicDetail extends React.Component<any> {
);
);
}
}
// 执行加载图标
public
antIcon
=
<
Icon
type
=
"loading"
style
=
{
{
fontSize
:
12
,
color
:
'
#cccccc
'
,
marginLeft
:
'
5px
'
}
}
spin
/>
public
drawerSubmit
=
(
value
:
any
)
=>
{
public
drawerSubmit
=
(
value
:
any
)
=>
{
this
.
setState
({
isExecutionBtn
:
true
})
this
.
$formRef
.
validateFields
((
error
:
Error
,
result
:
any
)
=>
{
this
.
$formRef
.
validateFields
((
error
:
Error
,
result
:
any
)
=>
{
if
(
error
)
{
if
(
error
)
{
return
;
return
;
...
@@ -253,9 +260,12 @@ export class TopicDetail extends React.Component<any> {
...
@@ -253,9 +260,12 @@ export class TopicDetail extends React.Component<any> {
this
.
setState
({
this
.
setState
({
infoTopicList
:
data
,
infoTopicList
:
data
,
infoVisible
:
true
,
infoVisible
:
true
,
isExecutionBtn
:
false
});
});
message
.
success
(
'
采样成功
'
);
message
.
success
(
'
采样成功
'
);
});
}).
catch
(
err
=>
{
this
.
setState
({
isExecutionBtn
:
false
})
})
});
});
}
}
...
@@ -315,6 +325,7 @@ export class TopicDetail extends React.Component<any> {
...
@@ -315,6 +325,7 @@ export class TopicDetail extends React.Component<any> {
public
componentDidMount
()
{
public
componentDidMount
()
{
topic
.
getTopicBasicInfo
(
this
.
clusterId
,
this
.
topicName
);
topic
.
getTopicBasicInfo
(
this
.
clusterId
,
this
.
topicName
);
topic
.
getTopicBusiness
(
this
.
clusterId
,
this
.
topicName
);
topic
.
getTopicBusiness
(
this
.
clusterId
,
this
.
topicName
);
app
.
getAppList
();
}
}
public
render
()
{
public
render
()
{
...
@@ -326,7 +337,6 @@ export class TopicDetail extends React.Component<any> {
...
@@ -326,7 +337,6 @@ export class TopicDetail extends React.Component<any> {
topicName
:
this
.
topicName
,
topicName
:
this
.
topicName
,
clusterName
:
this
.
clusterName
clusterName
:
this
.
clusterName
}
as
ITopic
;
}
as
ITopic
;
app
.
getAppList
();
return
(
return
(
<>
<>
...
@@ -342,9 +352,9 @@ export class TopicDetail extends React.Component<any> {
...
@@ -342,9 +352,9 @@ export class TopicDetail extends React.Component<any> {
{
this
.
needAuth
==
"
true
"
&&
<
Button
key
=
"0"
type
=
"primary"
onClick
=
{
()
=>
showAllPermissionModal
(
topicRecord
)
}
>
申请权限
</
Button
>
}
{
this
.
needAuth
==
"
true
"
&&
<
Button
key
=
"0"
type
=
"primary"
onClick
=
{
()
=>
showAllPermissionModal
(
topicRecord
)
}
>
申请权限
</
Button
>
}
<
Button
key
=
"1"
type
=
"primary"
onClick
=
{
()
=>
applyTopicQuotaQuery
(
topicRecord
)
}
>
申请配额
</
Button
>
<
Button
key
=
"1"
type
=
"primary"
onClick
=
{
()
=>
applyTopicQuotaQuery
(
topicRecord
)
}
>
申请配额
</
Button
>
<
Button
key
=
"2"
type
=
"primary"
onClick
=
{
()
=>
applyExpandModal
(
topicRecord
)
}
>
申请分区
</
Button
>
<
Button
key
=
"2"
type
=
"primary"
onClick
=
{
()
=>
applyExpandModal
(
topicRecord
)
}
>
申请分区
</
Button
>
<
Button
key
=
"3"
type
=
"primary"
onClick
=
{
()
=>
this
.
props
.
history
.
push
(
`/alarm/add`
)
}
>
新建告警
规则
</
Button
>
<
Button
key
=
"3"
type
=
"primary"
onClick
=
{
()
=>
this
.
props
.
history
.
push
(
`/alarm/add`
)
}
>
新建告警
</
Button
>
<
Button
key
=
"4"
type
=
"primary"
onClick
=
{
this
.
showDrawer
.
bind
(
this
)
}
>
采样
</
Button
>
<
Button
key
=
"4"
type
=
"primary"
onClick
=
{
this
.
showDrawer
.
bind
(
this
)
}
>
数据
采样
</
Button
>
{
showEditBtn
&&
<
Button
key
=
"5"
onClick
=
{
()
=>
this
.
compileDetails
()
}
type
=
"primary"
>
编辑
</
Button
>
}
{
/* {showEditBtn && <Button key="5" onClick={() => this.compileDetails()} type="primary">编辑</Button>} */
}
</>
</>
}
}
/>
/>
...
...
kafka-manager-console/src/container/topic/topic-mine.tsx
浏览文件 @
00654383
...
@@ -30,7 +30,7 @@ export class MineTopic extends SearchAndFilterContainer {
...
@@ -30,7 +30,7 @@ export class MineTopic extends SearchAndFilterContainer {
if
(
cluster
.
active
!==
-
1
||
app
.
active
!==
'
-1
'
||
searchKey
!==
''
)
{
if
(
cluster
.
active
!==
-
1
||
app
.
active
!==
'
-1
'
||
searchKey
!==
''
)
{
data
=
origin
.
filter
(
d
=>
data
=
origin
.
filter
(
d
=>
((
d
.
topicName
!==
undefined
&&
d
.
topicName
!==
null
)
&&
d
.
topicName
.
toLowerCase
().
includes
(
searchKey
as
string
)
((
d
.
topicName
!==
undefined
&&
d
.
topicName
!==
null
)
&&
d
.
topicName
.
toLowerCase
().
includes
(
searchKey
as
string
)
||
((
d
.
appName
!==
undefined
&&
d
.
appName
!==
null
)
&&
d
.
appName
.
toLowerCase
().
includes
(
searchKey
as
string
)))
||
((
d
.
appName
!==
undefined
&&
d
.
appName
!==
null
)
&&
d
.
appName
.
toLowerCase
().
includes
(
searchKey
as
string
)))
&&
(
cluster
.
active
===
-
1
||
d
.
clusterId
===
cluster
.
active
)
&&
(
cluster
.
active
===
-
1
||
d
.
clusterId
===
cluster
.
active
)
&&
(
app
.
active
===
'
-1
'
||
d
.
appId
===
(
app
.
active
+
''
)),
&&
(
app
.
active
===
'
-1
'
||
d
.
appId
===
(
app
.
active
+
''
)),
);
);
...
@@ -152,18 +152,18 @@ export class MineTopic extends SearchAndFilterContainer {
...
@@ -152,18 +152,18 @@ export class MineTopic extends SearchAndFilterContainer {
public
render
()
{
public
render
()
{
return
(
return
(
<>
<>
<
div
className
=
"min-width"
>
<
div
className
=
"min-width"
>
<
Tabs
activeKey
=
{
location
.
hash
.
substr
(
1
)
||
'
1
'
}
type
=
"card"
onChange
=
{
(
key
)
=>
this
.
handleTabKey
(
key
)
}
>
<
Tabs
activeKey
=
{
location
.
hash
.
substr
(
1
)
||
'
1
'
}
type
=
"card"
onChange
=
{
(
key
)
=>
this
.
handleTabKey
(
key
)
}
>
<
TabPane
tab
=
"有效Topic"
key
=
"1"
>
<
TabPane
tab
=
"有效Topic"
key
=
"1"
>
{
this
.
renderOperationPanel
(
1
)
}
{
this
.
renderOperationPanel
(
1
)
}
{
this
.
renderMyTopicTable
(
this
.
getData
(
topic
.
mytopicData
))
}
{
this
.
renderMyTopicTable
(
this
.
getData
(
topic
.
mytopicData
))
}
</
TabPane
>
</
TabPane
>
<
TabPane
tab
=
"已过期Topic"
key
=
"2"
>
<
TabPane
tab
=
"已过期Topic"
key
=
"2"
>
{
this
.
renderOperationPanel
(
2
)
}
{
this
.
renderOperationPanel
(
2
)
}
{
this
.
renderDeprecatedTopicTable
(
this
.
getData
(
topic
.
expireData
))
}
{
this
.
renderDeprecatedTopicTable
(
this
.
getData
(
topic
.
expireData
))
}
</
TabPane
>
</
TabPane
>
</
Tabs
>
</
Tabs
>
</
div
>
</
div
>
</>
</>
);
);
}
}
...
...
kafka-manager-console/src/container/user-center/my-bill.tsx
浏览文件 @
00654383
...
@@ -79,7 +79,7 @@ export class MyBill extends React.Component {
...
@@ -79,7 +79,7 @@ export class MyBill extends React.Component {
}
}
public
renderTableList
()
{
public
renderTableList
()
{
const
userUrl
=
`
${
urlPrefix
}
/user/bill-detail`
const
userUrl
=
`
${
urlPrefix
}
/user/bill-detail`
return
(
return
(
<
Table
<
Table
rowKey
=
"key"
rowKey
=
"key"
...
@@ -89,11 +89,11 @@ export class MyBill extends React.Component {
...
@@ -89,11 +89,11 @@ export class MyBill extends React.Component {
/>
/>
);
);
}
}
public
renderChart
()
{
public
renderChart
()
{
return
(
return
(
<
div
className
=
"chart-box"
>
<
div
className
=
"chart-box"
>
<
BarChartComponet
ref
=
{
(
ref
)
=>
this
.
chart
=
ref
}
getChartData
=
{
this
.
getData
.
bind
(
this
,
null
)
}
/>
<
BarChartComponet
ref
=
{
(
ref
)
=>
this
.
chart
=
ref
}
getChartData
=
{
this
.
getData
.
bind
(
this
,
null
)
}
/>
</
div
>
</
div
>
);
);
}
}
...
@@ -131,7 +131,7 @@ export class MyBill extends React.Component {
...
@@ -131,7 +131,7 @@ export class MyBill extends React.Component {
<>
<>
<
div
className
=
"container"
>
<
div
className
=
"container"
>
<
Tabs
defaultActiveKey
=
"1"
type
=
"card"
>
<
Tabs
defaultActiveKey
=
"1"
type
=
"card"
>
<
TabPane
<
TabPane
tab
=
{
<>
tab
=
{
<>
<
span
>
账单趋势
</
span
>
<
span
>
账单趋势
</
span
>
<
a
<
a
...
@@ -141,7 +141,7 @@ export class MyBill extends React.Component {
...
@@ -141,7 +141,7 @@ export class MyBill extends React.Component {
>
>
<
Icon
type
=
"question-circle"
/>
<
Icon
type
=
"question-circle"
/>
</
a
>
</
a
>
</>
}
</>
}
key
=
"1"
key
=
"1"
>
>
{
this
.
renderDatePick
()
}
{
this
.
renderDatePick
()
}
...
...
kafka-manager-console/src/lib/fetch.ts
浏览文件 @
00654383
...
@@ -33,6 +33,7 @@ const checkStatus = (res: Response) => {
...
@@ -33,6 +33,7 @@ const checkStatus = (res: Response) => {
};
};
const
filter
=
(
init
:
IInit
)
=>
(
res
:
IRes
)
=>
{
const
filter
=
(
init
:
IInit
)
=>
(
res
:
IRes
)
=>
{
if
(
res
.
code
!==
0
&&
res
.
code
!==
200
)
{
if
(
res
.
code
!==
0
&&
res
.
code
!==
200
)
{
if
(
!
init
.
errorNoTips
)
{
if
(
!
init
.
errorNoTips
)
{
notification
.
error
({
notification
.
error
({
...
...
kafka-manager-console/src/store/alarm.ts
浏览文件 @
00654383
...
@@ -96,7 +96,8 @@ class Alarm {
...
@@ -96,7 +96,8 @@ class Alarm {
@
action
.
bound
@
action
.
bound
public
setMonitorType
(
data
:
IMonitorMetricType
)
{
public
setMonitorType
(
data
:
IMonitorMetricType
)
{
this
.
monitorTypeList
=
data
.
metricNames
||
[];
this
.
monitorTypeList
=
data
.
metricNames
||
[];
this
.
monitorType
=
this
.
monitorTypeList
[
0
].
metricName
;
// this.monitorType = this.monitorTypeList[0].metricName;
this
.
monitorType
=
''
;
}
}
@
action
.
bound
@
action
.
bound
...
...
kafka-manager-console/src/store/cluster.ts
浏览文件 @
00654383
...
@@ -21,7 +21,7 @@ class Cluster {
...
@@ -21,7 +21,7 @@ class Cluster {
public
selectData
:
IClusterData
[]
=
[{
public
selectData
:
IClusterData
[]
=
[{
value
:
-
1
,
value
:
-
1
,
label
:
'
所有集群
'
,
label
:
'
所有集群
'
,
}
as
IClusterData
,
}
as
IClusterData
,
];
];
@
observable
@
observable
...
@@ -31,7 +31,7 @@ class Cluster {
...
@@ -31,7 +31,7 @@ class Cluster {
public
selectAllData
:
IClusterData
[]
=
[{
public
selectAllData
:
IClusterData
[]
=
[{
value
:
-
1
,
value
:
-
1
,
label
:
'
所有集群
'
,
label
:
'
所有集群
'
,
}
as
IClusterData
,
}
as
IClusterData
,
];
];
@
observable
@
observable
...
@@ -59,7 +59,7 @@ class Cluster {
...
@@ -59,7 +59,7 @@ class Cluster {
public
clusterMetrics
:
IClusterMetrics
[]
=
[];
public
clusterMetrics
:
IClusterMetrics
[]
=
[];
@
observable
@
observable
public
type
:
IOptionType
=
'
byteIn/byteOut
'
;
public
type
:
IOptionType
=
'
byteIn/byteOut
'
;
@
observable
@
observable
public
clusterTopics
:
IClusterTopics
[]
=
[];
public
clusterTopics
:
IClusterTopics
[]
=
[];
...
@@ -130,11 +130,11 @@ class Cluster {
...
@@ -130,11 +130,11 @@ class Cluster {
public
setClusterCombos
(
data
:
IConfigInfo
[])
{
public
setClusterCombos
(
data
:
IConfigInfo
[])
{
this
.
clusterComboList
=
data
||
[];
this
.
clusterComboList
=
data
||
[];
this
.
clusterComboList
=
this
.
clusterComboList
.
map
(
item
=>
{
this
.
clusterComboList
=
this
.
clusterComboList
.
map
(
item
=>
{
return
{
return
{
...
item
,
...
item
,
label
:
item
.
message
,
label
:
item
.
message
,
value
:
item
.
code
,
value
:
item
.
code
,
};
};
});
});
}
}
...
@@ -148,7 +148,7 @@ class Cluster {
...
@@ -148,7 +148,7 @@ class Cluster {
value
:
item
.
code
,
value
:
item
.
code
,
};
};
});
});
this
.
clusterMode
=
(
this
.
clusterModes
&&
this
.
clusterModes
.
filter
(
ele
=>
ele
.
code
!==
0
)
)
||
[];
// 去除 0 共享集群
this
.
clusterMode
=
(
this
.
clusterModes
&&
this
.
clusterModes
.
filter
(
ele
=>
ele
.
code
!==
0
))
||
[];
// 去除 0 共享集群
}
}
@
action
.
bound
@
action
.
bound
...
@@ -158,7 +158,7 @@ class Cluster {
...
@@ -158,7 +158,7 @@ class Cluster {
@
action
.
bound
@
action
.
bound
public
setClusterDetailRealTime
(
data
:
IClusterReal
)
{
public
setClusterDetailRealTime
(
data
:
IClusterReal
)
{
this
.
clusterRealData
=
data
;
this
.
clusterRealData
=
data
;
this
.
setRealLoading
(
false
);
this
.
setRealLoading
(
false
);
}
}
...
@@ -192,9 +192,9 @@ class Cluster {
...
@@ -192,9 +192,9 @@ class Cluster {
@
action
.
bound
@
action
.
bound
public
setClusterDetailThrottles
(
data
:
IThrottles
[])
{
public
setClusterDetailThrottles
(
data
:
IThrottles
[])
{
this
.
clustersThrottles
=
data
?
data
.
map
((
item
,
index
)
=>
{
this
.
clustersThrottles
=
data
?
data
.
map
((
item
,
index
)
=>
{
item
.
key
=
index
;
item
.
key
=
index
;
return
item
;
return
item
;
})
:
[];
})
:
[];
}
}
@
action
.
bound
@
action
.
bound
...
...
kafka-manager-console/src/types/alarm.ts
浏览文件 @
00654383
...
@@ -19,6 +19,7 @@ export interface IStrategyFilter {
...
@@ -19,6 +19,7 @@ export interface IStrategyFilter {
tkey
:
string
;
tkey
:
string
;
topt
:
string
;
topt
:
string
;
tval
:
string
[];
tval
:
string
[];
clusterIdentification
?:
string
;
}
}
export
interface
IRequestParams
{
export
interface
IRequestParams
{
appId
:
string
;
appId
:
string
;
...
...
kafka-manager-console/src/types/base-type.ts
浏览文件 @
00654383
...
@@ -23,6 +23,7 @@ export interface IBtn {
...
@@ -23,6 +23,7 @@ export interface IBtn {
}
}
export
interface
IClusterData
{
export
interface
IClusterData
{
clusterIdentification
:
any
;
clusterId
:
number
;
clusterId
:
number
;
mode
:
number
;
mode
:
number
;
clusterName
:
string
;
clusterName
:
string
;
...
@@ -598,10 +599,12 @@ export interface IClusterReal {
...
@@ -598,10 +599,12 @@ export interface IClusterReal {
}
}
export
interface
IBasicInfo
{
export
interface
IBasicInfo
{
clusterIdentification
:
any
;
bootstrapServers
:
string
;
bootstrapServers
:
string
;
clusterId
:
number
;
clusterId
:
number
;
mode
:
number
;
mode
:
number
;
clusterName
:
string
;
clusterName
:
string
;
clusterNameCn
:
string
;
clusterVersion
:
string
;
clusterVersion
:
string
;
gmtCreate
:
number
;
gmtCreate
:
number
;
gmtModify
:
number
;
gmtModify
:
number
;
...
@@ -920,8 +923,9 @@ export interface INewLogical {
...
@@ -920,8 +923,9 @@ export interface INewLogical {
mode
:
number
;
mode
:
number
;
name
:
string
;
name
:
string
;
logicalClusterName
?:
string
;
logicalClusterName
?:
string
;
logicalCluster
EName
?:
string
;
logicalCluster
NameCn
?:
string
;
regionIdList
:
number
[];
regionIdList
:
number
[];
logicalClusterIdentification
?:
string
}
}
export
interface
IPartitionsLocation
{
export
interface
IPartitionsLocation
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录