This is an automated email from the ASF dual-hosted git repository.

dockerzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git


The following commit(s) were added to refs/heads/master by this push:
     new 2a8b23322d [INLONG-11485][Dashboard] Support multiple scheduling 
enginessearch (#11486)
2a8b23322d is described below

commit 2a8b23322df0b5f53ff8dc3d2f71ec61834c06fe
Author: kamianlaida <165994047+wohainilao...@users.noreply.github.com>
AuthorDate: Tue Nov 12 16:59:28 2024 +0800

    [INLONG-11485][Dashboard] Support multiple scheduling enginessearch (#11486)
---
 .../src/plugins/sync/common/SyncDefaultInfo.ts     | 41 ++++++++++++++++++----
 inlong-dashboard/src/ui/locales/cn.json            |  4 +++
 inlong-dashboard/src/ui/locales/en.json            |  4 +++
 .../ui/pages/Clusters/AgentBatchUpdateModal.tsx    |  2 --
 .../src/ui/pages/Clusters/HeartBeatModal.tsx       |  4 +--
 .../src/ui/pages/Clusters/NodeEditModal.tsx        | 29 ++++++++-------
 .../src/ui/pages/Clusters/NodeManage.tsx           |  2 --
 .../src/ui/pages/Clusters/OperationLogModal.tsx    |  1 -
 .../src/ui/pages/ModuleAudit/IpModule/index.tsx    |  1 -
 .../src/ui/pages/SynchronizeDetail/Info/config.tsx |  2 ++
 .../src/ui/pages/SynchronizeDetail/Info/index.tsx  | 11 ++++--
 11 files changed, 68 insertions(+), 33 deletions(-)

diff --git a/inlong-dashboard/src/plugins/sync/common/SyncDefaultInfo.ts 
b/inlong-dashboard/src/plugins/sync/common/SyncDefaultInfo.ts
index 1fbf1ecfda..7bf18927d9 100644
--- a/inlong-dashboard/src/plugins/sync/common/SyncDefaultInfo.ts
+++ b/inlong-dashboard/src/plugins/sync/common/SyncDefaultInfo.ts
@@ -73,7 +73,7 @@ export class SyncDefaultInfo implements DataWithBackend, 
RenderRow, RenderList {
   })
   @ColumnDecorator()
   @I18n('meta.Synchronize.GroupOwners')
-  inCharges: string;
+  inCharges: string[];
 
   @FieldDecorator({
     type: 'radio',
@@ -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({
diff --git a/inlong-dashboard/src/ui/locales/cn.json 
b/inlong-dashboard/src/ui/locales/cn.json
index 7a8e2ea1dd..8e498f8f2c 100644
--- a/inlong-dashboard/src/ui/locales/cn.json
+++ b/inlong-dashboard/src/ui/locales/cn.json
@@ -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": "延迟时间",
diff --git a/inlong-dashboard/src/ui/locales/en.json 
b/inlong-dashboard/src/ui/locales/en.json
index ce06b61f3c..a176d810ef 100644
--- a/inlong-dashboard/src/ui/locales/en.json
+++ b/inlong-dashboard/src/ui/locales/en.json
@@ -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",
diff --git a/inlong-dashboard/src/ui/pages/Clusters/AgentBatchUpdateModal.tsx 
b/inlong-dashboard/src/ui/pages/Clusters/AgentBatchUpdateModal.tsx
index e56a8cb7e3..561e65898e 100644
--- a/inlong-dashboard/src/ui/pages/Clusters/AgentBatchUpdateModal.tsx
+++ b/inlong-dashboard/src/ui/pages/Clusters/AgentBatchUpdateModal.tsx
@@ -216,7 +216,6 @@ 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
@@ -224,7 +223,6 @@ const Comp: React.FC<Props> = ({ agentList, agentTotal, 
parentId, ...modalProps
     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) {
diff --git a/inlong-dashboard/src/ui/pages/Clusters/HeartBeatModal.tsx 
b/inlong-dashboard/src/ui/pages/Clusters/HeartBeatModal.tsx
index 3895f1f986..01100f2864 100644
--- a/inlong-dashboard/src/ui/pages/Clusters/HeartBeatModal.tsx
+++ b/inlong-dashboard/src/ui/pages/Clusters/HeartBeatModal.tsx
@@ -51,9 +51,7 @@ const Comp: React.FC<Props> = ({ ...modalProps }) => {
     },
     {
       refreshDeps: [options],
-      onSuccess: data => {
-        console.log(data);
-      },
+      onSuccess: data => {},
     },
   );
 
diff --git a/inlong-dashboard/src/ui/pages/Clusters/NodeEditModal.tsx 
b/inlong-dashboard/src/ui/pages/Clusters/NodeEditModal.tsx
index 5a38817553..0496e820cf 100644
--- a/inlong-dashboard/src/ui/pages/Clusters/NodeEditModal.tsx
+++ b/inlong-dashboard/src/ui/pages/Clusters/NodeEditModal.tsx
@@ -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([]);
@@ -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;
   };
diff --git a/inlong-dashboard/src/ui/pages/Clusters/NodeManage.tsx 
b/inlong-dashboard/src/ui/pages/Clusters/NodeManage.tsx
index 7e2a558792..74ab2112e5 100644
--- a/inlong-dashboard/src/ui/pages/Clusters/NodeManage.tsx
+++ b/inlong-dashboard/src/ui/pages/Clusters/NodeManage.tsx
@@ -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]);
@@ -324,7 +323,6 @@ const Comp: React.FC = () => {
 
   useEffect(() => {
     const handleResize = () => {
-      console.log('window.innerWidth', window.innerWidth);
       setIsSmall(window.innerWidth < 1600);
     };
 
diff --git a/inlong-dashboard/src/ui/pages/Clusters/OperationLogModal.tsx 
b/inlong-dashboard/src/ui/pages/Clusters/OperationLogModal.tsx
index 274fe01c4a..d829dc557a 100644
--- a/inlong-dashboard/src/ui/pages/Clusters/OperationLogModal.tsx
+++ b/inlong-dashboard/src/ui/pages/Clusters/OperationLogModal.tsx
@@ -65,7 +65,6 @@ const Comp: React.FC<Props> = ({ ...modalProps }) => {
   };
 
   const onFilter = allValues => {
-    console.log(allValues);
     setOptions(prev => ({
       ...prev,
       ...allValues,
diff --git a/inlong-dashboard/src/ui/pages/ModuleAudit/IpModule/index.tsx 
b/inlong-dashboard/src/ui/pages/ModuleAudit/IpModule/index.tsx
index 4e56b37ee5..9aab3b903c 100644
--- a/inlong-dashboard/src/ui/pages/ModuleAudit/IpModule/index.tsx
+++ b/inlong-dashboard/src/ui/pages/ModuleAudit/IpModule/index.tsx
@@ -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,
diff --git a/inlong-dashboard/src/ui/pages/SynchronizeDetail/Info/config.tsx 
b/inlong-dashboard/src/ui/pages/SynchronizeDetail/Info/config.tsx
index 78aac3df65..9d227ecdd1 100644
--- a/inlong-dashboard/src/ui/pages/SynchronizeDetail/Info/config.tsx
+++ b/inlong-dashboard/src/ui/pages/SynchronizeDetail/Info/config.tsx
@@ -85,6 +85,7 @@ export const useFormContent = ({ mqType, editing, isCreate, 
isUpdate }) => {
       return (
         !defaultGroupKeysI18nMap[formName] ||
         [
+          'scheduleEngine',
           'scheduleType',
           'time',
           'crontabExpression',
@@ -149,6 +150,7 @@ function transType(editing: boolean, conf) {
         'ttl',
         'retentionTime',
         'retentionSize',
+        'scheduleEngine',
         'scheduleType',
         'scheduleUnit',
         'scheduleInterval',
diff --git a/inlong-dashboard/src/ui/pages/SynchronizeDetail/Info/index.tsx 
b/inlong-dashboard/src/ui/pages/SynchronizeDetail/Info/index.tsx
index e6325dcf5d..f5ed276761 100644
--- a/inlong-dashboard/src/ui/pages/SynchronizeDetail/Info/index.tsx
+++ b/inlong-dashboard/src/ui/pages/SynchronizeDetail/Info/index.tsx
@@ -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 = {
@@ -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

Reply via email to