diff --git a/src/components/Loader.astro b/src/components/Loader.astro index fe1864b..0bf28b8 100644 --- a/src/components/Loader.astro +++ b/src/components/Loader.astro @@ -2,7 +2,6 @@ import { Settings } from "@utils/settings.ts"; import { SW } from "@utils/proxy.ts"; const settings = new Settings(); - window.settings = settings; const sw = new SW(); diff --git a/src/components/SettingsNav.astro b/src/components/SettingsNav.astro index cb8313c..6150295 100644 --- a/src/components/SettingsNav.astro +++ b/src/components/SettingsNav.astro @@ -5,7 +5,7 @@ import type { SettingsProps as Props } from "@utils/types.ts"; const { active } = Astro.props; ---
- + Proxy diff --git a/src/components/ui/Dropdown.astro b/src/components/ui/Dropdown.astro index f5c0d5b..f4f01b5 100644 --- a/src/components/ui/Dropdown.astro +++ b/src/components/ui/Dropdown.astro @@ -1,12 +1,11 @@ --- import type { DropdownOptions } from "@utils/types"; interface Props { - title?: string; id: string; options: DropdownOptions[]; } -const { title, id, options } = Astro.props; +const { id, options } = Astro.props; --- +
+ + + + diff --git a/src/pages/[...settings]/proxy.astro b/src/pages/[...settings]/proxy.astro deleted file mode 100644 index 0a944d3..0000000 --- a/src/pages/[...settings]/proxy.astro +++ /dev/null @@ -1,41 +0,0 @@ ---- -import SettingsLayout from "@layouts/SettingsLayout.astro"; -import Dropdown from "@components/ui/Dropdown.astro"; -import { SearchEngines, type DropdownOptions } from "@utils/types"; -const SearchEngineOptions: DropdownOptions[] = []; -Object.keys(SearchEngines).forEach((k) => SearchEngineOptions.push( - { name: k, value: SearchEngines[k] } -)); ---- - -
-

Proxy

-
-
-
-

Proxy Switcher

- -
-
-

Proxy Switcher

- -
-
-

Search Engine

- -
-
-
-
-
-
diff --git a/src/utils/proxy.ts b/src/utils/proxy.ts index ca860d4..ca1e5b5 100644 --- a/src/utils/proxy.ts +++ b/src/utils/proxy.ts @@ -48,12 +48,14 @@ class SW { return template.replace("%s", encodeURIComponent(input)); } - encodeURL(string: string, proxy: 'uv' | 'scram'): string { + encodeURL(string: string, proxy: 'uv' | 'sj'): string { const input = this.#search(string, "https://google.com/search?q=%s"); return proxy === 'uv' ? `${__uv$config.prefix}${__uv$config.encodeUrl!(input)}` : this.#scramjetController!.encodeUrl(input) } - async setTransport(transport?: 'epoxy' | 'libcurl') { + async setTransport(transport?: 'epoxy' | 'libcurl', get?: boolean) { + console.log('Setting transport'); + if (get) return this.#storageManager.getVal('transport'); this.#storageManager.setVal("transport", transport || this.#storageManager.getVal("transport") || 'epoxy'); switch(transport) { case 'epoxy': { diff --git a/src/utils/settings.ts b/src/utils/settings.ts index 2269422..8dab724 100644 --- a/src/utils/settings.ts +++ b/src/utils/settings.ts @@ -70,6 +70,8 @@ class Settings { ? document.documentElement.className = 'default' : document.documentElement.className = theme || this.#storageManager.getVal('theme'); } + + proxy(prox: 'uv' | 'sj') {} async *#init() { yield this.theme(this.#storageManager.getVal('theme') || 'default');