diff --git a/cmd/sql-to-logsql/web/ui/src/components/docs/Docs.tsx b/cmd/sql-to-logsql/web/ui/src/components/docs/Docs.tsx index e9d22f8..6eed0c8 100644 --- a/cmd/sql-to-logsql/web/ui/src/components/docs/Docs.tsx +++ b/cmd/sql-to-logsql/web/ui/src/components/docs/Docs.tsx @@ -7,7 +7,7 @@ import {Badge} from "@/components/ui/badge.tsx"; export function Docs() { return ( - + Information about SQL to LogsQL @@ -112,4 +112,4 @@ export function Docs() { ) -} \ No newline at end of file +} diff --git a/cmd/sql-to-logsql/web/ui/src/components/sql-editor/SQLEditor.tsx b/cmd/sql-to-logsql/web/ui/src/components/sql-editor/SQLEditor.tsx index f3573e0..506acd7 100644 --- a/cmd/sql-to-logsql/web/ui/src/components/sql-editor/SQLEditor.tsx +++ b/cmd/sql-to-logsql/web/ui/src/components/sql-editor/SQLEditor.tsx @@ -16,13 +16,15 @@ import {COMPLETIONS} from "@/components/sql-editor/complections.ts"; import {CircleXIcon, CircleCheckBigIcon, PlayIcon, ListFilterIcon} from "lucide-react" import {Spinner} from "@/components/ui/spinner.tsx"; import {Badge} from "@/components/ui/badge.tsx"; +import {cn} from "@/lib/utils"; export interface SqlEditorProps { readonly onRun?: (sql: string) => void; readonly isLoading?: boolean; readonly error?: string; readonly success?: string; - readonly limit?: number + readonly limit?: number; + readonly className?: string; } export function SQLEditor({ @@ -31,6 +33,7 @@ export function SQLEditor({ error, success, limit, + className, }: SqlEditorProps) { const [value, setValue] = useState(DEFAULT_EXAMPLE_ID); const [sql, setSql] = useState(""); @@ -51,7 +54,7 @@ export function SQLEditor({ }, [value]); return ( - + SQL @@ -77,14 +80,13 @@ export function SQLEditor({ - + ) { + return ( + + ) +} + +function ResizablePanel({ + ...props +}: React.ComponentProps) { + return +} + +function ResizableHandle({ + withHandle, + className, + ...props +}: React.ComponentProps & { + withHandle?: boolean +}) { + return ( + div]:rotate-90", + className + )} + {...props} + > + {withHandle && ( +
+ +
+ )} +
+ ) +} + +export { ResizablePanelGroup, ResizablePanel, ResizableHandle } diff --git a/cmd/sql-to-logsql/web/ui/src/pages/main/Main.tsx b/cmd/sql-to-logsql/web/ui/src/pages/main/Main.tsx index 397c564..2e0093e 100644 --- a/cmd/sql-to-logsql/web/ui/src/pages/main/Main.tsx +++ b/cmd/sql-to-logsql/web/ui/src/pages/main/Main.tsx @@ -4,6 +4,7 @@ import {useCallback, useEffect, useState} from "react"; import { QueryResults } from "@/components/query-results"; import {toast} from "sonner"; import {Docs} from "@/components/docs"; +import {ResizableHandle, ResizablePanel, ResizablePanelGroup} from "@/components/ui/resizable"; const formatExecutionTime = (ms: number): string => { if (!Number.isFinite(ms) || ms < 0) { @@ -87,30 +88,52 @@ export function Main() { }, [bearerToken, endpointUrl, endpointReadOnly, endpointEnabled]); return ( -
-
-
- - -
- -
- +
+ + + + +
+
+ +
+ +
+
+ + + + +
+
+ + +
+ +
+
+
); }