mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-29 00:09:52 +00:00
feat: add SSH password authentication support
This commit is contained in:
@@ -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" />
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -36,6 +36,8 @@ export default {
|
||||
sshEnable: "通过 SSH 隧道连接",
|
||||
sshHost: "SSH 主机",
|
||||
sshUser: "SSH 用户",
|
||||
sshPassword: "SSH 密码",
|
||||
sshPasswordPlaceholder: "留空则使用密钥",
|
||||
sshKeyPath: "密钥路径",
|
||||
},
|
||||
editor: {
|
||||
|
||||
@@ -13,6 +13,7 @@ export interface ConnectionConfig {
|
||||
ssh_host?: string;
|
||||
ssh_port?: number;
|
||||
ssh_user?: string;
|
||||
ssh_password?: string;
|
||||
ssh_key_path?: string;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user