diff --git a/inlong-dashboard/src/ui/pages/AgentModule/CreateModal.tsx b/inlong-dashboard/src/ui/pages/AgentModule/CreateModal.tsx index 7dded466100..68adb5d06cc 100644 --- a/inlong-dashboard/src/ui/pages/AgentModule/CreateModal.tsx +++ b/inlong-dashboard/src/ui/pages/AgentModule/CreateModal.tsx @@ -91,6 +91,7 @@ const Comp: React.FC = ({ id, type, ...modalProps }) => { type: 'textarea', label: i18n.t('pages.ModuleAgent.Config.CheckCommand'), name: 'checkCommand', + initialValue: "ps aux | grep core.AgentMain | grep java | grep -v grep | awk '{print $2}'", props: { showCount: true, maxLength: 1000, @@ -100,6 +101,8 @@ const Comp: React.FC = ({ id, type, ...modalProps }) => { type: 'textarea', label: i18n.t('pages.ModuleAgent.Config.InstallCommand'), name: 'installCommand', + initialValue: + 'cd ~/inlong/inlong-agent/bin;sh agent.sh stop;rm -rf ~/inlong/inlong-agent-temp;mkdir -p ~/inlong/inlong-agent-temp;cp -r ~/inlong/inlong-agent/.localdb ', props: { showCount: true, maxLength: 1000, @@ -109,6 +112,7 @@ const Comp: React.FC = ({ id, type, ...modalProps }) => { type: 'textarea', label: i18n.t('pages.ModuleAgent.Config.StartCommand'), name: 'startCommand', + initialValue: 'cd ~/inlong/inlong-agent/bin;sh agent.sh start', props: { showCount: true, maxLength: 1000, @@ -118,6 +122,7 @@ const Comp: React.FC = ({ id, type, ...modalProps }) => { type: 'textarea', label: i18n.t('pages.ModuleAgent.Config.StopCommand'), name: 'stopCommand', + initialValue: 'cd ~/inlong/inlong-agent/bin;sh agent.sh stop', props: { showCount: true, maxLength: 1000, @@ -127,6 +132,7 @@ const Comp: React.FC = ({ id, type, ...modalProps }) => { type: 'textarea', label: i18n.t('pages.ModuleAgent.Config.UninstallCommand'), name: 'uninstallCommand', + initialValue: 'echo empty uninstall cmd', props: { showCount: true, maxLength: 1000, @@ -142,12 +148,7 @@ const Comp: React.FC = ({ id, type, ...modalProps }) => { { manual: true, onSuccess: result => { - if (isCreate) { - form.resetFields(); - form.setFieldsValue({ ...result, name: '', version: '', packageId: '' }); - } else { - form.setFieldsValue(result); - } + form.setFieldsValue(result); }, }, ); @@ -177,7 +178,6 @@ const Comp: React.FC = ({ id, type, ...modalProps }) => { } else { setCreate(true); // here need a data which id is 1 to init create form - getData(1); } } else { form.resetFields();