From 8af25343ccd8a0675c7d353fa3d17d735440c1ed Mon Sep 17 00:00:00 2001 From: t8y2 <1156263951@qq.com> Date: Mon, 15 Jun 2026 02:34:19 +0800 Subject: [PATCH] feat(ui): add password visibility toggle to all password inputs --- .../components/admin/DatabaseUserAdmin.vue | 5 ++-- .../desktop/src/components/auth/LoginPage.vue | 5 ++-- .../config/ConfigPassphraseDialog.vue | 5 ++-- .../connection/ConnectionDialog.vue | 23 ++++++++-------- .../editor/EditorSettingsDialog.vue | 19 +++++++------- .../src/components/ui/PasswordInput.vue | 26 +++++++++++++++++++ 6 files changed, 57 insertions(+), 26 deletions(-) create mode 100644 apps/desktop/src/components/ui/PasswordInput.vue diff --git a/apps/desktop/src/components/admin/DatabaseUserAdmin.vue b/apps/desktop/src/components/admin/DatabaseUserAdmin.vue index e4dc18515d..ceb223898f 100644 --- a/apps/desktop/src/components/admin/DatabaseUserAdmin.vue +++ b/apps/desktop/src/components/admin/DatabaseUserAdmin.vue @@ -6,6 +6,7 @@ import { Button } from "@/components/ui/button"; import { Badge } from "@/components/ui/badge"; import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from "@/components/ui/dialog"; import { Input } from "@/components/ui/input"; +import PasswordInput from "@/components/ui/PasswordInput.vue"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; import { useConnectionStore } from "@/stores/connectionStore"; import { useToast } from "@/composables/useToast"; @@ -502,7 +503,7 @@ onMounted(loadUsers); {{ t("userAdmin.allowLogin") }} {{ t("connection.password") }} - + {{ t("dangerDialog.cancel") }} @@ -518,7 +519,7 @@ onMounted(loadUsers); {{ t("userAdmin.changePassword") }} - + {{ t("dangerDialog.cancel") }} {{ t("userAdmin.previewSql") }} diff --git a/apps/desktop/src/components/auth/LoginPage.vue b/apps/desktop/src/components/auth/LoginPage.vue index 74778c9cb1..1d07b182e9 100644 --- a/apps/desktop/src/components/auth/LoginPage.vue +++ b/apps/desktop/src/components/auth/LoginPage.vue @@ -3,6 +3,7 @@ import { ref } from "vue"; import { useI18n } from "vue-i18n"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; +import PasswordInput from "@/components/ui/PasswordInput.vue"; import { Lock, Loader2, ShieldCheck } from "@lucide/vue"; import AppLogo from "@/components/icons/AppLogo.vue"; @@ -70,11 +71,11 @@ async function submit() { - + - + {{ error }} diff --git a/apps/desktop/src/components/config/ConfigPassphraseDialog.vue b/apps/desktop/src/components/config/ConfigPassphraseDialog.vue index 1c8e2570a1..e7e6039ab2 100644 --- a/apps/desktop/src/components/config/ConfigPassphraseDialog.vue +++ b/apps/desktop/src/components/config/ConfigPassphraseDialog.vue @@ -4,6 +4,7 @@ import { useI18n } from "vue-i18n"; import { Lock } from "@lucide/vue"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; +import PasswordInput from "@/components/ui/PasswordInput.vue"; import { Label } from "@/components/ui/label"; import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from "@/components/ui/dialog"; @@ -76,12 +77,12 @@ const displayError = computed(() => error.value || props.externalError || ""); {{ t("configExport.passphrase") }} - + {{ t("configExport.passphraseConfirm") }} - + {{ displayError }} diff --git a/apps/desktop/src/components/connection/ConnectionDialog.vue b/apps/desktop/src/components/connection/ConnectionDialog.vue index 615505054c..237882f33b 100644 --- a/apps/desktop/src/components/connection/ConnectionDialog.vue +++ b/apps/desktop/src/components/connection/ConnectionDialog.vue @@ -6,6 +6,7 @@ import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from " import { Button } from "@/components/ui/button"; import { Badge } from "@/components/ui/badge"; import { Input } from "@/components/ui/input"; +import PasswordInput from "@/components/ui/PasswordInput.vue"; import { Label } from "@/components/ui/label"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; @@ -2257,7 +2258,7 @@ function openExternalUrl(url: string) { {{ t("connection.password") }} - + {{ t("connection.jdbcDriverPaths") }} @@ -2378,7 +2379,7 @@ function openExternalUrl(url: string) { {{ t("connection.password") }}{{ form.db_type === "access" ? "(可选)" : "" }} - + @@ -2424,7 +2425,7 @@ function openExternalUrl(url: string) { {{ t("connection.redisSentinelPassword") }} - + {{ t("connection.redisSentinelTls") }} @@ -2451,7 +2452,7 @@ function openExternalUrl(url: string) { {{ t("connection.password") }} - + {{ t("connection.redisKeySeparator") }} @@ -2486,7 +2487,7 @@ function openExternalUrl(url: string) { {{ t("connection.password") }} - + @@ -2528,7 +2529,7 @@ function openExternalUrl(url: string) { {{ t("connection.password") }} - + {{ t("connection.defaultDatabase") }} @@ -2578,7 +2579,7 @@ function openExternalUrl(url: string) { Auth Token - + @@ -2612,7 +2613,7 @@ function openExternalUrl(url: string) { {{ t("connection.password") }} - + @@ -3061,7 +3062,7 @@ function openExternalUrl(url: string) { {{ t("connection.sshPassword") }} - + {{ t("connection.sshKeyPath") }} @@ -3079,7 +3080,7 @@ function openExternalUrl(url: string) { {{ t("connection.sshKeyPassphrase") }} - + @@ -3124,7 +3125,7 @@ function openExternalUrl(url: string) { {{ t("connection.proxyPassword") }} - + diff --git a/apps/desktop/src/components/editor/EditorSettingsDialog.vue b/apps/desktop/src/components/editor/EditorSettingsDialog.vue index a5daa2da84..76c3f66a64 100644 --- a/apps/desktop/src/components/editor/EditorSettingsDialog.vue +++ b/apps/desktop/src/components/editor/EditorSettingsDialog.vue @@ -7,6 +7,7 @@ import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from "@/components/ui/dialog"; import { Input } from "@/components/ui/input"; +import PasswordInput from "@/components/ui/PasswordInput.vue"; import { Label } from "@/components/ui/label"; import { SearchableSelect } from "@/components/ui/searchable-select"; import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"; @@ -2055,7 +2056,7 @@ watch( {{ t("settings.syncPassword") }} - + {{ t("settings.syncSecretsPassphrase") }} - + {{ t("settings.syncSecretsPassphraseDescription") }} @@ -2121,7 +2122,7 @@ watch( {{ t("ai.provider") }} aiSelectProvider(v)"> - + @@ -2143,7 +2144,7 @@ watch( Authentication - + @@ -2155,7 +2156,7 @@ watch( {{ aiCredentialLabel }} - + @@ -2243,7 +2244,7 @@ watch( {{ t("ai.proxyUrl") }} - + @@ -2401,9 +2402,9 @@ watch( {{ t("auth.changePassword") }} {{ t("auth.changePasswordDescription") }} - - - + + + {{ passwordMessage }} diff --git a/apps/desktop/src/components/ui/PasswordInput.vue b/apps/desktop/src/components/ui/PasswordInput.vue new file mode 100644 index 0000000000..dbd5343cb3 --- /dev/null +++ b/apps/desktop/src/components/ui/PasswordInput.vue @@ -0,0 +1,26 @@ + + + + + + + + + + +
{{ error }}
{{ displayError }}
{{ t("settings.syncSecretsPassphraseDescription") }}
{{ t("auth.changePasswordDescription") }}
{{ passwordMessage }}