feat: add SSH password authentication support

This commit is contained in:
t8y2
2026-04-29 20:36:07 +08:00
parent 2ba252bb07
commit 3e1ab0b3a4
13 changed files with 532 additions and 14 deletions
@@ -39,6 +39,7 @@ const defaultForm = (): Omit<ConnectionConfig, "id"> => ({
ssh_host: "",
ssh_port: 22,
ssh_user: "",
ssh_password: "",
ssh_key_path: "",
});
@@ -59,6 +60,7 @@ watch(() => props.editConfig, (config) => {
ssh_host: config.ssh_host || "",
ssh_port: config.ssh_port || 22,
ssh_user: config.ssh_user || "",
ssh_password: config.ssh_password || "",
ssh_key_path: config.ssh_key_path || "",
};
} else {
@@ -216,6 +218,10 @@ watch([() => editingId.value, () => open.value], () => {
<Label class="text-right text-xs">{{ t('connection.sshUser') }}</Label>
<Input v-model="form.ssh_user" class="col-span-3" placeholder="root" />
</div>
<div class="grid grid-cols-4 items-center gap-4">
<Label class="text-right text-xs">{{ t('connection.sshPassword') }}</Label>
<Input v-model="form.ssh_password" type="password" class="col-span-3" :placeholder="t('connection.sshPasswordPlaceholder')" />
</div>
<div class="grid grid-cols-4 items-center gap-4">
<Label class="text-right text-xs">{{ t('connection.sshKeyPath') }}</Label>
<Input v-model="form.ssh_key_path" class="col-span-3" placeholder="~/.ssh/id_rsa" />
+2
View File
@@ -36,6 +36,8 @@ export default {
sshEnable: "Connect via SSH tunnel",
sshHost: "SSH Host",
sshUser: "SSH User",
sshPassword: "SSH Password",
sshPasswordPlaceholder: "Leave empty to use key",
sshKeyPath: "Key Path",
},
editor: {
+2
View File
@@ -36,6 +36,8 @@ export default {
sshEnable: "通过 SSH 隧道连接",
sshHost: "SSH 主机",
sshUser: "SSH 用户",
sshPassword: "SSH 密码",
sshPasswordPlaceholder: "留空则使用密钥",
sshKeyPath: "密钥路径",
},
editor: {
+1
View File
@@ -13,6 +13,7 @@ export interface ConnectionConfig {
ssh_host?: string;
ssh_port?: number;
ssh_user?: string;
ssh_password?: string;
ssh_key_path?: string;
}