Skip to content

Commit

Permalink
[INLONG-11485][Dashboard] Support multiple scheduling enginessearch (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
wohainilaodou authored Nov 12, 2024
1 parent cef2dbd commit 2a8b233
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 33 deletions.
41 changes: 35 additions & 6 deletions inlong-dashboard/src/plugins/sync/common/SyncDefaultInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class SyncDefaultInfo implements DataWithBackend, RenderRow, RenderList {
})
@ColumnDecorator()
@I18n('meta.Synchronize.GroupOwners')
inCharges: string;
inCharges: string[];

@FieldDecorator({
type: 'radio',
Expand Down Expand Up @@ -120,22 +120,51 @@ export class SyncDefaultInfo implements DataWithBackend, RenderRow, RenderList {

@FieldDecorator({
type: 'radio',
initialValue: 0,
initialValue: 'Quartz',
visible: values => values.inlongGroupMode === 2,
rules: [{ required: true }],
props: {
options: [
{
label: i18n.t('meta.Synchronize.Conventional'),
value: 0,
label: i18n.t('meta.Synchronize.ScheduleQuartz'),
value: 'Quartz',
},
{
label: i18n.t('meta.Synchronize.Crontab'),
value: 1,
label: i18n.t('meta.Synchronize.ScheduleAirflow'),
value: 'Airflow',
},
{
label: i18n.t('meta.Synchronize.DolphinScheduler'),
value: 'DolphinScheduler',
},
],
},
})
@I18n('meta.Synchronize.ScheduleEngine')
scheduleEngine: string;

@FieldDecorator({
type: 'radio',
initialValue: 0,
visible: values => values.inlongGroupMode === 2,

rules: [{ required: true }],
props: values => {
return {
disabled: values.scheduleEngine === 'DolphinScheduler',
options: [
{
label: i18n.t('meta.Synchronize.Conventional'),
value: 0,
},
{
label: i18n.t('meta.Synchronize.Crontab'),
value: 1,
},
],
};
},
})
@I18n('meta.Synchronize.ScheduleType')
scheduleType: Number;
@FieldDecorator({
Expand Down
4 changes: 4 additions & 0 deletions inlong-dashboard/src/ui/locales/cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,10 @@
"meta.Synchronize.OfflineSync": "离线同步",
"meta.Synchronize.SchedulingRules": "调度规则",
"meta.Synchronize.ScheduleType": "调度类型",
"meta.Synchronize.ScheduleEngine": "调度引擎",
"meta.Synchronize.ScheduleQuartz": "Quartz",
"meta.Synchronize.ScheduleAirflow": "Airflow",
"meta.Synchronize.DolphinScheduler": "DolphinScheduler",
"meta.Synchronize.Conventional": "常规",
"meta.Synchronize.Crontab": "Crontab",
"meta.Synchronize.DelayTime": "延迟时间",
Expand Down
4 changes: 4 additions & 0 deletions inlong-dashboard/src/ui/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,10 @@
"meta.Synchronize.OfflineSync": "Offline Sync",
"meta.Synchronize.SchedulingRules": "Scheduling Rules",
"meta.Synchronize.ScheduleType": "Schedule Type",
"meta.Synchronize.ScheduleEngine": "Schedule Engine",
"meta.Synchronize.ScheduleQuartz": "Quartz",
"meta.Synchronize.ScheduleAirflow": "Airflow",
"meta.Synchronize.DolphinScheduler": "DolphinScheduler",
"meta.Synchronize.Conventional": "Conventional",
"meta.Synchronize.Crontab": "Crontab",
"meta.Synchronize.DelayTime": "Delay Time",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,13 @@ const Comp: React.FC<Props> = ({ agentList, agentTotal, parentId, ...modalProps
const submitList = [];

valuesToSubmitList(agentList, values, submitList);
console.log('submitList', submitList);
const baseBatchSize =
Math.floor(submitList.length / values.batchNum) === 0
? 1
: Math.floor(submitList.length / values.batchNum);
const remainder = submitList.length % values.batchNum;
const map = new Map();
const batchNum = agentList.length < values.batchNum ? agentList.length : values.batchNum;
console.log('batchNum', batchNum, 'baseBatchSize', baseBatchSize, 'remainder', remainder);

for (let i = 1; i <= batchNum; i++) {
if (i === batchNum) {
Expand Down
4 changes: 1 addition & 3 deletions inlong-dashboard/src/ui/pages/Clusters/HeartBeatModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ const Comp: React.FC<Props> = ({ ...modalProps }) => {
},
{
refreshDeps: [options],
onSuccess: data => {
console.log(data);
},
onSuccess: data => {},
},
);

Expand Down
29 changes: 14 additions & 15 deletions inlong-dashboard/src/ui/pages/Clusters/NodeEditModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,23 +76,23 @@ const NodeEditModal: React.FC<NodeEditModalProps> = ({ id, type, clusterId, ...m
submitData.sshKey = '';
}
}
if (type === 'AGENT') {
if (submitData.installer !== undefined) {
if (Array.isArray(submitData.moduleIdList)) {
submitData.moduleIdList = submitData.moduleIdList.concat(submitData.installer);
} else {
submitData.moduleIdList = [submitData.moduleIdList].concat(submitData.installer);
}
}
if (type === 'AGENT') {
if (submitData.installer !== undefined) {
if (Array.isArray(submitData.moduleIdList)) {
submitData.moduleIdList = submitData.moduleIdList.concat(submitData.installer);
} else {
submitData.moduleIdList = [submitData.moduleIdList].concat(submitData.installer);
}
}
await request({
url: `/cluster/node/${isUpdate ? 'update' : 'save'}`,
method: 'POST',
data: submitData,
});
await modalProps?.onOk(submitData);
message.success(i18n.t('basic.OperatingSuccess'));
}
await request({
url: `/cluster/node/${isUpdate ? 'update' : 'save'}`,
method: 'POST',
data: submitData,
});
await modalProps?.onOk(submitData);
message.success(i18n.t('basic.OperatingSuccess'));
};

const [agentInstaller, setAgentInstaller] = useState([]);
Expand All @@ -105,7 +105,6 @@ const NodeEditModal: React.FC<NodeEditModalProps> = ({ id, type, clusterId, ...m
pageSize: 9999,
},
});
console.log('result', result);
setAgentInstaller(result.list?.sort((a, b) => b.modifyTime - a.modifyTime));
return result;
};
Expand Down
2 changes: 0 additions & 2 deletions inlong-dashboard/src/ui/pages/Clusters/NodeManage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,6 @@ const Comp: React.FC = () => {
getModuleList().then(res => {
agentInstallerList.current = res?.list;
setAgentVersionObj(versionMap(res?.list));
console.log(agentInstallerList.current, agentVersionObj);
});
})();
}, [type]);
Expand All @@ -324,7 +323,6 @@ const Comp: React.FC = () => {

useEffect(() => {
const handleResize = () => {
console.log('window.innerWidth', window.innerWidth);
setIsSmall(window.innerWidth < 1600);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ const Comp: React.FC<Props> = ({ ...modalProps }) => {
};

const onFilter = allValues => {
console.log(allValues);
setOptions(prev => ({
...prev,
...allValues,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ const Comp: React.FC<AuditProps> = ({ auditData }) => {
? sourceData[0]
: sourceData[1];
const output = baseData?.auditSet?.reduce((acc, cur) => {
console.log('cur', cur, sourceData[0].auditId, baseData.auditId);
acc[cur.inlongGroupId + cur.inlongStreamId] = {
inlongGroupId: cur.inlongGroupId,
inlongStreamId: cur.inlongStreamId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export const useFormContent = ({ mqType, editing, isCreate, isUpdate }) => {
return (
!defaultGroupKeysI18nMap[formName] ||
[
'scheduleEngine',
'scheduleType',
'time',
'crontabExpression',
Expand Down Expand Up @@ -149,6 +150,7 @@ function transType(editing: boolean, conf) {
'ttl',
'retentionTime',
'retentionSize',
'scheduleEngine',
'scheduleType',
'scheduleUnit',
'scheduleInterval',
Expand Down
11 changes: 8 additions & 3 deletions inlong-dashboard/src/ui/pages/SynchronizeDetail/Info/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,10 @@ const Comp = ({ inlongGroupId, inlongStreamId, readonly, isCreate }: Props, ref)

const onOk = async () => {
const values = await form.validateFields();

let submitData = {
...values,
version: data?.version,
inCharges: values.inCharges?.join(','),
inCharges: values.inCharges instanceof Array ? values.inCharges?.join(',') : values.inCharges,
};
if (values.inlongGroupMode === 2) {
submitData = {
Expand Down Expand Up @@ -228,7 +227,13 @@ const Comp = ({ inlongGroupId, inlongStreamId, readonly, isCreate }: Props, ref)
form={form}
content={formContent}
initialValues={data}
onValuesChange={(c, values) => setMqType(values.mqType)}
onValuesChange={(c, values) => {
setMqType(values.mqType);
if (c.scheduleEngine === 'DolphinScheduler') {
form.setFieldsValue({ scheduleType: 1 });
values.scheduleType = 1;
}
}}
useMaxWidth={1400}
col={14}
labelWrap
Expand Down

0 comments on commit 2a8b233

Please sign in to comment.