feat(connection): allow revealing saved passwords
This commit is contained in:
1 parent
d55a708d6a
commit
609f2ef7c7
11 files changed
+588
-436
No files matched your search
@@ -3482,7 +3482,7 @@ function openExternalUrl(url: string) {
|
|||||||
<template v-if="mqAuthKind === 'token'">
|
<template v-if="mqAuthKind === 'token'">
|
||||||
<div class="grid grid-cols-4 items-center gap-4">
|
<div class="grid grid-cols-4 items-center gap-4">
|
||||||
<Label :class="connectionLabelClass">Token</Label>
|
<Label :class="connectionLabelClass">Token</Label>
|
||||||
<Input v-model="mqToken" type="password" class="col-span-3" />
|
<PasswordInput v-model="mqToken" class="col-span-3" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="mqAuthKind === 'basic'">
|
<template v-else-if="mqAuthKind === 'basic'">
|
||||||
@@ -3492,7 +3492,7 @@ function openExternalUrl(url: string) {
|
|||||||
</div>
|
</div>
|
||||||
<div class="grid grid-cols-4 items-center gap-4">
|
<div class="grid grid-cols-4 items-center gap-4">
|
||||||
<Label :class="connectionLabelClass">{{ t("connection.password") }}</Label>
|
<Label :class="connectionLabelClass">{{ t("connection.password") }}</Label>
|
||||||
<Input v-model="mqBasicPassword" type="password" class="col-span-3" />
|
<PasswordInput v-model="mqBasicPassword" class="col-span-3" />
|
||||||
</div>
|
</div>
|
||||||
<div v-if="mqSystemKind === 'kafka'" class="grid grid-cols-4 items-center gap-4">
|
<div v-if="mqSystemKind === 'kafka'" class="grid grid-cols-4 items-center gap-4">
|
||||||
<Label :class="connectionLabelClass">SASL Mechanism</Label>
|
<Label :class="connectionLabelClass">SASL Mechanism</Label>
|
||||||
@@ -3515,7 +3515,7 @@ function openExternalUrl(url: string) {
|
|||||||
</div>
|
</div>
|
||||||
<div class="grid grid-cols-4 items-center gap-4">
|
<div class="grid grid-cols-4 items-center gap-4">
|
||||||
<Label :class="connectionLabelClass">Value</Label>
|
<Label :class="connectionLabelClass">Value</Label>
|
||||||
<Input v-model="mqApiKeyValue" type="password" class="col-span-3" />
|
<PasswordInput v-model="mqApiKeyValue" class="col-span-3" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="mqAuthKind === 'oauth2'">
|
<template v-else-if="mqAuthKind === 'oauth2'">
|
||||||
@@ -3529,7 +3529,7 @@ function openExternalUrl(url: string) {
|
|||||||
</div>
|
</div>
|
||||||
<div class="grid grid-cols-4 items-center gap-4">
|
<div class="grid grid-cols-4 items-center gap-4">
|
||||||
<Label :class="connectionLabelClass">Client Secret</Label>
|
<Label :class="connectionLabelClass">Client Secret</Label>
|
||||||
<Input v-model="mqOauthClientSecret" type="password" class="col-span-3" />
|
<PasswordInput v-model="mqOauthClientSecret" class="col-span-3" />
|
||||||
</div>
|
</div>
|
||||||
<div class="grid grid-cols-4 items-center gap-4">
|
<div class="grid grid-cols-4 items-center gap-4">
|
||||||
<Label :class="connectionLabelClass">Audience</Label>
|
<Label :class="connectionLabelClass">Audience</Label>
|
||||||
|
|||||||
@@ -1,26 +1,35 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref } from "vue";
|
import { computed, ref } from "vue";
|
||||||
|
import { useI18n } from "vue-i18n";
|
||||||
import { Eye, EyeOff } from "@lucide/vue";
|
import { Eye, EyeOff } from "@lucide/vue";
|
||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
|
|
||||||
const model = defineModel<string>();
|
const model = defineModel<string>();
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = withDefaults(
|
||||||
placeholder?: string;
|
defineProps<{
|
||||||
disabled?: boolean;
|
placeholder?: string;
|
||||||
class?: string;
|
disabled?: boolean;
|
||||||
inputClass?: string;
|
class?: string;
|
||||||
showToggle?: boolean;
|
inputClass?: string;
|
||||||
}>();
|
showToggle?: boolean;
|
||||||
|
showLabel?: string;
|
||||||
|
hideLabel?: string;
|
||||||
|
}>(),
|
||||||
|
{
|
||||||
|
showToggle: true,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
const showToggle = computed(() => props.showToggle ?? true);
|
const { t } = useI18n();
|
||||||
|
const toggleLabel = computed(() => (visible.value ? props.hideLabel || t("common.hidePassword") : props.showLabel || t("common.showPassword")));
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div :class="props.class" class="relative">
|
<div :class="props.class" class="relative">
|
||||||
<Input v-model="model" :type="visible ? 'text' : 'password'" :placeholder="placeholder" :disabled="disabled" :class="[props.inputClass, showToggle ? 'pr-8' : undefined]" v-bind="$attrs" />
|
<Input v-model="model" :type="visible ? 'text' : 'password'" :placeholder="placeholder" :disabled="disabled" :class="[props.inputClass, props.showToggle ? 'pr-8' : undefined]" v-bind="$attrs" />
|
||||||
<button v-if="showToggle" type="button" :disabled="disabled" class="absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground disabled:pointer-events-none" tabindex="-1" @click="visible = !visible">
|
<button v-if="props.showToggle" type="button" :disabled="disabled" class="absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground disabled:pointer-events-none disabled:opacity-50" :aria-label="toggleLabel" :title="toggleLabel" @click="visible = !visible">
|
||||||
<Eye v-if="!visible" class="size-3.5" />
|
<Eye v-if="!visible" class="size-3.5" />
|
||||||
<EyeOff v-else class="size-3.5" />
|
<EyeOff v-else class="size-3.5" />
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -931,6 +931,8 @@ export default {
|
|||||||
more: "More",
|
more: "More",
|
||||||
decrease: "Decrease",
|
decrease: "Decrease",
|
||||||
increase: "Increase",
|
increase: "Increase",
|
||||||
|
showPassword: "Show password",
|
||||||
|
hidePassword: "Hide password",
|
||||||
done: "Done",
|
done: "Done",
|
||||||
connection: "Connection",
|
connection: "Connection",
|
||||||
database: "Database",
|
database: "Database",
|
||||||
|
|||||||
@@ -916,6 +916,8 @@ export default withEnglishFallback({
|
|||||||
remove: "Eliminar",
|
remove: "Eliminar",
|
||||||
retry: "Reintentar",
|
retry: "Reintentar",
|
||||||
more: "Más",
|
more: "Más",
|
||||||
|
showPassword: "Mostrar contraseña",
|
||||||
|
hidePassword: "Ocultar contraseña",
|
||||||
done: "Listo",
|
done: "Listo",
|
||||||
connection: "Conexión",
|
connection: "Conexión",
|
||||||
database: "Base de datos",
|
database: "Base de datos",
|
||||||
|
|||||||
@@ -932,6 +932,8 @@ export default withEnglishFallback({
|
|||||||
more: "Altro",
|
more: "Altro",
|
||||||
decrease: "Riduci",
|
decrease: "Riduci",
|
||||||
increase: "Aumenta",
|
increase: "Aumenta",
|
||||||
|
showPassword: "Mostra password",
|
||||||
|
hidePassword: "Nascondi password",
|
||||||
done: "Fatto",
|
done: "Fatto",
|
||||||
connection: "Connessione",
|
connection: "Connessione",
|
||||||
database: "Database",
|
database: "Database",
|
||||||
|
|||||||
@@ -914,6 +914,8 @@ export default withEnglishFallback({
|
|||||||
save: "保存",
|
save: "保存",
|
||||||
retry: "再試行",
|
retry: "再試行",
|
||||||
more: "もっと見る",
|
more: "もっと見る",
|
||||||
|
showPassword: "パスワードを表示",
|
||||||
|
hidePassword: "パスワードを隠す",
|
||||||
done: "完了",
|
done: "完了",
|
||||||
connection: "接続",
|
connection: "接続",
|
||||||
database: "データベース",
|
database: "データベース",
|
||||||
|
|||||||
@@ -925,6 +925,8 @@ export default withEnglishFallback({
|
|||||||
save: "Salvar",
|
save: "Salvar",
|
||||||
retry: "Tentar novamente",
|
retry: "Tentar novamente",
|
||||||
more: "Mais",
|
more: "Mais",
|
||||||
|
showPassword: "Mostrar senha",
|
||||||
|
hidePassword: "Ocultar senha",
|
||||||
done: "Concluído",
|
done: "Concluído",
|
||||||
copy: "Copiar",
|
copy: "Copiar",
|
||||||
import: "Importar",
|
import: "Importar",
|
||||||
|
|||||||
@@ -934,6 +934,8 @@ export default withEnglishFallback({
|
|||||||
more: "更多",
|
more: "更多",
|
||||||
decrease: "减小",
|
decrease: "减小",
|
||||||
increase: "增大",
|
increase: "增大",
|
||||||
|
showPassword: "显示密码",
|
||||||
|
hidePassword: "隐藏密码",
|
||||||
done: "完成",
|
done: "完成",
|
||||||
connection: "连接",
|
connection: "连接",
|
||||||
database: "数据库",
|
database: "数据库",
|
||||||
|
|||||||
@@ -917,6 +917,8 @@ export default withEnglishFallback({
|
|||||||
remove: "移除",
|
remove: "移除",
|
||||||
retry: "重試",
|
retry: "重試",
|
||||||
more: "更多",
|
more: "更多",
|
||||||
|
showPassword: "顯示密碼",
|
||||||
|
hidePassword: "隱藏密碼",
|
||||||
done: "完成",
|
done: "完成",
|
||||||
connection: "連線",
|
connection: "連線",
|
||||||
database: "資料庫",
|
database: "資料庫",
|
||||||
|
|||||||
+2
-2
@@ -72,8 +72,8 @@
|
|||||||
"leaflet": "^1.9.4",
|
"leaflet": "^1.9.4",
|
||||||
"marked": "^18.0.4",
|
"marked": "^18.0.4",
|
||||||
"pinia": "^3.0.0",
|
"pinia": "^3.0.0",
|
||||||
"reka-ui": "^2.9.8",
|
"reka-ui": "^2.10.1",
|
||||||
"shadcn-vue": "^2.7.3",
|
"shadcn-vue": "^2.7.4",
|
||||||
"shiki": "^4.2.0",
|
"shiki": "^4.2.0",
|
||||||
"splitpanes": "^4.1.2",
|
"splitpanes": "^4.1.2",
|
||||||
"sql-formatter": "^15.8.0",
|
"sql-formatter": "^15.8.0",
|
||||||
|
|||||||
Generated
+549
-420
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user