From b36943c110a20e11b57c493ed81a7366481a3408 Mon Sep 17 00:00:00 2001 From: wohainilaodou Date: Thu, 5 Dec 2024 18:33:12 +0800 Subject: [PATCH] [INLONG-11548][Dashboard] The Installer Module modify thedefaults --- .../src/ui/pages/AgentModule/CreateModal.tsx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/inlong-dashboard/src/ui/pages/AgentModule/CreateModal.tsx b/inlong-dashboard/src/ui/pages/AgentModule/CreateModal.tsx index 68adb5d06cc..09d5b77e8d3 100644 --- a/inlong-dashboard/src/ui/pages/AgentModule/CreateModal.tsx +++ b/inlong-dashboard/src/ui/pages/AgentModule/CreateModal.tsx @@ -91,7 +91,10 @@ 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}'", + initialValue: + type === 'INSTALLER' + ? 'echo "installer"' + : "ps aux | grep core.AgentMain | grep java | grep -v grep | awk '{print $2}'", props: { showCount: true, maxLength: 1000, @@ -102,7 +105,9 @@ const Comp: React.FC = ({ id, type, ...modalProps }) => { 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 ', + type === 'INSTALLER' + ? 'echo ""' + : '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, @@ -112,7 +117,8 @@ 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', + initialValue: + type === 'INSTALLER' ? 'echo ""' : 'cd ~/inlong/inlong-agent/bin;sh agent.sh start', props: { showCount: true, maxLength: 1000, @@ -122,7 +128,8 @@ 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', + initialValue: + type === 'INSTALLER' ? 'echo ""' : 'cd ~/inlong/inlong-agent/bin;sh agent.sh stop', props: { showCount: true, maxLength: 1000, @@ -132,7 +139,7 @@ const Comp: React.FC = ({ id, type, ...modalProps }) => { type: 'textarea', label: i18n.t('pages.ModuleAgent.Config.UninstallCommand'), name: 'uninstallCommand', - initialValue: 'echo empty uninstall cmd', + initialValue: type === 'INSTALLER' ? 'echo ""' : 'echo empty uninstall cmd', props: { showCount: true, maxLength: 1000,