diff --git a/app/components/combobox.tsx b/app/components/combobox.tsx
index 942b2ce..eb63e97 100644
--- a/app/components/combobox.tsx
+++ b/app/components/combobox.tsx
@@ -39,7 +39,12 @@ export function Combobox(props: {
}
props.options.push(inputRef.current.value)
props.addOption(props.options)
+ }
+ function handleKeyDown(event: any) {
+ if (event.key === "Enter") {
+ onAddOption(event);
+ }
}
const entityType = props.type ?? ""
@@ -92,7 +97,7 @@ export function Combobox(props: {
Create a new {entityType}?
-
+
diff --git a/app/page.tsx b/app/page.tsx
index fe29b9c..1135c92 100644
--- a/app/page.tsx
+++ b/app/page.tsx
@@ -5,7 +5,7 @@ export default function Page() {
diff --git a/app/sandbox/CypherInput.tsx b/app/sandbox/CypherInput.tsx
index 01b6945..cfb7d7b 100644
--- a/app/sandbox/CypherInput.tsx
+++ b/app/sandbox/CypherInput.tsx
@@ -50,7 +50,12 @@ export function CypherInput(props: { graphs: string[], onSubmit: (graph: string,
const [graphs, addGraph] = useState(props.graphs);
// A function that handles the change event of the input box
- function handleChange(event: any) {
+ async function handleChange(event: any) {
+
+ if (event.key === "Enter") {
+ await handleSubmit(event);
+ }
+
// Get the new value of the input box
const value = event.target.value;
@@ -72,13 +77,14 @@ export function CypherInput(props: { graphs: string[], onSubmit: (graph: string,
setResults(newResults.data?? [])
}
}
+
// Return the JSX element that renders the input box and a submit button
return (
<>
{/* Show an error message if the query is invalid */}
diff --git a/app/sandbox/DatabaseDetails.tsx b/app/sandbox/DatabaseDetails.tsx
index e963e38..315f8f5 100644
--- a/app/sandbox/DatabaseDetails.tsx
+++ b/app/sandbox/DatabaseDetails.tsx
@@ -8,6 +8,7 @@ export function DatabaseDetails(props: { sandbox: Sandbox, onDelete: () => void
let sandbox = props.sandbox
let redisURL = `redis://${sandbox.password}@${sandbox.host}:${sandbox.port}`
+ let redisURLMasked = `redis://********@${sandbox.host}:${sandbox.port}`
return (
<>
-
-
+
+
>
);
}
diff --git a/app/sandbox/DatabaseLine.tsx b/app/sandbox/DatabaseLine.tsx
index 960064d..9343963 100644
--- a/app/sandbox/DatabaseLine.tsx
+++ b/app/sandbox/DatabaseLine.tsx
@@ -1,11 +1,11 @@
-import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog"
import { Button } from "@/components/ui/button"
import { useToast } from "@/components/ui/use-toast"
-import { Sandbox } from "@/app/api/db/sandbox";
+import { useState } from "react";
-export function DatabaseLine(props: { label: string, value: string }) {
+export function DatabaseLine(props: { label: string, value: string, masked?: string }) {
const { toast } = useToast()
+ const [showPassword, setShowPassword] = useState(false);
function copyToClipboard(event: any) {
navigator.clipboard.writeText(event.target.innerText)
@@ -15,9 +15,13 @@ export function DatabaseLine(props: { label: string, value: string }) {
})
}
+ function showMasked() {
+ setShowPassword(!showPassword)
+ }
+
return (
{props.label}:
+
+ {props.masked &&
+
+ }
+
);
}