From d54044d4f7168649bbd7e6e8e8a3676088e2acdb Mon Sep 17 00:00:00 2001 From: "Visal .In" Date: Wed, 7 Aug 2024 13:31:24 +0700 Subject: [PATCH] feat: save local sqlite session (#133) * feat: local sqlite session * ask for permission if there is no permission before * restructure and optimize page that does not require theme --- src/app/{ => (public)}/about/page.tsx | 0 .../docs/connect-turso/page.mdx | 0 .../docs/connect-valtown/page.mdx | 0 .../docs/embed-iframe-client/page.mdx | 0 src/app/{ => (public)}/docs/layout.tsx | 0 src/app/{ => (public)}/docs/page.mdx | 0 .../docs/temporary-session/page.mdx | 0 src/app/(public)/layout.tsx | 22 ++++ .../learn/sqlite/indexing/page.mdx | 0 .../learn/sqlite/introduction/page.mdx | 0 .../{ => (public)}/learn/sqlite/layout.tsx | 0 .../login/github/callback/route.ts | 0 src/app/{ => (public)}/login/github/route.ts | 0 .../login/google/callback/route.ts | 0 src/app/{ => (public)}/login/google/route.ts | 0 src/app/{ => (public)}/login/page.tsx | 0 src/app/{ => (public)}/logout/route.tsx | 0 src/app/{ => (public)}/page.tsx | 0 src/app/{ => (public)}/playground/page.tsx | 0 src/app/{ => (public)}/privacy/page.tsx | 0 src/app/{ => (public)}/terms/page.tsx | 0 .../client/[[...driver]]/page-client.tsx | 0 .../client/[[...driver]]/page.tsx | 0 src/app/{ => (theme)}/client/layout.tsx | 0 .../{ => (theme)}/client/r/page-client.tsx | 2 +- src/app/{ => (theme)}/client/r/page.tsx | 2 +- .../client/s/[[...driver]]/page-client.tsx | 2 +- .../client/s/[[...driver]]/page.tsx | 0 .../client/temp_sess/page-client.tsx | 0 .../{ => (theme)}/client/temp_sess/page.tsx | 0 .../{ => (theme)}/connect/connection-list.tsx | 2 +- .../connect/connection-string-input.tsx | 10 ++ .../{ => (theme)}/connect/driver-dropdown.tsx | 22 +++- src/app/{ => (theme)}/connect/page-client.tsx | 0 src/app/{ => (theme)}/connect/page.tsx | 0 .../{ => (theme)}/connect/quick-connect.tsx | 0 .../connect/saved-connection-card.tsx | 4 +- .../connect/saved-connection-config.tsx | 2 +- .../connect/saved-connection-content.tsx | 0 .../connect/saved-connection-storage.ts | 35 +++++- .../connect/saved-connection-type.tsx | 2 +- .../connect/saved-connection.tsx | 11 +- .../connect/saved-edit-connection.tsx | 0 .../connect/saved-remove-connection.tsx | 0 src/app/{ => (theme)}/embed/sqlite/page.tsx | 0 src/app/(theme)/layout.tsx | 30 +++++ .../playground/client/page-client.tsx | 31 ++++- .../{ => (theme)}/playground/client/page.tsx | 0 src/app/api/database/[database_id]/route.ts | 2 +- src/app/api/database/route.ts | 2 +- src/app/api/databases/route.ts | 2 +- src/app/api/temp_ops/[session_id]/route.ts | 2 +- src/app/layout.tsx | 21 +--- src/components/filehandler-picker.tsx | 106 ++++++++++++++++++ src/context/connection-config-provider.tsx | 2 +- src/hooks/use-connect.ts | 2 +- src/indexdb.ts | 9 +- src/lib/api-response-types.ts | 2 +- src/lib/api/fetch-databases.ts | 2 +- 59 files changed, 281 insertions(+), 48 deletions(-) rename src/app/{ => (public)}/about/page.tsx (100%) rename src/app/{ => (public)}/docs/connect-turso/page.mdx (100%) rename src/app/{ => (public)}/docs/connect-valtown/page.mdx (100%) rename src/app/{ => (public)}/docs/embed-iframe-client/page.mdx (100%) rename src/app/{ => (public)}/docs/layout.tsx (100%) rename src/app/{ => (public)}/docs/page.mdx (100%) rename src/app/{ => (public)}/docs/temporary-session/page.mdx (100%) create mode 100644 src/app/(public)/layout.tsx rename src/app/{ => (public)}/learn/sqlite/indexing/page.mdx (100%) rename src/app/{ => (public)}/learn/sqlite/introduction/page.mdx (100%) rename src/app/{ => (public)}/learn/sqlite/layout.tsx (100%) rename src/app/{ => (public)}/login/github/callback/route.ts (100%) rename src/app/{ => (public)}/login/github/route.ts (100%) rename src/app/{ => (public)}/login/google/callback/route.ts (100%) rename src/app/{ => (public)}/login/google/route.ts (100%) rename src/app/{ => (public)}/login/page.tsx (100%) rename src/app/{ => (public)}/logout/route.tsx (100%) rename src/app/{ => (public)}/page.tsx (100%) rename src/app/{ => (public)}/playground/page.tsx (100%) rename src/app/{ => (public)}/privacy/page.tsx (100%) rename src/app/{ => (public)}/terms/page.tsx (100%) rename src/app/{ => (theme)}/client/[[...driver]]/page-client.tsx (100%) rename src/app/{ => (theme)}/client/[[...driver]]/page.tsx (100%) rename src/app/{ => (theme)}/client/layout.tsx (100%) rename src/app/{ => (theme)}/client/r/page-client.tsx (92%) rename src/app/{ => (theme)}/client/r/page.tsx (92%) rename src/app/{ => (theme)}/client/s/[[...driver]]/page-client.tsx (94%) rename src/app/{ => (theme)}/client/s/[[...driver]]/page.tsx (100%) rename src/app/{ => (theme)}/client/temp_sess/page-client.tsx (100%) rename src/app/{ => (theme)}/client/temp_sess/page.tsx (100%) rename src/app/{ => (theme)}/connect/connection-list.tsx (99%) rename src/app/{ => (theme)}/connect/connection-string-input.tsx (87%) rename src/app/{ => (theme)}/connect/driver-dropdown.tsx (80%) rename src/app/{ => (theme)}/connect/page-client.tsx (100%) rename src/app/{ => (theme)}/connect/page.tsx (100%) rename src/app/{ => (theme)}/connect/quick-connect.tsx (100%) rename src/app/{ => (theme)}/connect/saved-connection-card.tsx (93%) rename src/app/{ => (theme)}/connect/saved-connection-config.tsx (98%) rename src/app/{ => (theme)}/connect/saved-connection-content.tsx (100%) rename src/app/{ => (theme)}/connect/saved-connection-storage.ts (91%) rename src/app/{ => (theme)}/connect/saved-connection-type.tsx (94%) rename src/app/{ => (theme)}/connect/saved-connection.tsx (92%) rename src/app/{ => (theme)}/connect/saved-edit-connection.tsx (100%) rename src/app/{ => (theme)}/connect/saved-remove-connection.tsx (100%) rename src/app/{ => (theme)}/embed/sqlite/page.tsx (100%) create mode 100644 src/app/(theme)/layout.tsx rename src/app/{ => (theme)}/playground/client/page-client.tsx (86%) rename src/app/{ => (theme)}/playground/client/page.tsx (100%) create mode 100644 src/components/filehandler-picker.tsx diff --git a/src/app/about/page.tsx b/src/app/(public)/about/page.tsx similarity index 100% rename from src/app/about/page.tsx rename to src/app/(public)/about/page.tsx diff --git a/src/app/docs/connect-turso/page.mdx b/src/app/(public)/docs/connect-turso/page.mdx similarity index 100% rename from src/app/docs/connect-turso/page.mdx rename to src/app/(public)/docs/connect-turso/page.mdx diff --git a/src/app/docs/connect-valtown/page.mdx b/src/app/(public)/docs/connect-valtown/page.mdx similarity index 100% rename from src/app/docs/connect-valtown/page.mdx rename to src/app/(public)/docs/connect-valtown/page.mdx diff --git a/src/app/docs/embed-iframe-client/page.mdx b/src/app/(public)/docs/embed-iframe-client/page.mdx similarity index 100% rename from src/app/docs/embed-iframe-client/page.mdx rename to src/app/(public)/docs/embed-iframe-client/page.mdx diff --git a/src/app/docs/layout.tsx b/src/app/(public)/docs/layout.tsx similarity index 100% rename from src/app/docs/layout.tsx rename to src/app/(public)/docs/layout.tsx diff --git a/src/app/docs/page.mdx b/src/app/(public)/docs/page.mdx similarity index 100% rename from src/app/docs/page.mdx rename to src/app/(public)/docs/page.mdx diff --git a/src/app/docs/temporary-session/page.mdx b/src/app/(public)/docs/temporary-session/page.mdx similarity index 100% rename from src/app/docs/temporary-session/page.mdx rename to src/app/(public)/docs/temporary-session/page.mdx diff --git a/src/app/(public)/layout.tsx b/src/app/(public)/layout.tsx new file mode 100644 index 00000000..9f702ae7 --- /dev/null +++ b/src/app/(public)/layout.tsx @@ -0,0 +1,22 @@ +import { Analytics } from "@vercel/analytics/react"; +import { Inter } from "next/font/google"; +import { Toaster } from "@/components/ui/sonner"; +import { Fragment } from "react"; +import Script from "next/script"; + +const inter = Inter({ subsets: ["latin"] }); + +export default async function RootLayout({ + children, +}: { + children: React.ReactNode; +}) { + return ( + + {children} + + +