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