From 977a4be3c1749d3714795cc949f574ef8e581b63 Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Mon, 10 Nov 2025 18:52:40 +0800 Subject: [PATCH] fix: Fix the issue of abnormal application port forwarding (#10910) --- core/utils/controller/manager/common.go | 2 -- frontend/src/components/port-jump/index.vue | 6 +++--- frontend/src/views/app-store/installed/index.vue | 6 ++++++ frontend/src/views/terminal/command/import/index.vue | 1 + 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/core/utils/controller/manager/common.go b/core/utils/controller/manager/common.go index 12dd16ea2..89f762089 100644 --- a/core/utils/controller/manager/common.go +++ b/core/utils/controller/manager/common.go @@ -5,7 +5,6 @@ import ( "strings" "time" - "github.com/1Panel-dev/1Panel/core/global" "github.com/1Panel-dev/1Panel/core/utils/cmd" "github.com/1Panel-dev/1Panel/core/utils/ssh" ) @@ -21,7 +20,6 @@ func handlerErr(out string, err error) error { } func run(client *ssh.SSHClient, name string, args ...string) (string, error) { - global.LOG.Debugf("handle with controller `%s %s`", name, strings.Join(args, " ")) if client == nil { return cmd.NewCommandMgr(cmd.WithTimeout(10*time.Second)).RunWithStdoutBashCf("LANGUAGE=en_US:en %s %s", name, strings.Join(args, " ")) } diff --git a/frontend/src/components/port-jump/index.vue b/frontend/src/components/port-jump/index.vue index 57dcfd1c4..50ec9d4e2 100644 --- a/frontend/src/components/port-jump/index.vue +++ b/frontend/src/components/port-jump/index.vue @@ -41,11 +41,11 @@ const acceptParams = async (params: DialogProps): Promise => { let protocol = params.protocol === 'https' ? 'https' : 'http'; const res = await getAgentSettingInfo(); if (!res.data.systemIP) { - if (!globalStore.currentNodeAddr) { + if (!globalStore.isMaster || globalStore.currentNodeAddr != '127.0.0.1') { + res.data.systemIP = globalStore.currentNodeAddr; + } else { open.value = true; return; - } else { - res.data.systemIP = globalStore.currentNodeAddr; } } if (res.data.systemIP.indexOf(':') === -1) { diff --git a/frontend/src/views/app-store/installed/index.vue b/frontend/src/views/app-store/installed/index.vue index 93276fbeb..d46de905e 100644 --- a/frontend/src/views/app-store/installed/index.vue +++ b/frontend/src/views/app-store/installed/index.vue @@ -444,6 +444,8 @@ import Tags from '@/views/app-store/components/tag.vue'; import SvgIcon from '@/components/svg-icon/svg-icon.vue'; import MainDiv from '@/components/main-div/index.vue'; import { routerToFileWithPath, routerToNameWithQuery } from '@/utils/router'; +import { GlobalStore } from '@/store'; +const globalStore = GlobalStore(); const data = ref(); const loading = ref(false); @@ -755,6 +757,10 @@ const getConfig = async () => { const res = await getAgentSettingByKey('SystemIP'); if (res.data != '') { defaultLink.value = res.data; + return; + } + if (!globalStore.isMaster || globalStore.currentNodeAddr != '127.0.0.1') { + defaultLink.value = globalStore.currentNodeAddr; } } catch (error) {} }; diff --git a/frontend/src/views/terminal/command/import/index.vue b/frontend/src/views/terminal/command/import/index.vue index 19b7338f9..331948189 100644 --- a/frontend/src/views/terminal/command/import/index.vue +++ b/frontend/src/views/terminal/command/import/index.vue @@ -96,6 +96,7 @@ const groupList = ref(); const acceptParams = (): void => { visible.value = true; + selects.value = []; loadGroups(); currentGroup.value = ''; data.value = [];