From 2220e33a1eccbf9652b594caccd3420a100d56a5 Mon Sep 17 00:00:00 2001
From: jarvis2f <137974272+jarvis2f@users.noreply.github.com>
Date: Tue, 7 Jan 2025 23:10:27 +0800
Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20feat:=20Optimize=20UI=20componen?=
=?UTF-8?q?ts=20and=20input=20logic?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
web/src/components/proxy-ping.tsx | 4 +--
web/src/components/proxys.tsx | 43 +++++++++++++++++-----------
web/src/components/settings-form.tsx | 26 +++++++++++++++--
web/src/components/ui/toaster.tsx | 4 +--
web/src/lib/types.ts | 1 +
5 files changed, 56 insertions(+), 22 deletions(-)
diff --git a/web/src/components/proxy-ping.tsx b/web/src/components/proxy-ping.tsx
index 3e1d874..5d2cfab 100644
--- a/web/src/components/proxy-ping.tsx
+++ b/web/src/components/proxy-ping.tsx
@@ -30,11 +30,11 @@ export default function ProxyPing({ accountId }: { accountId: string }) {
>
{isLoading && (
-
+
)}
{!isLoading && error && Connection error}
{!isLoading && data && (
-
+
{(data.ping * 1000).toFixed(0)} ms
)}
diff --git a/web/src/components/proxys.tsx b/web/src/components/proxys.tsx
index 4e69249..a02e953 100644
--- a/web/src/components/proxys.tsx
+++ b/web/src/components/proxys.tsx
@@ -25,6 +25,7 @@ import useSWRMutation from "swr/mutation";
import { request } from "@/lib/api";
import { toast } from "@/hooks/use-toast";
import ProxyPing from "@/components/proxy-ping";
+import { Label } from "./ui/label";
export interface ProxysProps {
enableSelect?: boolean;
@@ -231,34 +232,46 @@ export default function Proxys({
{/* Radio buttons for proxy type */}
- {/* Other input fields */}
-
+
-
+
+
-
- Authentication (optional)
-
+
-
-
+
Password
{
e.preventDefault();
@@ -51,6 +55,24 @@ export default function SettingsForm() {
These settings will be applied to all accounts.
+
+
Your root path
+
+
+ {account?.rootPath}
+
+
+
+
Unique Only
diff --git a/web/src/components/ui/toaster.tsx b/web/src/components/ui/toaster.tsx
index 364b797..deee0d7 100644
--- a/web/src/components/ui/toaster.tsx
+++ b/web/src/components/ui/toaster.tsx
@@ -18,14 +18,14 @@ export function Toaster() {
{toasts.map(function ({ id, title, description, action, ...props }) {
return (
-
+
e.stopPropagation()}>
{title && {title}}
{description && (
{description}
)}
{action}
-
+
e.stopPropagation()} />
);
})}
diff --git a/web/src/lib/types.ts b/web/src/lib/types.ts
index ff08f85..f0c2598 100644
--- a/web/src/lib/types.ts
+++ b/web/src/lib/types.ts
@@ -8,6 +8,7 @@ export type TelegramAccount = {
status: "active" | "inactive";
lastAuthorizationState?: TelegramObject;
proxy?: string;
+ rootPath: string;
};
export type TelegramChat = {