同步服务器配置中的SSH引导目标
将SSH引导目标、密钥文件名和公钥安装命令改为直接读取当前服务器地址与SSH用户,避免输入后仍显示占位符。
This commit is contained in:
parent
7460b064e6
commit
4845249f46
@ -43,8 +43,6 @@ export function useDashboard() {
|
|||||||
const sshKeyFormError = ref("");
|
const sshKeyFormError = ref("");
|
||||||
const sshKeyPlatform = ref("windows");
|
const sshKeyPlatform = ref("windows");
|
||||||
const sshKeyPassphraseVisible = ref(false);
|
const sshKeyPassphraseVisible = ref(false);
|
||||||
const sshKeyCommandUsername = ref("用户名");
|
|
||||||
const sshKeyCommandHost = ref("服务器地址");
|
|
||||||
const sshKeyRandomSuffix = ref(createSSHKeyRandomSuffix());
|
const sshKeyRandomSuffix = ref(createSSHKeyRandomSuffix());
|
||||||
const showSettings = ref(false);
|
const showSettings = ref(false);
|
||||||
const settingsSaving = ref(false);
|
const settingsSaving = ref(false);
|
||||||
@ -311,13 +309,11 @@ export function useDashboard() {
|
|||||||
const serverForm = ref(createEmptyServerForm());
|
const serverForm = ref(createEmptyServerForm());
|
||||||
const sshKeyForm = ref(createEmptySSHKeyForm());
|
const sshKeyForm = ref(createEmptySSHKeyForm());
|
||||||
|
|
||||||
watch(
|
const sshKeyCommandUsername = computed(
|
||||||
() => [serverForm.value.username, serverForm.value.address],
|
() => String(serverForm.value.username || "").trim() || "用户名",
|
||||||
([username, address]) => {
|
);
|
||||||
if (!showEmbeddedSSHKeyGuide.value) return;
|
const sshKeyCommandHost = computed(
|
||||||
sshKeyCommandUsername.value = String(username || "").trim() || "用户名";
|
() => String(serverForm.value.address || "").trim() || "服务器地址",
|
||||||
sshKeyCommandHost.value = String(address || "").trim() || "服务器地址";
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
|
|
||||||
async function fetchAdmin(path, options = {}) {
|
async function fetchAdmin(path, options = {}) {
|
||||||
@ -604,8 +600,6 @@ export function useDashboard() {
|
|||||||
sshKeyFormError.value = "";
|
sshKeyFormError.value = "";
|
||||||
sshKeyPlatform.value = "windows";
|
sshKeyPlatform.value = "windows";
|
||||||
sshKeyPassphraseVisible.value = false;
|
sshKeyPassphraseVisible.value = false;
|
||||||
sshKeyCommandUsername.value = serverForm.value.username.trim() || "用户名";
|
|
||||||
sshKeyCommandHost.value = serverForm.value.address.trim() || "服务器地址";
|
|
||||||
sshKeyRandomSuffix.value = createSSHKeyRandomSuffix();
|
sshKeyRandomSuffix.value = createSSHKeyRandomSuffix();
|
||||||
sshKeyForm.value.name = sshKeyFileName.value;
|
sshKeyForm.value.name = sshKeyFileName.value;
|
||||||
showEmbeddedSSHKeyGuide.value = options.embedded === true;
|
showEmbeddedSSHKeyGuide.value = options.embedded === true;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user