diff --git a/next.config.js b/next.config.js index 924e07d..50cdca3 100644 --- a/next.config.js +++ b/next.config.js @@ -5,7 +5,7 @@ const nextConfig = { return [ { source: '/settings', - destination: '/settings/appearance', + destination: '/settings/proxy', permanent: false } ] diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 49b86eb..4fdd38e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3402,7 +3402,7 @@ snapshots: agent-base@6.0.2: dependencies: - debug: 4.3.1 + debug: 4.3.7 transitivePeerDependencies: - supports-color optional: true @@ -4076,7 +4076,7 @@ snapshots: dependencies: '@tootallnate/once': 1.1.2 agent-base: 6.0.2 - debug: 4.3.1 + debug: 4.3.7 transitivePeerDependencies: - supports-color optional: true @@ -4084,7 +4084,7 @@ snapshots: https-proxy-agent@5.0.1: dependencies: agent-base: 6.0.2 - debug: 4.3.1 + debug: 4.3.7 transitivePeerDependencies: - supports-color optional: true diff --git a/server.mjs b/server.mjs index 53fc609..3d579db 100644 --- a/server.mjs +++ b/server.mjs @@ -4,7 +4,11 @@ import next from "next"; const [app, listen] = new ChemicalServer({ default: "uv", uv: true, - rammerhead: false, + rammerhead: true, + experimental: { + scramjet: true, + meteor: true, + }, }); const port = process.env.PORT || 3000; const dev = process.env.NODE_ENV !== "production"; diff --git a/src/app/go/[...route]/page.tsx b/src/app/go/[...route]/page.tsx index dbdb0c0..c7a7546 100644 --- a/src/app/go/[...route]/page.tsx +++ b/src/app/go/[...route]/page.tsx @@ -37,8 +37,11 @@ export default function Route({ params }: { params: { route: string[] } }) { ref.current.src = await window.chemical.encode( atob(decodeURIComponent(route)), { + service: window.chemical.getStore("service"), autoHttps: true, - searchEngine: "https://www.google.com/search?q=%s", + searchEngine: + window.chemical.getStore("searchEngine") || + "https://www.google.com/search?q=%s", } ); } diff --git a/src/app/layout.tsx b/src/app/layout.tsx index c2ddd2c..696aef9 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -20,7 +20,7 @@ export default function RootLayout({ - + diff --git a/src/app/settings/layout.tsx b/src/app/settings/layout.tsx index 80639ad..e46f23a 100644 --- a/src/app/settings/layout.tsx +++ b/src/app/settings/layout.tsx @@ -1,7 +1,7 @@ "use client"; import { Button } from "@/components/ui/button"; -import { Users, Link, Palette, ArrowRightLeft } from "lucide-react"; +import { Users, Link, Palette, LockIcon } from "lucide-react"; import NextLink from "next/link"; import { usePathname } from "next/navigation"; @@ -13,6 +13,16 @@ export default function SettingsLayout({ return (
+ + + - - - + +
+ + +
+ + ); +} diff --git a/src/app/settings/wisp/page.tsx b/src/app/settings/wisp/page.tsx deleted file mode 100644 index f4c7cbb..0000000 --- a/src/app/settings/wisp/page.tsx +++ /dev/null @@ -1,102 +0,0 @@ -"use client"; - -import { zodResolver } from "@hookform/resolvers/zod"; -import { useForm } from "react-hook-form"; -import { z } from "zod"; - -import { Button } from "@/components/ui/button"; -import { - Form, - FormControl, - FormField, - FormItem, - FormLabel, - FormMessage, -} from "@/components/ui/form"; - -import { Input } from "@/components/ui/input"; -import { Separator } from "@/components/ui/separator"; -import { Save, RotateCcw } from "lucide-react"; -import { useEffect, useState } from "react"; -import { toast } from "sonner"; - -const formSchema = z.object({ - wispServer: z.string().url("Please provide a valid URL"), - description: z.string().optional(), -}); - -export default function WispSwitcher() { - const [submitting, setSubmitting] = useState(false); - const form = useForm>({ - resolver: zodResolver(formSchema), - defaultValues: { - wispServer: "", - }, - }); - - useEffect(() => { - const wispServer: string = window.chemical.getStore("wisp"); - const defaultWisp: string = - (location.protocol === "https:" ? "wss" : "ws") + - "://" + - location.host + - "/wisp/"; - form.setValue("wispServer", wispServer !== defaultWisp ? wispServer : ""); - }, []); - - function onSubmit(values: z.infer) { - setSubmitting(true); - - window.chemical.setStore("wisp", values.wispServer); - - setTimeout(() => { - setSubmitting(false); - toast.success("Settings saved"); - }, 1000); - } - - function onReset() { - form.reset(); - window.chemical.setStore("wisp", ""); - toast("Settings reset"); - } - - return ( -
-

Wisp

- -
-
- - ( - - Wisp Server Switcher - - - - - - )} - /> - - {} -
- - -
- - -
-
- ); -}