diff --git a/src/components/base/base-fieldset.tsx b/src/components/base/base-fieldset.tsx new file mode 100644 index 0000000..ba16118 --- /dev/null +++ b/src/components/base/base-fieldset.tsx @@ -0,0 +1,38 @@ +import React from "react"; +import { Box, styled } from "@mui/material"; + +type Props = { + label: string; + fontSize?: string; + width?: string; + padding?: string; + children?: React.ReactNode; +}; + +export const BaseFieldset: React.FC = (props: Props) => { + const Fieldset = styled(Box)(() => ({ + position: "relative", + border: "1px solid #bbb", + borderRadius: "5px", + width: props.width ?? "auto", + padding: props.padding ?? "15px", + })); + + const Label = styled("legend")(({ theme }) => ({ + position: "absolute", + top: "-10px", + left: props.padding ?? "15px", + backgroundColor: theme.palette.background.paper, + backgroundImage: + "linear-gradient(rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.16))", + color: theme.palette.text.primary, + fontSize: props.fontSize ?? "1em", + })); + + return ( +
+ + {props.children} +
+ ); +}; diff --git a/src/components/profile/profile-item.tsx b/src/components/profile/profile-item.tsx index bf3edf0..253c240 100644 --- a/src/components/profile/profile-item.tsx +++ b/src/components/profile/profile-item.tsx @@ -278,6 +278,7 @@ export const ProfileItem = (props: Props) => { {/* only if has url can it be updated */} {hasUrl && ( ((props, ref) => { onOk={onSave} > - - - {t("Current System Proxy")} - + {t("Enable status")} @@ -145,7 +136,7 @@ export const SysproxyViewer = forwardRef((props, ref) => { )} - + { const [editing, setEditing] = useState(false); const [editValue, setEditValue] = useState(value); + const { t } = useTranslation(); if (editing || onlyEdit) { return ( @@ -45,12 +47,12 @@ export const WebUIItem = (props: Props) => { size="small" value={editValue} onChange={(e) => setEditValue(e.target.value)} - placeholder={`Support %host %port %secret`} + placeholder={t("Support %host, %port, %secret")} autoComplete="off" /> { onChange(editValue); @@ -61,7 +63,7 @@ export const WebUIItem = (props: Props) => { { onCancel?.(); @@ -100,7 +102,7 @@ export const WebUIItem = (props: Props) => { /> onOpenUrl?.(value)} > @@ -108,7 +110,7 @@ export const WebUIItem = (props: Props) => { { setEditing(true); @@ -119,7 +121,7 @@ export const WebUIItem = (props: Props) => { diff --git a/src/components/setting/mods/web-ui-viewer.tsx b/src/components/setting/mods/web-ui-viewer.tsx index d8c900f..fe3f772 100644 --- a/src/components/setting/mods/web-ui-viewer.tsx +++ b/src/components/setting/mods/web-ui-viewer.tsx @@ -105,10 +105,10 @@ export const WebUIViewer = forwardRef((props, ref) => { > {!editing && webUIList.length === 0 && ( - Replace host, port, secret with "%host" "%port" "%secret" + {t("Replace host, port, secret with %host, %port, %secret")} } /> diff --git a/src/components/test/test-item.tsx b/src/components/test/test-item.tsx index 46ed243..6a56631 100644 --- a/src/components/test/test-item.tsx +++ b/src/components/test/test-item.tsx @@ -175,7 +175,7 @@ export const TestItem = (props: Props) => { ":hover": { bgcolor: alpha(palette.primary.main, 0.15) }, })} > - Check + {t("Test")} )} diff --git a/src/locales/en.json b/src/locales/en.json index 32bc925..904d7d7 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -90,6 +90,7 @@ "Update At": "Update At", "Logs": "Logs", + "Pause": "Pause", "Clear": "Clear", "Test": "Test", @@ -130,13 +131,13 @@ "Enable status": "Enable Status:", "Enabled": "Enabled", "Disabled": "Disabled", - "Server Addr": "Server Addr:", + "Server Addr": "Server Addr: ", "Not available": "Not available", "Proxy Guard": "Proxy Guard", "Proxy Guard Info": "Enable to prevent other software from modifying the operating system's proxy settings", "Guard Duration": "Guard Duration", - "Proxy Bypass": "Proxy Bypass Settings:", - "Bypass": "Bypass:", + "Proxy Bypass": "Proxy Bypass Settings: ", + "Bypass": "Bypass: ", "Use PAC Mode": "Use PAC Mode", "PAC Script Content": "PAC Script Content", "PAC URL": "PAC URL: ", @@ -153,6 +154,9 @@ "External Controller": "External Controller", "Core Secret": "Core Secret", "Recommended": "Recommended", + "Open URL": "Open URL", + "Replace host, port, secret with %host, %port, %secret": "Replace host, port, secret with %host, %port, %secret", + "Support %host, %port, %secret": "Support %host, %port, %secret", "Clash Core": "Clash Core", "Upgrade": "Upgrade", "Restart": "Restart", diff --git a/src/locales/fa.json b/src/locales/fa.json index 2a42f10..7cedf2f 100644 --- a/src/locales/fa.json +++ b/src/locales/fa.json @@ -90,6 +90,7 @@ "Update At": "به‌روزرسانی در", "Logs": "لاگ‌ها", + "Pause": "توقف", "Clear": "پاک کردن", "Test": "آزمون", @@ -130,16 +131,16 @@ "Enable status": "وضعیت فعال", "Enabled": "توانایی فعال شد", "Disabled": "غیرفعال شد", - "Server Addr": "آدرس سرور", + "Server Addr": "آدرس سرور: ", "Not available": "غیر فعال شد", "Proxy Guard": "محافظ پراکسی", "Proxy Guard Info": "امکان جلوگیری از نرم‌افزارهای دیگر از تغییر تنظیمات پروکسی سیستم عامل را فعال کنید", "Guard Duration": "مدت محافظت", - "Proxy Bypass": "دور زدن پراکسی", - "Bypass": "دور زدن", + "Proxy Bypass": "دور زدن پراکسی: ", + "Bypass": "دور زدن: ", "Use PAC Mode": "استفاده از حالت PAC", "PAC Script Content": "محتوای اسکریپت PAC", - "PAC URL": "PAC URL", + "PAC URL": "PAC URL: ", "Auto Launch": "راه‌اندازی خودکار", "Silent Start": "شروع بی‌صدا", @@ -153,6 +154,9 @@ "External Controller": "کنترل‌کننده خارجی", "Core Secret": "رمز اصلی", "Recommended": "توصیه شده", + "Open URL": "باز کردن آدرس اینترنتی", + "Replace host, port, secret with %host, %port, %secret": "جایگزین کردن میزبان، پورت و رمز با %host، %port، %secret", + "Support %host, %port, %secret": "پشتیبانی از %host، %port و %secret", "Clash Core": "هسته Clash", "Upgrade": "ارتقاء", "Restart": "راه‌اندازی مجدد", diff --git a/src/locales/ru.json b/src/locales/ru.json index c783659..30b1c78 100644 --- a/src/locales/ru.json +++ b/src/locales/ru.json @@ -90,6 +90,7 @@ "Update At": "Обновлено в", "Logs": "Логи", + "Pause": "Пауза", "Clear": "Очистить", "Test": "Тест", @@ -130,16 +131,16 @@ "Enable status": "Статус включения", "Enabled": "Включено", "Disabled": "Отключено", - "Server Addr": "Адрес сервера", + "Server Addr": "Адрес сервера: ", "Not available": "Недоступно", "Proxy Guard": "Защита прокси", "Proxy Guard Info": "Включите эту функцию чтобы предотвратить изменение настроек прокси-сервера операционной системы другим программным обеспечением", "Guard Duration": "Период защиты", - "Proxy Bypass": "Игнорирование прокси", - "Bypass": "Игнорирование", - "Use PAC Mode": "Используйте режим PAC.", + "Proxy Bypass": "Игнорирование прокси: ", + "Bypass": "Игнорирование: ", + "Use PAC Mode": "Используйте режим PAC", "PAC Script Content": "Содержание сценария PAC", - "PAC URL": "Адрес PAC", + "PAC URL": "Адрес PAC: ", "Auto Launch": "Автозапуск", "Silent Start": "Тихий запуск", @@ -153,6 +154,9 @@ "External Controller": "Адрес прослушивания внешнего контроллера", "Core Secret": "Секрет", "Recommended": "Рекомендуется", + "Open URL": "Открыть URL", + "Replace host, port, secret with %host, %port, %secret": "Замените хост, порт, секрет на %host, %port, %secret", + "Support %host, %port, %secret": "Поддержка %host, %port, %secret", "Clash Core": "Ядра Clash", "Upgrade": "Обновлять", "Restart": "Перезапуск", diff --git a/src/locales/zh.json b/src/locales/zh.json index e819885..54757d5 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -90,6 +90,7 @@ "Update At": "更新于", "Logs": "日志", + "Pause": "暂停", "Clear": "清除", "Test": "测试", @@ -128,8 +129,8 @@ "System Proxy Setting": "系统代理设置", "Current System Proxy": "当前系统代理", "Enable status": "开启状态:", - "Enabled": "成功", - "Disabled": "失败", + "Enabled": "已启用", + "Disabled": "未启用", "Server Addr": "服务地址:", "Not available": "不可用", "Proxy Guard": "系统代理守卫", @@ -153,6 +154,9 @@ "External Controller": "外部控制器监听地址", "Core Secret": "API 访问密钥", "Recommended": "建议设置", + "Open URL": "打开链接", + "Replace host, port, secret with %host, %port, %secret": "使用 %host, %port, %secret 表示 主机, 端口, 访问密钥", + "Support %host, %port, %secret": "支持 %host, %port, %secret", "Clash Core": "Clash 内核", "Upgrade": "升级内核", "Restart": "重启内核", @@ -199,7 +203,7 @@ "App Log Level": "App日志等级", "Auto Close Connections": "自动关闭连接", "Auto Check Update": "自动检查更新", - "Enable Builtin Enhanced": "开启内建增强功能", + "Enable Builtin Enhanced": "内置增强功能", "Proxy Layout Column": "代理页布局列数", "Auto Log Clean": "自动清理日志", "Never Clean": "不清理", diff --git a/src/pages/logs.tsx b/src/pages/logs.tsx index 267cfa9..f4166c0 100644 --- a/src/pages/logs.tsx +++ b/src/pages/logs.tsx @@ -39,6 +39,7 @@ const LogPage = () => { header={ setEnableLog((e) => !e)}