Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions inlong-dashboard/src/ui/locales/cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "心跳超时",
Expand Down
2 changes: 2 additions & 0 deletions inlong-dashboard/src/ui/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
76 changes: 76 additions & 0 deletions inlong-dashboard/src/ui/pages/Clusters/NodeEditModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
},
Expand All @@ -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',
Expand Down Expand Up @@ -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'),
Expand Down