mirror of
https://github.com/didi/KnowStreaming.git
synced 2025-12-24 11:52:08 +08:00
@@ -30,7 +30,7 @@ public class HttpUtils {
|
|||||||
private static int CONNECT_TIME_OUT = 15000;
|
private static int CONNECT_TIME_OUT = 15000;
|
||||||
|
|
||||||
// 读取超时时间, 单位: ms
|
// 读取超时时间, 单位: ms
|
||||||
private static int READ_TIME_OUT = 2000;
|
private static int READ_TIME_OUT = 3000;
|
||||||
|
|
||||||
private static final String METHOD_GET = "GET";
|
private static final String METHOD_GET = "GET";
|
||||||
private static final String METHOD_POST = "POST";
|
private static final String METHOD_POST = "POST";
|
||||||
|
|||||||
@@ -134,19 +134,19 @@ export class ClusterList extends SearchAndFilterContainer {
|
|||||||
formData: item ? item : {},
|
formData: item ? item : {},
|
||||||
visible: true,
|
visible: true,
|
||||||
width: 590,
|
width: 590,
|
||||||
title: '注册集群',
|
title: item ? '编辑' : '接入集群',
|
||||||
onSubmit: (value: IRegister) => {
|
onSubmit: (value: IRegister) => {
|
||||||
value.idc = region.currentRegion;
|
value.idc = region.currentRegion;
|
||||||
if (item) {
|
if (item) {
|
||||||
value.clusterId = item.clusterId;
|
value.clusterId = item.clusterId;
|
||||||
registerCluster(value).then(data => {
|
registerCluster(value).then(data => {
|
||||||
admin.getMetaData(true);
|
admin.getMetaData(true);
|
||||||
notification.success({ message: '修改集群成功' });
|
notification.success({ message: '编辑集群成功' });
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
createCluster(value).then(data => {
|
createCluster(value).then(data => {
|
||||||
admin.getMetaData(true);
|
admin.getMetaData(true);
|
||||||
notification.success({ message: '注册集群成功' });
|
notification.success({ message: '接入集群成功' });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -256,7 +256,7 @@ export class ClusterList extends SearchAndFilterContainer {
|
|||||||
<a
|
<a
|
||||||
onClick={this.createOrRegisterCluster.bind(this, item)}
|
onClick={this.createOrRegisterCluster.bind(this, item)}
|
||||||
className="action-button"
|
className="action-button"
|
||||||
>修改
|
>编辑
|
||||||
</a>
|
</a>
|
||||||
<Popconfirm
|
<Popconfirm
|
||||||
title={`确定${item.status === 1 ? '暂停' : '开始'}${item.clusterName}监控?`}
|
title={`确定${item.status === 1 ? '暂停' : '开始'}${item.clusterName}监控?`}
|
||||||
@@ -286,7 +286,7 @@ export class ClusterList extends SearchAndFilterContainer {
|
|||||||
<ul>
|
<ul>
|
||||||
{this.renderSearch('', '请输入集群名称')}
|
{this.renderSearch('', '请输入集群名称')}
|
||||||
<li className="right-btn-1">
|
<li className="right-btn-1">
|
||||||
<Button type="primary" onClick={this.createOrRegisterCluster.bind(this, null)}>注册集群</Button>
|
<Button type="primary" onClick={this.createOrRegisterCluster.bind(this, null)}>接入集群</Button>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export const getUserColumns = () => {
|
|||||||
render: (text: string, record: IUser) => {
|
render: (text: string, record: IUser) => {
|
||||||
return (
|
return (
|
||||||
<span className="table-operation">
|
<span className="table-operation">
|
||||||
<a onClick={() => showApplyModal(record)}>修改</a>
|
<a onClick={() => showApplyModal(record)}>编辑</a>
|
||||||
<Popconfirm
|
<Popconfirm
|
||||||
title="确定删除?"
|
title="确定删除?"
|
||||||
onConfirm={() => users.deleteUser(record.username)}
|
onConfirm={() => users.deleteUser(record.username)}
|
||||||
@@ -105,7 +105,7 @@ export const getVersionColumns = () => {
|
|||||||
render: (text: string, record: IUploadFile) => {
|
render: (text: string, record: IUploadFile) => {
|
||||||
return (
|
return (
|
||||||
<span className="table-operation">
|
<span className="table-operation">
|
||||||
<a onClick={() => showModifyModal(record)}>修改</a>
|
<a onClick={() => showModifyModal(record)}>编辑</a>
|
||||||
<Popconfirm
|
<Popconfirm
|
||||||
title="确定删除?"
|
title="确定删除?"
|
||||||
onConfirm={() => version.deleteFile(record.id)}
|
onConfirm={() => version.deleteFile(record.id)}
|
||||||
@@ -164,7 +164,7 @@ export const getConfigureColumns = () => {
|
|||||||
render: (text: string, record: IConfigure) => {
|
render: (text: string, record: IConfigure) => {
|
||||||
return (
|
return (
|
||||||
<span className="table-operation">
|
<span className="table-operation">
|
||||||
<a onClick={() => showConfigureModal(record)}>修改</a>
|
<a onClick={() => showConfigureModal(record)}>编辑</a>
|
||||||
<Popconfirm
|
<Popconfirm
|
||||||
title="确定删除?"
|
title="确定删除?"
|
||||||
onConfirm={() => admin.deleteConfigure(record.configKey)}
|
onConfirm={() => admin.deleteConfigure(record.configKey)}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ export const migrationTaskColumns = (migrationUrl: string) => {
|
|||||||
<a style={{ marginRight: 16 }}>开始</a>
|
<a style={{ marginRight: 16 }}>开始</a>
|
||||||
</Popconfirm>}
|
</Popconfirm>}
|
||||||
{[0, 1].indexOf(item.status) > -1 &&
|
{[0, 1].indexOf(item.status) > -1 &&
|
||||||
<a onClick={() => modifyMigrationTask(item, 'modify')} style={{ marginRight: 16 }}>修改</a>}
|
<a onClick={() => modifyMigrationTask(item, 'modify')} style={{ marginRight: 16 }}>编辑</a>}
|
||||||
{item.status === 0 &&
|
{item.status === 0 &&
|
||||||
<Popconfirm
|
<Popconfirm
|
||||||
title="确定取消?"
|
title="确定取消?"
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ export class MigrationDetail extends SearchAndFilterContainer {
|
|||||||
render: (text: string, item: IReassign) => (
|
render: (text: string, item: IReassign) => (
|
||||||
<>
|
<>
|
||||||
<a onClick={() => this.renderRessignDetail(item)} style={{ marginRight: 16 }}>详情</a>
|
<a onClick={() => this.renderRessignDetail(item)} style={{ marginRight: 16 }}>详情</a>
|
||||||
<a onClick={() => modifyTransferTask(item, 'modify', this.taskId)}>修改</a>
|
<a onClick={() => modifyTransferTask(item, 'modify', this.taskId)}>编辑</a>
|
||||||
</>
|
</>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ export class AlarmSelect extends React.Component<IAlarmSelectProps> {
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
href="https://github.com/didi/kafka-manager"
|
href="https://github.com/didi/kafka-manager"
|
||||||
>
|
>
|
||||||
新建告警组?
|
新增规则组?
|
||||||
</a>
|
</a>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import { region } from 'store/region';
|
|||||||
export const getAlarmColumns = (urlPrefix: string) => {
|
export const getAlarmColumns = (urlPrefix: string) => {
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
title: '告警名称',
|
title: '告警规则',
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
key: 'name',
|
key: 'name',
|
||||||
width: '25%',
|
width: '25%',
|
||||||
@@ -32,7 +32,7 @@ export const getAlarmColumns = (urlPrefix: string) => {
|
|||||||
</Tooltip>);
|
</Tooltip>);
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
title: '应用名称',
|
title: '所属应用',
|
||||||
dataIndex: 'appName',
|
dataIndex: 'appName',
|
||||||
key: 'appName',
|
key: 'appName',
|
||||||
width: '25%',
|
width: '25%',
|
||||||
@@ -72,7 +72,7 @@ export const getAlarmColumns = (urlPrefix: string) => {
|
|||||||
width: '10%',
|
width: '10%',
|
||||||
render: (text: string, item: IMonitorStrategies) => (
|
render: (text: string, item: IMonitorStrategies) => (
|
||||||
<>
|
<>
|
||||||
<a href={`${urlPrefix}/alarm/modify?id=${item.id}`} className="action-button">修改</a>
|
<a href={`${urlPrefix}/alarm/modify?id=${item.id}`} className="action-button">编辑</a>
|
||||||
<Popconfirm
|
<Popconfirm
|
||||||
title="确定删除?"
|
title="确定删除?"
|
||||||
onConfirm={() => deteleMonitor(item)}
|
onConfirm={() => deteleMonitor(item)}
|
||||||
@@ -205,8 +205,8 @@ export const xActionFormMap = [{
|
|||||||
|
|
||||||
export const xTypeFormMap = [{
|
export const xTypeFormMap = [{
|
||||||
key: 'alarmName',
|
key: 'alarmName',
|
||||||
label: '告警名称',
|
label: '告警规则',
|
||||||
rules: [{ required: true, message: '请输入告警名称' }],
|
rules: [{ required: true, message: '请输入告警规则' }],
|
||||||
attrs: {placeholder: '请输入', disabled: isDetailPage},
|
attrs: {placeholder: '请输入', disabled: isDetailPage},
|
||||||
}, {
|
}, {
|
||||||
key: 'app',
|
key: 'app',
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ export class AddAlarm extends SearchAndFilterContainer {
|
|||||||
<PageHeader
|
<PageHeader
|
||||||
className={this.isDetailPage ? 'is-show' : 'btn-group'}
|
className={this.isDetailPage ? 'is-show' : 'btn-group'}
|
||||||
onBack={() => handlePageBack('/alarm')}
|
onBack={() => handlePageBack('/alarm')}
|
||||||
title={(this.id || this.id === 0) ? '修改告警配置' : '新建告警配置'}
|
title={(this.id || this.id === 0) ? '编辑告警规则' : '新建告警规则'}
|
||||||
extra={[
|
extra={[
|
||||||
<Button key="1" type="primary" onClick={() => this.handleSubmit()}>提交</Button>,
|
<Button key="1" type="primary" onClick={() => this.handleSubmit()}>提交</Button>,
|
||||||
<Button key="2" onClick={() => this.handleResetForm(this.id)}>重置</Button>,
|
<Button key="2" onClick={() => this.handleResetForm(this.id)}>重置</Button>,
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export class ShieldHistory extends React.Component {
|
|||||||
title: '详情',
|
title: '详情',
|
||||||
content: (
|
content: (
|
||||||
<ul className="monitor-detail">
|
<ul className="monitor-detail">
|
||||||
<li><b>告警名称:</b>{record.monitorName}</li>
|
<li><b>告警规则:</b>{record.monitorName}</li>
|
||||||
<li><b>开始时间:</b>{moment(record.startTime).format(timeFormat)}</li>
|
<li><b>开始时间:</b>{moment(record.startTime).format(timeFormat)}</li>
|
||||||
<li><b>结束时间:</b>{moment(record.endTime).format(timeFormat)}</li>
|
<li><b>结束时间:</b>{moment(record.endTime).format(timeFormat)}</li>
|
||||||
<li><b>说明:</b>{record.description}</li>
|
<li><b>说明:</b>{record.description}</li>
|
||||||
@@ -48,10 +48,10 @@ export class ShieldHistory extends React.Component {
|
|||||||
formMap: [
|
formMap: [
|
||||||
{
|
{
|
||||||
key: 'monitorName',
|
key: 'monitorName',
|
||||||
label: '告警名称',
|
label: '告警规则',
|
||||||
rules: [{
|
rules: [{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入告警名称',
|
message: '请输入告警规则',
|
||||||
}],
|
}],
|
||||||
attrs: {
|
attrs: {
|
||||||
disabled: true,
|
disabled: true,
|
||||||
@@ -112,7 +112,7 @@ export class ShieldHistory extends React.Component {
|
|||||||
monitorId: record.monitorId,
|
monitorId: record.monitorId,
|
||||||
} as IMonitorSilences;
|
} as IMonitorSilences;
|
||||||
alarm.modifyMask(params, this.id).then(data => {
|
alarm.modifyMask(params, this.id).then(data => {
|
||||||
notification.success({ message: '修改成功' });
|
notification.success({ message: '编辑成功' });
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -158,7 +158,7 @@ export class ShieldHistory extends React.Component {
|
|||||||
render: (action: any, record: IMonitorSilences) => {
|
render: (action: any, record: IMonitorSilences) => {
|
||||||
return(
|
return(
|
||||||
<>
|
<>
|
||||||
<a onClick={() => this.modifyMonitor(record)} className="action-button">修改</a>
|
<a onClick={() => this.modifyMonitor(record)} className="action-button">编辑</a>
|
||||||
<a onClick={() => this.silencesDetail(record)} className="action-button">详情</a>
|
<a onClick={() => this.silencesDetail(record)} className="action-button">详情</a>
|
||||||
<Popconfirm
|
<Popconfirm
|
||||||
title="确定删除?"
|
title="确定删除?"
|
||||||
|
|||||||
@@ -52,11 +52,11 @@ export class AlarmList extends SearchAndFilterContainer {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{this.renderApp('应用:')}
|
{this.renderApp('应用:')}
|
||||||
{this.renderSearch('名称:', '请输入告警名称或者操作人')}
|
{this.renderSearch('名称:', '请输入告警规则或者操作人')}
|
||||||
<li className="right-btn-1">
|
<li className="right-btn-1">
|
||||||
<Button type="primary">
|
<Button type="primary">
|
||||||
<a href={`${urlPrefix}/alarm/add`}>
|
<a href={`${urlPrefix}/alarm/add`}>
|
||||||
新建告警
|
新增规则
|
||||||
</a>
|
</a>
|
||||||
</Button>
|
</Button>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ export class CommonAppList extends SearchAndFilterContainer {
|
|||||||
render: (text: any, record: IAppItem) => {
|
render: (text: any, record: IAppItem) => {
|
||||||
return (
|
return (
|
||||||
<span className="table-operation">
|
<span className="table-operation">
|
||||||
<a onClick={() => showEditModal(record, this.from)}>修改</a>
|
<a onClick={() => showEditModal(record, this.from)}>编辑</a>
|
||||||
<a onClick={() => showEditModal(record, this.from, true)}>详情</a>
|
<a onClick={() => showEditModal(record, this.from, true)}>详情</a>
|
||||||
<a onClick={() => this.getOnlineConnect(record)}>申请下线</a>
|
<a onClick={() => this.getOnlineConnect(record)}>申请下线</a>
|
||||||
</span>);
|
</span>);
|
||||||
|
|||||||
@@ -25,9 +25,10 @@ export const showEditClusterTopic = (item: IClusterTopics) => {
|
|||||||
label: '应用ID',
|
label: '应用ID',
|
||||||
rules: [{
|
rules: [{
|
||||||
required: true,
|
required: true,
|
||||||
|
message: '请输入应用ID',
|
||||||
}],
|
}],
|
||||||
attrs: {
|
attrs: {
|
||||||
disabled: true,
|
placeholder: '请输入应用ID',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ export const modifyTransferTask = (item: IReassign, action: string, taskId: numb
|
|||||||
minThrottle: transBToMB(item.minThrottle),
|
minThrottle: transBToMB(item.minThrottle),
|
||||||
},
|
},
|
||||||
visible: true,
|
visible: true,
|
||||||
title: '修改',
|
title: '编辑',
|
||||||
onSubmit: (value: IExecute) => {
|
onSubmit: (value: IExecute) => {
|
||||||
const params = {
|
const params = {
|
||||||
action,
|
action,
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export const showApplyModal = (record?: IUser) => {
|
|||||||
],
|
],
|
||||||
formData: record || {},
|
formData: record || {},
|
||||||
visible: true,
|
visible: true,
|
||||||
title: record ? '修改用户信息' : '新增用户',
|
title: record ? '修改用户' : '新增用户',
|
||||||
onSubmit: (value: IUser) => {
|
onSubmit: (value: IUser) => {
|
||||||
if (record) {
|
if (record) {
|
||||||
return users.modfiyUser(value).then(() => {
|
return users.modfiyUser(value).then(() => {
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ export const showModifyModal = (record: IUploadFile) => {
|
|||||||
formData: record || {},
|
formData: record || {},
|
||||||
visible: true,
|
visible: true,
|
||||||
isWaitting: true,
|
isWaitting: true,
|
||||||
title: '修改',
|
title: '编辑',
|
||||||
onSubmit: async (value: IUploadFile) => {
|
onSubmit: async (value: IUploadFile) => {
|
||||||
value.file = value.uploadFile[0].originFileObj;
|
value.file = value.uploadFile[0].originFileObj;
|
||||||
const md5 = await computeChecksumMd5(value.file);
|
const md5 = await computeChecksumMd5(value.file);
|
||||||
@@ -175,11 +175,11 @@ export const showConfigureModal = (record?: IConfigure) => {
|
|||||||
formData: record || {},
|
formData: record || {},
|
||||||
visible: true,
|
visible: true,
|
||||||
isWaitting: true,
|
isWaitting: true,
|
||||||
title: `${record ? '修改配置' : '新建配置'}`,
|
title: `${record ? '编辑配置' : '新建配置'}`,
|
||||||
onSubmit: async (value: IConfigure) => {
|
onSubmit: async (value: IConfigure) => {
|
||||||
if (record) {
|
if (record) {
|
||||||
return admin.editConfigure(value).then(data => {
|
return admin.editConfigure(value).then(data => {
|
||||||
notification.success({ message: '修改配置成功' });
|
notification.success({ message: '编辑配置成功' });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return admin.addNewConfigure(value).then(data => {
|
return admin.addNewConfigure(value).then(data => {
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ export const createMonitorSilences = (monitorId: number, monitorName: string) =
|
|||||||
formMap: [
|
formMap: [
|
||||||
{
|
{
|
||||||
key: 'monitorName',
|
key: 'monitorName',
|
||||||
label: '告警名称',
|
label: '告警规则',
|
||||||
rules: [{
|
rules: [{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入告警名称',
|
message: '请输入告警规则',
|
||||||
}],
|
}],
|
||||||
attrs: {
|
attrs: {
|
||||||
disabled: true,
|
disabled: true,
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ export const showEditModal = (record?: IAppItem, from?: string, isDisabled?: boo
|
|||||||
],
|
],
|
||||||
formData: record,
|
formData: record,
|
||||||
visible: true,
|
visible: true,
|
||||||
title: `${isDisabled ? '详情' : record ? '修改' : '应用申请'}`,
|
title: `${isDisabled ? '详情' : record ? '编辑' : '应用申请'}`,
|
||||||
onSubmit: (value: IAppItem) => {
|
onSubmit: (value: IAppItem) => {
|
||||||
if (isDisabled) {
|
if (isDisabled) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiaojukeji.kafka</groupId>
|
<groupId>com.xiaojukeji.kafka</groupId>
|
||||||
<artifactId>kafka-manager-dao</artifactId>
|
<artifactId>kafka-manager-dao</artifactId>
|
||||||
<version>${parent.version}</version>
|
<version>${project.parent.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- spring -->
|
<!-- spring -->
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiaojukeji.kafka</groupId>
|
<groupId>com.xiaojukeji.kafka</groupId>
|
||||||
<artifactId>kafka-manager-common</artifactId>
|
<artifactId>kafka-manager-common</artifactId>
|
||||||
<version>${parent.version}</version>
|
<version>${project.parent.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -18,17 +18,17 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiaojukeji.kafka</groupId>
|
<groupId>com.xiaojukeji.kafka</groupId>
|
||||||
<artifactId>kafka-manager-common</artifactId>
|
<artifactId>kafka-manager-common</artifactId>
|
||||||
<version>${parent.version}</version>
|
<version>${project.parent.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiaojukeji.kafka</groupId>
|
<groupId>com.xiaojukeji.kafka</groupId>
|
||||||
<artifactId>kafka-manager-dao</artifactId>
|
<artifactId>kafka-manager-dao</artifactId>
|
||||||
<version>${parent.version}</version>
|
<version>${project.parent.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiaojukeji.kafka</groupId>
|
<groupId>com.xiaojukeji.kafka</groupId>
|
||||||
<artifactId>kafka-manager-core</artifactId>
|
<artifactId>kafka-manager-core</artifactId>
|
||||||
<version>${parent.version}</version>
|
<version>${project.parent.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -18,22 +18,22 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiaojukeji.kafka</groupId>
|
<groupId>com.xiaojukeji.kafka</groupId>
|
||||||
<artifactId>kafka-manager-common</artifactId>
|
<artifactId>kafka-manager-common</artifactId>
|
||||||
<version>${parent.version}</version>
|
<version>${project.parent.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiaojukeji.kafka</groupId>
|
<groupId>com.xiaojukeji.kafka</groupId>
|
||||||
<artifactId>kafka-manager-dao</artifactId>
|
<artifactId>kafka-manager-dao</artifactId>
|
||||||
<version>${parent.version}</version>
|
<version>${project.parent.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiaojukeji.kafka</groupId>
|
<groupId>com.xiaojukeji.kafka</groupId>
|
||||||
<artifactId>kafka-manager-core</artifactId>
|
<artifactId>kafka-manager-core</artifactId>
|
||||||
<version>${parent.version}</version>
|
<version>${project.parent.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiaojukeji.kafka</groupId>
|
<groupId>com.xiaojukeji.kafka</groupId>
|
||||||
<artifactId>kafka-manager-account</artifactId>
|
<artifactId>kafka-manager-account</artifactId>
|
||||||
<version>${parent.version}</version>
|
<version>${project.parent.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
@@ -35,12 +35,12 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiaojukeji.kafka</groupId>
|
<groupId>com.xiaojukeji.kafka</groupId>
|
||||||
<artifactId>kafka-manager-dao</artifactId>
|
<artifactId>kafka-manager-dao</artifactId>
|
||||||
<version>${parent.version}</version>
|
<version>${project.parent.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiaojukeji.kafka</groupId>
|
<groupId>com.xiaojukeji.kafka</groupId>
|
||||||
<artifactId>kafka-manager-common</artifactId>
|
<artifactId>kafka-manager-common</artifactId>
|
||||||
<version>${parent.version}</version>
|
<version>${project.parent.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiaojukeji.kafka</groupId>
|
<groupId>com.xiaojukeji.kafka</groupId>
|
||||||
<artifactId>kafka-manager-dao</artifactId>
|
<artifactId>kafka-manager-dao</artifactId>
|
||||||
<version>${parent.version}</version>
|
<version>${project.parent.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -35,12 +35,12 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiaojukeji.kafka</groupId>
|
<groupId>com.xiaojukeji.kafka</groupId>
|
||||||
<artifactId>kafka-manager-core</artifactId>
|
<artifactId>kafka-manager-core</artifactId>
|
||||||
<version>${parent.version}</version>
|
<version>${project.parent.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiaojukeji.kafka</groupId>
|
<groupId>com.xiaojukeji.kafka</groupId>
|
||||||
<artifactId>kafka-manager-bpm</artifactId>
|
<artifactId>kafka-manager-bpm</artifactId>
|
||||||
<version>${parent.version}</version>
|
<version>${project.parent.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -31,12 +31,12 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiaojukeji.kafka</groupId>
|
<groupId>com.xiaojukeji.kafka</groupId>
|
||||||
<artifactId>kafka-manager-core</artifactId>
|
<artifactId>kafka-manager-core</artifactId>
|
||||||
<version>${parent.version}</version>
|
<version>${project.parent.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiaojukeji.kafka</groupId>
|
<groupId>com.xiaojukeji.kafka</groupId>
|
||||||
<artifactId>kafka-manager-kcm</artifactId>
|
<artifactId>kafka-manager-kcm</artifactId>
|
||||||
<version>${parent.version}</version>
|
<version>${project.parent.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiaojukeji.kafka</groupId>
|
<groupId>com.xiaojukeji.kafka</groupId>
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiaojukeji.kafka</groupId>
|
<groupId>com.xiaojukeji.kafka</groupId>
|
||||||
<artifactId>kafka-manager-bpm</artifactId>
|
<artifactId>kafka-manager-bpm</artifactId>
|
||||||
<version>${parent.version}</version>
|
<version>${project.parent.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -19,28 +19,29 @@
|
|||||||
<springframework.boot.version>2.1.1.RELEASE</springframework.boot.version>
|
<springframework.boot.version>2.1.1.RELEASE</springframework.boot.version>
|
||||||
<spring-version>5.1.3.RELEASE</spring-version>
|
<spring-version>5.1.3.RELEASE</spring-version>
|
||||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||||
|
<tomcat.version>8.5.37</tomcat.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiaojukeji.kafka</groupId>
|
<groupId>com.xiaojukeji.kafka</groupId>
|
||||||
<artifactId>kafka-manager-core</artifactId>
|
<artifactId>kafka-manager-core</artifactId>
|
||||||
<version>${parent.version}</version>
|
<version>${project.parent.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiaojukeji.kafka</groupId>
|
<groupId>com.xiaojukeji.kafka</groupId>
|
||||||
<artifactId>kafka-manager-kcm</artifactId>
|
<artifactId>kafka-manager-kcm</artifactId>
|
||||||
<version>${parent.version}</version>
|
<version>${project.parent.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiaojukeji.kafka</groupId>
|
<groupId>com.xiaojukeji.kafka</groupId>
|
||||||
<artifactId>kafka-manager-task</artifactId>
|
<artifactId>kafka-manager-task</artifactId>
|
||||||
<version>${parent.version}</version>
|
<version>${project.parent.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiaojukeji.kafka</groupId>
|
<groupId>com.xiaojukeji.kafka</groupId>
|
||||||
<artifactId>kafka-manager-monitor</artifactId>
|
<artifactId>kafka-manager-monitor</artifactId>
|
||||||
<version>${parent.version}</version>
|
<version>${project.parent.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiaojukeji.kafka</groupId>
|
<groupId>com.xiaojukeji.kafka</groupId>
|
||||||
|
|||||||
@@ -60,6 +60,9 @@ public class GatewayServiceDiscoveryController {
|
|||||||
if (ValidateUtils.isNull(config) || ValidateUtils.isNull(config.getClusterIdBootstrapServersMap())) {
|
if (ValidateUtils.isNull(config) || ValidateUtils.isNull(config.getClusterIdBootstrapServersMap())) {
|
||||||
return Result.buildFailure("call init kafka bootstrap servers failed");
|
return Result.buildFailure("call init kafka bootstrap servers failed");
|
||||||
}
|
}
|
||||||
|
if (ValidateUtils.isEmptyMap(config.getClusterIdBootstrapServersMap())) {
|
||||||
|
return Result.buildSuc();
|
||||||
|
}
|
||||||
return Result.buildSuc(JSON.toJSONString(config.getClusterIdBootstrapServersMap()));
|
return Result.buildSuc(JSON.toJSONString(config.getClusterIdBootstrapServersMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,7 +76,9 @@ public class GatewayServiceDiscoveryController {
|
|||||||
if (ValidateUtils.isNull(config) || ValidateUtils.isNull(config.getClusterIdBootstrapServersMap())) {
|
if (ValidateUtils.isNull(config) || ValidateUtils.isNull(config.getClusterIdBootstrapServersMap())) {
|
||||||
return Result.buildFailure("call update kafka bootstrap servers failed");
|
return Result.buildFailure("call update kafka bootstrap servers failed");
|
||||||
}
|
}
|
||||||
|
if (ValidateUtils.isEmptyMap(config.getClusterIdBootstrapServersMap())) {
|
||||||
|
return Result.buildSuc();
|
||||||
|
}
|
||||||
return Result.buildSuc(JSON.toJSONString(new GatewayConfigVO(
|
return Result.buildSuc(JSON.toJSONString(new GatewayConfigVO(
|
||||||
String.valueOf(config.getVersion()),
|
String.valueOf(config.getVersion()),
|
||||||
JSON.toJSONString(config.getClusterIdBootstrapServersMap())
|
JSON.toJSONString(config.getClusterIdBootstrapServersMap())
|
||||||
@@ -89,7 +94,9 @@ public class GatewayServiceDiscoveryController {
|
|||||||
if (ValidateUtils.isNull(config)) {
|
if (ValidateUtils.isNull(config)) {
|
||||||
return Result.buildFailure("call get request queue size config failed");
|
return Result.buildFailure("call get request queue size config failed");
|
||||||
}
|
}
|
||||||
|
if (ValidateUtils.isNull(config.getMaxRequestQueueSize())) {
|
||||||
|
return Result.buildSuc();
|
||||||
|
}
|
||||||
return Result.buildSuc(JSON.toJSONString(
|
return Result.buildSuc(JSON.toJSONString(
|
||||||
new GatewayConfigVO(
|
new GatewayConfigVO(
|
||||||
String.valueOf(config.getVersion()),
|
String.valueOf(config.getVersion()),
|
||||||
@@ -107,7 +114,9 @@ public class GatewayServiceDiscoveryController {
|
|||||||
if (ValidateUtils.isNull(config)) {
|
if (ValidateUtils.isNull(config)) {
|
||||||
return Result.buildFailure("call get app rate config failed");
|
return Result.buildFailure("call get app rate config failed");
|
||||||
}
|
}
|
||||||
|
if (ValidateUtils.isNull(config.getAppRateLimit())) {
|
||||||
|
return Result.buildSuc();
|
||||||
|
}
|
||||||
return Result.buildSuc(JSON.toJSONString(
|
return Result.buildSuc(JSON.toJSONString(
|
||||||
new GatewayConfigVO(
|
new GatewayConfigVO(
|
||||||
String.valueOf(config.getVersion()),
|
String.valueOf(config.getVersion()),
|
||||||
@@ -125,6 +134,9 @@ public class GatewayServiceDiscoveryController {
|
|||||||
if (ValidateUtils.isNull(config)) {
|
if (ValidateUtils.isNull(config)) {
|
||||||
return Result.buildFailure("call get ip rate config failed");
|
return Result.buildFailure("call get ip rate config failed");
|
||||||
}
|
}
|
||||||
|
if (ValidateUtils.isNull(config.getIpRateLimit())) {
|
||||||
|
return Result.buildSuc();
|
||||||
|
}
|
||||||
return Result.buildSuc(JSON.toJSONString(
|
return Result.buildSuc(JSON.toJSONString(
|
||||||
new GatewayConfigVO(
|
new GatewayConfigVO(
|
||||||
String.valueOf(config.getVersion()),
|
String.valueOf(config.getVersion()),
|
||||||
@@ -143,7 +155,9 @@ public class GatewayServiceDiscoveryController {
|
|||||||
if (ValidateUtils.isNull(config) || ValidateUtils.isNull(config.getSpRateMap())) {
|
if (ValidateUtils.isNull(config) || ValidateUtils.isNull(config.getSpRateMap())) {
|
||||||
return Result.buildFailure("call update kafka bootstrap servers failed");
|
return Result.buildFailure("call update kafka bootstrap servers failed");
|
||||||
}
|
}
|
||||||
|
if (ValidateUtils.isEmptyMap(config.getSpRateMap())) {
|
||||||
|
return Result.buildSuc();
|
||||||
|
}
|
||||||
List<String> strList = new ArrayList<>();
|
List<String> strList = new ArrayList<>();
|
||||||
for (Map.Entry<String, Long> entry: config.getSpRateMap().entrySet()) {
|
for (Map.Entry<String, Long> entry: config.getSpRateMap().entrySet()) {
|
||||||
strList.add(entry.getKey() + "#" + String.valueOf(entry.getValue()));
|
strList.add(entry.getKey() + "#" + String.valueOf(entry.getValue()));
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.xiaojukeji.kafka.manager.common.bizenum.ConsumeHealthEnum;
|
|||||||
import com.xiaojukeji.kafka.manager.common.bizenum.OffsetLocationEnum;
|
import com.xiaojukeji.kafka.manager.common.bizenum.OffsetLocationEnum;
|
||||||
import com.xiaojukeji.kafka.manager.common.constant.ApiPrefix;
|
import com.xiaojukeji.kafka.manager.common.constant.ApiPrefix;
|
||||||
import com.xiaojukeji.kafka.manager.common.constant.Constant;
|
import com.xiaojukeji.kafka.manager.common.constant.Constant;
|
||||||
|
import com.xiaojukeji.kafka.manager.common.constant.SystemCodeConstant;
|
||||||
import com.xiaojukeji.kafka.manager.common.entity.Result;
|
import com.xiaojukeji.kafka.manager.common.entity.Result;
|
||||||
import com.xiaojukeji.kafka.manager.common.entity.ResultStatus;
|
import com.xiaojukeji.kafka.manager.common.entity.ResultStatus;
|
||||||
import com.xiaojukeji.kafka.manager.common.entity.ao.consumer.ConsumeDetailDTO;
|
import com.xiaojukeji.kafka.manager.common.entity.ao.consumer.ConsumeDetailDTO;
|
||||||
@@ -29,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -56,6 +58,8 @@ public class ThirdPartConsumeController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ThirdPartService thirdPartService;
|
private ThirdPartService thirdPartService;
|
||||||
|
|
||||||
|
private static final List<String> WHITE_SYS_CODES_LIST = Arrays.asList(SystemCodeConstant.KAFKA_MANAGER);
|
||||||
|
|
||||||
@ApiOperation(value = "消费组健康", notes = "消费组是否健康")
|
@ApiOperation(value = "消费组健康", notes = "消费组是否健康")
|
||||||
@RequestMapping(value = "clusters/consumer-health", method = RequestMethod.POST)
|
@RequestMapping(value = "clusters/consumer-health", method = RequestMethod.POST)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@@ -97,18 +101,20 @@ public class ThirdPartConsumeController {
|
|||||||
return Result.buildFrom(ResultStatus.CLUSTER_NOT_EXIST);
|
return Result.buildFrom(ResultStatus.CLUSTER_NOT_EXIST);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检查AppID权限
|
if (!WHITE_SYS_CODES_LIST.contains(dto.getSystemCode())) {
|
||||||
if (!appService.verifyAppIdByPassword(dto.getAppId(), dto.getPassword())) {
|
// 检查AppID权限
|
||||||
return Result.buildFrom(ResultStatus.PARAM_ILLEGAL);
|
if (!appService.verifyAppIdByPassword(dto.getAppId(), dto.getPassword())) {
|
||||||
}
|
return Result.buildFrom(ResultStatus.PARAM_ILLEGAL);
|
||||||
// 检查权限
|
}
|
||||||
AuthorityDO authority =
|
// 检查权限
|
||||||
|
AuthorityDO authority =
|
||||||
authorityService.getAuthority(dto.getClusterId(), dto.getTopicName(), dto.getAppId());
|
authorityService.getAuthority(dto.getClusterId(), dto.getTopicName(), dto.getAppId());
|
||||||
if (ValidateUtils.isNull(authority) || (authority.getAccess() & 1) <= 0) {
|
if (ValidateUtils.isNull(authority) || (authority.getAccess() & 1) <= 0) {
|
||||||
authority = authorityService.getAuthority(dto.getClusterId(), "*", dto.getAppId());
|
authority = authorityService.getAuthority(dto.getClusterId(), "*", dto.getAppId());
|
||||||
}
|
}
|
||||||
if (authority == null || (authority.getAccess() & 1) <= 0) {
|
if (authority == null || (authority.getAccess() & 1) <= 0) {
|
||||||
return Result.buildFrom(ResultStatus.USER_WITHOUT_AUTHORITY);
|
return Result.buildFrom(ResultStatus.USER_WITHOUT_AUTHORITY);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Result> resultList = thirdPartService.resetOffsets(clusterDO, dto);
|
List<Result> resultList = thirdPartService.resetOffsets(clusterDO, dto);
|
||||||
|
|||||||
7
pom.xml
7
pom.xml
@@ -27,6 +27,7 @@
|
|||||||
<java_target_version>1.8</java_target_version>
|
<java_target_version>1.8</java_target_version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<file_encoding>UTF-8</file_encoding>
|
<file_encoding>UTF-8</file_encoding>
|
||||||
|
<tomcat.version>8.5.37</tomcat.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
@@ -67,7 +68,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.servlet</groupId>
|
<groupId>javax.servlet</groupId>
|
||||||
<artifactId>javax.servlet-api</artifactId>
|
<artifactId>javax.servlet-api</artifactId>
|
||||||
<version>4.0.1</version>
|
<version>3.1.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.annotation</groupId>
|
<groupId>javax.annotation</groupId>
|
||||||
@@ -124,7 +125,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.kafka</groupId>
|
<groupId>org.apache.kafka</groupId>
|
||||||
<artifactId>kafka_2.10</artifactId>
|
<artifactId>kafka_2.10</artifactId>
|
||||||
<version>0.10.2.2</version>
|
<version>0.10.2.0</version>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
@@ -135,7 +136,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.kafka</groupId>
|
<groupId>org.apache.kafka</groupId>
|
||||||
<artifactId>kafka-clients</artifactId>
|
<artifactId>kafka-clients</artifactId>
|
||||||
<version>0.10.2.2</version>
|
<version>0.10.2.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- json -->
|
<!-- json -->
|
||||||
|
|||||||
Reference in New Issue
Block a user