Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Commit

Permalink
try to fix switcher
Browse files Browse the repository at this point in the history
  • Loading branch information
IncognitoTGT committed Apr 2, 2024
1 parent c7dbd10 commit f90aa23
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 56 deletions.
128 changes: 73 additions & 55 deletions src/main-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
Expand Down Expand Up @@ -85,65 +86,82 @@ export default function MainLayout() {
/>
Ephemeral {packageJson.version}
</DialogTitle>
<DialogDescription className="items-center justify-start text-foreground">
Ephemeral is a powerful proxy with Ultraviolet and other
features, made by the z1g Project.
<br />
Ephemeral uses the following things:
<br />
<ul className="list-inside list-disc">
{projectsUsed.map((project, key) => (
<li key={key}>
<a
href={project.url}
className="inline font-medium text-primary underline-offset-4 hover:underline"
>
{project.name}
</a>
</li>
))}
</ul>
Developers:
<br />
<ul className="list-inside list-disc">
{developers.map((developer, key) => (
<li key={key}>
<a
href={`https://github.com/${developer}`}
className="inline font-medium text-primary underline-offset-4 hover:underline"
>
{developer}
</a>
</li>
))}
</ul>
<br />
Copyright 2024 z1g Project.{" "}
{data.sha && data.commit ? (
<span>
Last commit was on{" "}
</DialogHeader>
<DialogDescription className="items-center justify-start text-foreground">
Ephemeral is a powerful proxy with Ultraviolet and other features,
made by the z1g Project.
<br />
Ephemeral uses the following things:
<br />
<ul className="list-inside list-disc">
{projectsUsed.map((project, key) => (
<li key={key}>
<a
href={data?.html_url}
target="_blank"
rel="noreferrer"
href={project.url}
className="inline font-medium text-primary underline-offset-4 hover:underline"
>
{new Date(
data?.commit?.committer.date,
).toLocaleDateString()}{" "}
by {data?.commit?.author.name}.
{project.name}
</a>
<br />
Commit SHA: {data.sha.slice(0, 7)}
</span>
) : (
"No commit information available."
)}
<br />
This version of Ephemeral was built on{" "}
{__BUILD_DATE__.toLocaleString()}
</DialogDescription>
</DialogHeader>
</li>
))}
</ul>
Developers:
<br />
<ul className="list-inside list-disc">
{developers.map((developer, key) => (
<li key={key}>
<a
href={`https://github.com/${developer}`}
className="inline font-medium text-primary underline-offset-4 hover:underline"
>
{developer}
</a>
</li>
))}
</ul>
<br />
Copyright 2024 z1g Project.{" "}
{data.sha && data.commit ? (
<span>
Last commit was on{" "}
<a
href={data?.html_url}
target="_blank"
rel="noreferrer"
className="inline font-medium text-primary underline-offset-4 hover:underline"
>
{new Date(
data?.commit?.committer.date,
).toLocaleDateString()}{" "}
by {data?.commit?.author.name}.
</a>
<br />
Commit SHA: {data.sha.slice(0, 7)}
</span>
) : (
"No commit information available."
)}
<br />
This version of Ephemeral was built on{" "}
{__BUILD_DATE__.toLocaleString()}
</DialogDescription>
<DialogFooter className="flex items-end justify-end">
<Button asChild variant="outline" size="icon">
<a
href="https://github.com/z1g-project/ephemeral"
className="[&>svg]:size-5"
target="_blank"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="currentColor"
>
<path d="M5.88401 18.6533C5.58404 18.4526 5.32587 18.1975 5.0239 17.8369C4.91473 17.7065 4.47283 17.1524 4.55811 17.2583C4.09533 16.6833 3.80296 16.417 3.50156 16.3089C2.9817 16.1225 2.7114 15.5499 2.89784 15.0301C3.08428 14.5102 3.65685 14.2399 4.17672 14.4263C4.92936 14.6963 5.43847 15.1611 6.12425 16.0143C6.03025 15.8974 6.46364 16.441 6.55731 16.5529C6.74784 16.7804 6.88732 16.9182 6.99629 16.9911C7.20118 17.1283 7.58451 17.1874 8.14709 17.1311C8.17065 16.7489 8.24136 16.3783 8.34919 16.0358C5.38097 15.3104 3.70116 13.3952 3.70116 9.63971C3.70116 8.40085 4.0704 7.28393 4.75917 6.3478C4.5415 5.45392 4.57433 4.37284 5.06092 3.15636C5.1725 2.87739 5.40361 2.66338 5.69031 2.57352C5.77242 2.54973 5.81791 2.53915 5.89878 2.52673C6.70167 2.40343 7.83573 2.69705 9.31449 3.62336C10.181 3.41879 11.0885 3.315 12.0012 3.315C12.9129 3.315 13.8196 3.4186 14.6854 3.62277C16.1619 2.69 17.2986 2.39649 18.1072 2.52651C18.1919 2.54013 18.2645 2.55783 18.3249 2.57766C18.6059 2.66991 18.8316 2.88179 18.9414 3.15636C19.4279 4.37256 19.4608 5.45344 19.2433 6.3472C19.9342 7.28337 20.3012 8.39208 20.3012 9.63971C20.3012 13.3968 18.627 15.3048 15.6588 16.032C15.7837 16.447 15.8496 16.9105 15.8496 17.4121C15.8496 18.0765 15.8471 18.711 15.8424 19.4225C15.8412 19.6127 15.8397 19.8159 15.8375 20.1281C16.2129 20.2109 16.5229 20.5077 16.6031 20.9089C16.7114 21.4504 16.3602 21.9773 15.8186 22.0856C14.6794 22.3134 13.8353 21.5538 13.8353 20.5611C13.8353 20.4708 13.836 20.3417 13.8375 20.1145C13.8398 19.8015 13.8412 19.599 13.8425 19.4094C13.8471 18.7019 13.8496 18.0716 13.8496 17.4121C13.8496 16.7148 13.6664 16.2602 13.4237 16.051C12.7627 15.4812 13.0977 14.3973 13.965 14.2999C16.9314 13.9666 18.3012 12.8177 18.3012 9.63971C18.3012 8.68508 17.9893 7.89571 17.3881 7.23559C17.1301 6.95233 17.0567 6.54659 17.199 6.19087C17.3647 5.77663 17.4354 5.23384 17.2941 4.57702L17.2847 4.57968C16.7928 4.71886 16.1744 5.0198 15.4261 5.5285C15.182 5.69438 14.8772 5.74401 14.5932 5.66413C13.7729 5.43343 12.8913 5.315 12.0012 5.315C11.111 5.315 10.2294 5.43343 9.40916 5.66413C9.12662 5.74359 8.82344 5.69492 8.57997 5.53101C7.8274 5.02439 7.2056 4.72379 6.71079 4.58376C6.56735 5.23696 6.63814 5.77782 6.80336 6.19087C6.94565 6.54659 6.87219 6.95233 6.61423 7.23559C6.01715 7.8912 5.70116 8.69376 5.70116 9.63971C5.70116 12.8116 7.07225 13.9683 10.023 14.2999C10.8883 14.3971 11.2246 15.4769 10.5675 16.0482C10.3751 16.2156 10.1384 16.7802 10.1384 17.4121V20.5611C10.1384 21.5474 9.30356 22.2869 8.17878 22.09C7.63476 21.9948 7.27093 21.4766 7.36613 20.9326C7.43827 20.5204 7.75331 20.2116 8.13841 20.1276V19.1381C7.22829 19.1994 6.47656 19.0498 5.88401 18.6533Z" />
</svg>
</a>
</Button>
</DialogFooter>
</DialogContent>
</Dialog>
</section>
Expand Down
3 changes: 3 additions & 0 deletions src/pages/settings/ProxySettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
SelectContent,
SelectItem,
} from "@/components/ui/select";
import { unregisterServiceWorker } from "@/utils/swUtil";
export default function ProxySettings() {
const { toast } = useToast();
const [config, reset, loading] = useConfig("proxy"); // Using the useConfig hook to get proxy settings
Expand All @@ -35,13 +36,15 @@ export default function ProxySettings() {
const handleSave = () => {
if (wispServerRef.current)
config && (config.wispServer = wispServerRef.current?.value);
unregisterServiceWorker();
toast({
title: "Proxy Settings have been saved",
});
setTimeout(window.location.reload.bind(window.location), 1000);
};
const handleReset = () => {
reset();
unregisterServiceWorker();
toast({
title: "Proxy Settings have been reset",
variant: "destructive",
Expand Down
2 changes: 1 addition & 1 deletion src/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ export default function AppRoutes() {
const [config] = useConfig("proxy");
useEffect(() => {
try {
registerRemoteListener(navigator.serviceWorker.controller!);
SetTransport(transports[config.transport], {
wisp: config.wispServer,
});
registerRemoteListener(navigator.serviceWorker.controller!);
} catch (e) {
console.error(e);
}
Expand Down

0 comments on commit f90aa23

Please sign in to comment.