diff --git a/inlong-dashboard/src/ui/pages/GroupDetail/DataStorage/DetailModal.tsx b/inlong-dashboard/src/ui/pages/GroupDetail/DataStorage/DetailModal.tsx index e2d4e2d69ef..5819494b3a3 100644 --- a/inlong-dashboard/src/ui/pages/GroupDetail/DataStorage/DetailModal.tsx +++ b/inlong-dashboard/src/ui/pages/GroupDetail/DataStorage/DetailModal.tsx @@ -73,6 +73,12 @@ const Comp: React.FC = ({ formatResult: result => new Entity()?.parse(result) || result, onSuccess: result => { setSinkType(result.sinkType); + if (result.sinkType === 'REDIS') { + result.properties = Object.entries(result.properties).map(([key, value]) => ({ + keyName: key, + keyValue: value, + })); + } form.setFieldsValue(result); }, }, @@ -158,6 +164,19 @@ const Comp: React.FC = ({ if (startProcess) { submitData.startProcess = true; } + if (sinkType === 'REDIS') { + if (Array.isArray(submitData.properties) && submitData.properties.length > 0) { + const propertiesObject = submitData.properties.reduce((acc, item) => { + if (item.keyName && item.keyValue !== undefined) { + acc[item.keyName] = item.keyValue; + } + return acc; + }, {}); + submitData.properties = propertiesObject; + } else { + submitData.properties = {}; + } + } await request({ url: isUpdate ? '/sink/update' : '/sink/save', method: 'POST',