mirror of
https://github.com/didi/KnowStreaming.git
synced 2026-01-09 08:27:47 +08:00
迭代V2.5, 修复broker监控问题,增加JMX认证支持等...
This commit is contained in:
@@ -61,6 +61,7 @@ export const showEditClusterTopic = (item: IClusterTopics) => {
|
||||
attrs: {
|
||||
placeholder: '请输入保存时间',
|
||||
suffix: '小时',
|
||||
prompttype:'修改保存时间,预计一分钟左右生效!'
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -158,26 +158,26 @@ export const createMigrationTasks = () => {
|
||||
},
|
||||
{
|
||||
key: 'originalRetentionTime',
|
||||
label: '原本保存时间',
|
||||
label: '原Topic保存时间',
|
||||
rules: [{
|
||||
required: true,
|
||||
message: '请输入原本保存时间',
|
||||
message: '请输入原Topic保存时间',
|
||||
}],
|
||||
attrs: {
|
||||
disabled: true,
|
||||
placeholder: '请输入原本保存时间',
|
||||
placeholder: '请输入原Topic保存时间',
|
||||
suffix: '小时',
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'reassignRetentionTime',
|
||||
label: '迁移保存时间',
|
||||
label: '迁移后Topic保存时间',
|
||||
rules: [{
|
||||
required: true,
|
||||
message: '请输入迁移保存时间',
|
||||
message: '请输入迁移后Topic保存时间',
|
||||
}],
|
||||
attrs: {
|
||||
placeholder: '请输入迁移保存时间',
|
||||
placeholder: '请输入迁移后Topic保存时间',
|
||||
suffix: '小时',
|
||||
},
|
||||
},
|
||||
|
||||
@@ -24,26 +24,111 @@ export const showApplyModal = (record?: IUser) => {
|
||||
value: +item,
|
||||
})),
|
||||
rules: [{ required: true, message: '请选择角色' }],
|
||||
}, {
|
||||
key: 'password',
|
||||
label: '密码',
|
||||
type: FormItemType.inputPassword,
|
||||
rules: [{ required: !record, message: '请输入密码' }],
|
||||
},
|
||||
},
|
||||
// {
|
||||
// key: 'password',
|
||||
// label: '密码',
|
||||
// type: FormItemType.inputPassword,
|
||||
// rules: [{ required: !record, message: '请输入密码' }],
|
||||
// },
|
||||
],
|
||||
formData: record || {},
|
||||
visible: true,
|
||||
title: record ? '修改用户' : '新增用户',
|
||||
onSubmit: (value: IUser) => {
|
||||
if (record) {
|
||||
return users.modfiyUser(value).then(() => {
|
||||
message.success('操作成功');
|
||||
});
|
||||
return users.modfiyUser(value)
|
||||
}
|
||||
return users.addUser(value).then(() => {
|
||||
message.success('操作成功');
|
||||
});
|
||||
},
|
||||
};
|
||||
if(!record){
|
||||
let formMap: any = xFormModal.formMap
|
||||
formMap.splice(2, 0,{
|
||||
key: 'password',
|
||||
label: '密码',
|
||||
type: FormItemType.inputPassword,
|
||||
rules: [{ required: !record, message: '请输入密码' }],
|
||||
},)
|
||||
}
|
||||
wrapper.open(xFormModal);
|
||||
};
|
||||
|
||||
// const handleCfPassword = (rule:any, value:any, callback:any)=>{
|
||||
// if()
|
||||
// }
|
||||
export const showApplyModalModifyPassword = (record: IUser) => {
|
||||
const xFormModal:any = {
|
||||
formMap: [
|
||||
// {
|
||||
// key: 'oldPassword',
|
||||
// label: '旧密码',
|
||||
// type: FormItemType.inputPassword,
|
||||
// rules: [{
|
||||
// required: true,
|
||||
// message: '请输入旧密码',
|
||||
// }]
|
||||
// },
|
||||
{
|
||||
key: 'newPassword',
|
||||
label: '新密码',
|
||||
type: FormItemType.inputPassword,
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入新密码',
|
||||
}
|
||||
],
|
||||
attrs:{
|
||||
onChange:(e:any)=>{
|
||||
users.setNewPassWord(e.target.value)
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'confirmPassword',
|
||||
label: '确认密码',
|
||||
type: FormItemType.inputPassword,
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '请确认密码',
|
||||
validator:(rule:any, value:any, callback:any) => {
|
||||
// 验证新密码的一致性
|
||||
if(users.newPassWord){
|
||||
if(value!==users.newPassWord){
|
||||
rule.message = "两次密码输入不一致";
|
||||
callback('两次密码输入不一致')
|
||||
}else{
|
||||
callback()
|
||||
}
|
||||
}else if(!value){
|
||||
rule.message = "请确认密码";
|
||||
callback('请确认密码');
|
||||
}else{
|
||||
callback()
|
||||
}
|
||||
},
|
||||
}
|
||||
],
|
||||
},
|
||||
],
|
||||
formData: record || {},
|
||||
visible: true,
|
||||
title: '修改密码',
|
||||
onSubmit: (value: IUser) => {
|
||||
let params:any = {
|
||||
username:record?.username,
|
||||
password:value.confirmPassword,
|
||||
role:record?.role,
|
||||
}
|
||||
return users.modfiyUser(params).then(() => {
|
||||
message.success('操作成功');
|
||||
});
|
||||
},
|
||||
}
|
||||
wrapper.open(xFormModal);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as React from 'react';
|
||||
import { notification } from 'component/antd';
|
||||
import { IUploadFile, IConfigure } from 'types/base-type';
|
||||
import { notification, Select } from 'component/antd';
|
||||
import { IUploadFile, IConfigure, IConfigGateway } from 'types/base-type';
|
||||
import { version } from 'store/version';
|
||||
import { admin } from 'store/admin';
|
||||
import { wrapper } from 'store';
|
||||
@@ -97,8 +97,8 @@ const updateFormModal = (type: number) => {
|
||||
formMap[2].attrs = {
|
||||
accept: version.fileSuffix,
|
||||
},
|
||||
// tslint:disable-next-line:no-unused-expression
|
||||
wrapper.ref && wrapper.ref.updateFormMap$(formMap, wrapper.xFormWrapper.formData, true);
|
||||
// tslint:disable-next-line:no-unused-expression
|
||||
wrapper.ref && wrapper.ref.updateFormMap$(formMap, wrapper.xFormWrapper.formData, true);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -157,8 +157,8 @@ export const showModifyModal = (record: IUploadFile) => {
|
||||
|
||||
export const showConfigureModal = async (record?: IConfigure) => {
|
||||
if (record) {
|
||||
const result:any = await format2json(record.configValue);
|
||||
record.configValue = result.result;
|
||||
const result: any = await format2json(record.configValue);
|
||||
record.configValue = result.result || record.configValue;
|
||||
}
|
||||
const xFormModal = {
|
||||
formMap: [
|
||||
@@ -193,10 +193,69 @@ export const showConfigureModal = async (record?: IConfigure) => {
|
||||
return admin.editConfigure(value).then(data => {
|
||||
notification.success({ message: '编辑配置成功' });
|
||||
});
|
||||
} else {
|
||||
return admin.addNewConfigure(value).then(data => {
|
||||
notification.success({ message: '新建配置成功' });
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
wrapper.open(xFormModal);
|
||||
};
|
||||
|
||||
export const showConfigGatewayModal = async (record?: IConfigGateway) => {
|
||||
const xFormModal = {
|
||||
formMap: [
|
||||
{
|
||||
key: 'type',
|
||||
label: '配置类型',
|
||||
rules: [{ required: true, message: '请选择配置类型' }],
|
||||
type: "select",
|
||||
options: admin.gatewayType.map((item: any, index: number) => ({
|
||||
key: index,
|
||||
label: item.configName,
|
||||
value: item.configType,
|
||||
})),
|
||||
attrs: {
|
||||
disabled: record ? true : false,
|
||||
}
|
||||
}, {
|
||||
key: 'name',
|
||||
label: '配置键',
|
||||
rules: [{ required: true, message: '请输入配置键' }],
|
||||
attrs: {
|
||||
disabled: record ? true : false,
|
||||
},
|
||||
}, {
|
||||
key: 'value',
|
||||
label: '配置值',
|
||||
type: 'text_area',
|
||||
rules: [{
|
||||
required: true,
|
||||
message: '请输入配置值',
|
||||
}],
|
||||
}, {
|
||||
key: 'description',
|
||||
label: '描述',
|
||||
type: 'text_area',
|
||||
rules: [{ required: true, message: '请输入备注' }],
|
||||
},
|
||||
],
|
||||
formData: record || {},
|
||||
visible: true,
|
||||
isWaitting: true,
|
||||
title: `${record ? '编辑配置' : '新建配置'}`,
|
||||
onSubmit: async (parmas: IConfigGateway) => {
|
||||
if (record) {
|
||||
parmas.id = record.id;
|
||||
return admin.editConfigGateway(parmas).then(data => {
|
||||
notification.success({ message: '编辑配置成功' });
|
||||
});
|
||||
} else {
|
||||
return admin.addNewConfigGateway(parmas).then(data => {
|
||||
notification.success({ message: '新建配置成功' });
|
||||
});
|
||||
}
|
||||
return admin.addNewConfigure(value).then(data => {
|
||||
notification.success({ message: '新建配置成功' });
|
||||
});
|
||||
},
|
||||
};
|
||||
wrapper.open(xFormModal);
|
||||
|
||||
@@ -85,7 +85,7 @@ export const showEditModal = (record?: IAppItem, from?: string, isDisabled?: boo
|
||||
],
|
||||
formData: record,
|
||||
visible: true,
|
||||
title: isDisabled ? '详情' : record ? '编辑' : <div><span>应用申请</span><a className='applicationDocument' href="###" target='_blank'>应用申请文档</a></div>,
|
||||
title: isDisabled ? '详情' : record ? '编辑' : <div><span>应用申请</span><a className='applicationDocument' href="https://github.com/didi/Logi-KafkaManager/blob/master/docs/user_guide/resource_apply.md" target='_blank'>资源申请文档</a></div>,
|
||||
// customRenderElement: isDisabled ? '' : record ? '' : <span className="tips">集群资源充足时,预计1分钟自动审批通过</span>,
|
||||
isWaitting: true,
|
||||
onSubmit: (value: IAppItem) => {
|
||||
|
||||
@@ -20,14 +20,14 @@ export interface IRenderData {
|
||||
}
|
||||
|
||||
export const migrationModal = (renderData: IRenderData[]) => {
|
||||
const xFormWrapper = {
|
||||
const xFormWrapper = {
|
||||
type: 'drawer',
|
||||
visible: true,
|
||||
width: 1000,
|
||||
title: '新建迁移任务',
|
||||
customRenderElement: <WrappedDataMigrationFormTable data={renderData}/>,
|
||||
customRenderElement: <WrappedDataMigrationFormTable data={renderData} />,
|
||||
nofooter: true,
|
||||
noform: true,
|
||||
};
|
||||
wrapper.open(xFormWrapper as IXFormWrapper);
|
||||
wrapper.open(xFormWrapper as IXFormWrapper);
|
||||
};
|
||||
|
||||
@@ -75,8 +75,8 @@ export const showApprovalModal = (info: IOrderInfo, status: number, from?: strin
|
||||
// }],
|
||||
rules: [{
|
||||
required: true,
|
||||
message: '请输入大于12小于999的整数',
|
||||
pattern: /^([1-9]{1}[0-9]{2})$|^([2-9]{1}[0-9]{1})$|^(1[2-9]{1})$/,
|
||||
message: '请输入大于0小于10000的整数',
|
||||
pattern: /^\+?[1-9]\d{0,3}(\.\d*)?$/,
|
||||
}],
|
||||
}, {
|
||||
key: 'species',
|
||||
|
||||
@@ -88,7 +88,7 @@ export const applyTopic = () => {
|
||||
],
|
||||
formData: {},
|
||||
visible: true,
|
||||
title: '申请Topic',
|
||||
title: <div><span>申请Topic</span><a className='applicationDocument' href="https://github.com/didi/Logi-KafkaManager/blob/master/docs/user_guide/resource_apply.md" target='_blank'>资源申请文档</a></div>,
|
||||
okText: '确认',
|
||||
// customRenderElement: <span className="tips">集群资源充足时,预计1分钟自动审批通过</span>,
|
||||
isWaitting: true,
|
||||
|
||||
Reference in New Issue
Block a user