From 4845249f461b1418e4634dd5864278b705f2d28f Mon Sep 17 00:00:00 2001 From: xuans Date: Sat, 26 Sep 2026 13:26:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E6=9C=8D=E5=8A=A1=E5=99=A8?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E4=B8=AD=E7=9A=84SSH=E5=BC=95=E5=AF=BC?= =?UTF-8?q?=E7=9B=AE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将SSH引导目标、密钥文件名和公钥安装命令改为直接读取当前服务器地址与SSH用户,避免输入后仍显示占位符。 --- frontend/src/views/Dashboard/Dashboard.js | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/frontend/src/views/Dashboard/Dashboard.js b/frontend/src/views/Dashboard/Dashboard.js index 3e9913e..3865ac6 100644 --- a/frontend/src/views/Dashboard/Dashboard.js +++ b/frontend/src/views/Dashboard/Dashboard.js @@ -43,8 +43,6 @@ export function useDashboard() { const sshKeyFormError = ref(""); const sshKeyPlatform = ref("windows"); const sshKeyPassphraseVisible = ref(false); - const sshKeyCommandUsername = ref("用户名"); - const sshKeyCommandHost = ref("服务器地址"); const sshKeyRandomSuffix = ref(createSSHKeyRandomSuffix()); const showSettings = ref(false); const settingsSaving = ref(false); @@ -311,13 +309,11 @@ export function useDashboard() { const serverForm = ref(createEmptyServerForm()); const sshKeyForm = ref(createEmptySSHKeyForm()); - watch( - () => [serverForm.value.username, serverForm.value.address], - ([username, address]) => { - if (!showEmbeddedSSHKeyGuide.value) return; - sshKeyCommandUsername.value = String(username || "").trim() || "用户名"; - sshKeyCommandHost.value = String(address || "").trim() || "服务器地址"; - }, + const sshKeyCommandUsername = computed( + () => String(serverForm.value.username || "").trim() || "用户名", + ); + const sshKeyCommandHost = computed( + () => String(serverForm.value.address || "").trim() || "服务器地址", ); async function fetchAdmin(path, options = {}) { @@ -604,8 +600,6 @@ export function useDashboard() { sshKeyFormError.value = ""; sshKeyPlatform.value = "windows"; sshKeyPassphraseVisible.value = false; - sshKeyCommandUsername.value = serverForm.value.username.trim() || "用户名"; - sshKeyCommandHost.value = serverForm.value.address.trim() || "服务器地址"; sshKeyRandomSuffix.value = createSSHKeyRandomSuffix(); sshKeyForm.value.name = sshKeyFileName.value; showEmbeddedSSHKeyGuide.value = options.embedded === true;