feat: create input for toggleable inputs like passwords/connectinstrings

This commit is contained in:
Marius
2024-06-08 11:55:05 +02:00
parent 936cf76a4c
commit d54c6e4ac9
12 changed files with 60 additions and 46 deletions

View File

@@ -1,3 +1,4 @@
import ToggleVisibilityInput from "@/components/shared/toggle-visibility-input";
import { Button } from "@/components/ui/button";
import {
Card,
@@ -80,7 +81,7 @@ export const ShowExternalPostgresCredentials = ({ postgresId }: Props) => {
const hostname = window.location.hostname;
const port = form.watch("externalPort") || data?.externalPort;
return `postgresql://${data?.databaseUser}:${'*'.repeat(data?.databasePassword.length || 8)}@${hostname}:${port}/${data?.databaseName}`;
return `postgresql://${data?.databaseUser}:${data?.databasePassword}@${hostname}:${port}/${data?.databaseName}`;
};
setConnectionUrl(buildConnectionUrl());
@@ -137,7 +138,7 @@ export const ShowExternalPostgresCredentials = ({ postgresId }: Props) => {
<div className="grid w-full gap-8">
<div className="flex flex-col gap-3">
<Label>External Host</Label>
<Input disabled value={connectionUrl} />
<ToggleVisibilityInput value={connectionUrl} />
</div>
</div>
)}