Skip to content

Commit

Permalink
feat: add cloudflare warning
Browse files Browse the repository at this point in the history
  • Loading branch information
invisal committed Jul 20, 2024
1 parent 1840d48 commit e8cf7c5
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@libsqlstudio/studio",
"version": "0.6.0",
"version": "0.6.1",
"private": false,
"scripts": {
"dev": "next dev",
Expand Down
3 changes: 2 additions & 1 deletion src/app/connect/quick-connect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
prefillConnectionString,
validateConnectionString,
} from "./saved-connection-storage";
import { RqliteInstruction } from "./saved-connection";
import { CloudflareWarning, RqliteInstruction } from "./saved-connection";
import ConnectionStringInput from "./connection-string-input";

export default function QuickConnect({
Expand Down Expand Up @@ -45,6 +45,7 @@ export default function QuickConnect({
onClose={onClose}
>
{driver === "rqlite" && <RqliteInstruction />}
{driver === "cloudflare-d1" && <CloudflareWarning />}

<ConnectionStringInput
autoFocus
Expand Down
13 changes: 13 additions & 0 deletions src/app/connect/saved-connection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ export function RqliteInstruction() {
);
}

export function CloudflareWarning() {
return (
<div className="bg-secondary p-4 mb-4 text-sm">
To bypass CORS (Cross-Origin Resource Sharing) restrictions, we will route
your request through our server. If you are fine with this, please
proceed.
</div>
);
}

export default function SaveConnection({
user,
driver,
Expand Down Expand Up @@ -95,6 +105,9 @@ export default function SaveConnection({
{step === "config" && (
<>
{driver === "rqlite" && storage === "local" && <RqliteInstruction />}
{driver === "cloudflare-d1" && storage === "local" && (
<CloudflareWarning />
)}
<SavedConnectionConfig
driver={driver}
onClose={onClose}
Expand Down
15 changes: 11 additions & 4 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const metadata: Metadata = {
"libsql",
"rqlite",
"sqlite",
"cloudflare d1",
"studio",
"browser",
"editor",
Expand Down Expand Up @@ -118,8 +119,9 @@ function HeroSection() {

<p className="text-center max-w-[700px] mx-auto mt-6 text-lg">
LibSQL Studio is a fully-featured, lightweight GUI client for managing
SQLite-based databases like Turso, LibSQL, and rqlite. It runs entirely
in your browser, so there&apos;s no need to download anything.
SQLite-based databases like Turso, LibSQL, Cloudflare D1 and rqlite. It
runs entirely in your browser, so there&apos;s no need to download
anything.
</p>

<div className="flex gap-4 justify-center mt-12">
Expand Down Expand Up @@ -147,9 +149,14 @@ function SupportDriver() {
className="h-16 rounded-xl"
alt="rqlite"
/>
<img src="/turso.jpeg" className="h-16 rounded-xl" alt="rqlite" />
<img src="/turso.jpeg" className="h-16 rounded-xl" alt="turso" />
<img
src="/cloudflare.png"
className="h-16 rounded-xl"
alt="cloudflare d1"
/>
<img src="/rqlite.png" className="h-16 rounded-xl" alt="rqlite" />
<img src="/valtown.svg" className="h-16 rounded-xl" alt="rqlite" />
<img src="/valtown.svg" className="h-16 rounded-xl" alt="valtown" />
</div>
</div>
</div>
Expand Down

0 comments on commit e8cf7c5

Please sign in to comment.