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 98c84917a3 [INLONG-9944][Dashboard] Add Agent and Installer for Agent Cluster Node (#9945) 98c84917a3 is described below commit 98c84917a35a1e78e60d99e5d6c587abb7d01163 Author: haifxu <xhf1208357...@gmail.com> AuthorDate: Wed Apr 10 12:01:41 2024 +0800 [INLONG-9944][Dashboard] Add Agent and Installer for Agent Cluster Node (#9945) --- inlong-dashboard/src/ui/locales/cn.json | 2 + inlong-dashboard/src/ui/locales/en.json | 2 + .../src/ui/pages/Clusters/NodeEditModal.tsx | 76 ++++++++++++++++++++++ 3 files changed, 80 insertions(+) diff --git a/inlong-dashboard/src/ui/locales/cn.json b/inlong-dashboard/src/ui/locales/cn.json index 69eebbcb5a..614a2e73cd 100644 --- a/inlong-dashboard/src/ui/locales/cn.json +++ b/inlong-dashboard/src/ui/locales/cn.json @@ -751,6 +751,8 @@ "pages.Clusters.Node.Name": "节点", "pages.Clusters.Node.Port": "端口", "pages.Clusters.Node.ProtocolType": "协议类型", + "pages.Clusters.Node.Agent": "Agent", + "pages.Clusters.Node.AgentInstaller": "Installer", "pages.Clusters.Node.Status": "状态", "pages.Clusters.Node.Status.Normal": "正常", "pages.Clusters.Node.Status.Timeout": "心跳超时", diff --git a/inlong-dashboard/src/ui/locales/en.json b/inlong-dashboard/src/ui/locales/en.json index 06a27fb7e8..87198b1e8d 100644 --- a/inlong-dashboard/src/ui/locales/en.json +++ b/inlong-dashboard/src/ui/locales/en.json @@ -751,6 +751,8 @@ "pages.Clusters.Node.Name": "Node", "pages.Clusters.Node.Port": "Port", "pages.Clusters.Node.ProtocolType": "Protocol type", + "pages.Clusters.Node.Agent": "Agent", + "pages.Clusters.Node.AgentInstaller": "Installer", "pages.Clusters.Node.Status": "Status", "pages.Clusters.Node.Status.Normal": "Normal", "pages.Clusters.Node.Status.Timeout": "Timeout", diff --git a/inlong-dashboard/src/ui/pages/Clusters/NodeEditModal.tsx b/inlong-dashboard/src/ui/pages/Clusters/NodeEditModal.tsx index 9ced80eb68..cfdb663439 100644 --- a/inlong-dashboard/src/ui/pages/Clusters/NodeEditModal.tsx +++ b/inlong-dashboard/src/ui/pages/Clusters/NodeEditModal.tsx @@ -42,6 +42,11 @@ const NodeEditModal: React.FC<NodeEditModalProps> = ({ id, type, clusterId, ...m { manual: true, onSuccess: result => { + if (type === 'AGENT') { + // Only keep the first element and give the rest to the 'installer' + result.installer = result?.moduleIdList.slice(1); + result.moduleIdList = result?.moduleIdList.slice(0, 1); + } form.setFieldsValue(result); }, }, @@ -59,6 +64,14 @@ const NodeEditModal: React.FC<NodeEditModalProps> = ({ id, type, clusterId, ...m submitData.id = id; submitData.version = savedData?.version; } + if (type === 'AGENT') { + if (submitData.installer !== undefined) { + submitData.moduleIdList = submitData.moduleIdList.concat(submitData.installer); + } + if (isUpdate === undefined) { + submitData.isInstall = true; + } + } await request({ url: `/cluster/node/${isUpdate ? 'update' : 'save'}`, method: 'POST', @@ -145,6 +158,69 @@ const NodeEditModal: React.FC<NodeEditModalProps> = ({ id, type, clusterId, ...m ], }, }, + { + type: 'select', + label: i18n.t('pages.Clusters.Node.Agent'), + name: 'moduleIdList', + hidden: type !== 'AGENT', + props: { + options: { + requestAuto: true, + requestTrigger: ['onOpen'], + requestService: keyword => ({ + url: '/module/list', + method: 'POST', + data: { + keyword, + pageNum: 1, + pageSize: 9999, + }, + }), + requestParams: { + formatResult: result => + result?.list + ?.filter(item => item.type === 'AGENT') + .map(item => ({ + ...item, + label: `${item.name} ${item.version}`, + value: item.id, + })), + }, + }, + }, + }, + { + type: 'select', + label: i18n.t('pages.Clusters.Node.AgentInstaller'), + name: 'installer', + hidden: type !== 'AGENT', + props: { + mode: 'multiple', + options: { + requestAuto: true, + requestTrigger: ['onOpen'], + requestService: keyword => ({ + url: '/module/list', + method: 'POST', + data: { + keyword, + pageNum: 1, + pageSize: 9999, + }, + }), + requestParams: { + formatResult: result => + result?.list + ?.filter(item => item.type === 'INSTALLER') + .map(item => ({ + ...item, + label: `${item.name} ${item.version}`, + value: item.id, + })), + }, + }, + }, + }, { type: 'textarea', label: i18n.t('pages.Clusters.Description'),