Explorar o código

chore: add tooltip for tun mode

MystiPanda hai 1 ano
pai
achega
f235125d48
Modificáronse 3 ficheiros con 24 adicións e 5 borrados
  1. 18 3
      src/components/setting/setting-system.tsx
  2. 3 1
      src/locales/en.json
  3. 3 1
      src/locales/zh.json

+ 18 - 3
src/components/setting/setting-system.tsx

@@ -1,8 +1,8 @@
 import useSWR from "swr";
 import { useRef } from "react";
 import { useTranslation } from "react-i18next";
-import { IconButton, Switch } from "@mui/material";
-import { ArrowForward, PrivacyTipRounded, Settings } from "@mui/icons-material";
+import { IconButton, Switch, Tooltip } from "@mui/material";
+import { PrivacyTipRounded, Settings, InfoRounded } from "@mui/icons-material";
 import { checkService } from "@/services/cmds";
 import { useVerge } from "@/hooks/use-verge";
 import { DialogRef } from "@/components/base";
@@ -57,7 +57,22 @@ const SettingSystem = ({ onError }: Props) => {
         <ServiceViewer ref={serviceRef} enable={!!enable_service_mode} />
       )}
 
-      <SettingItem label={t("Tun Mode")}>
+      <SettingItem
+        label={t("Tun Mode")}
+        extra={
+          <Tooltip
+            title={isWIN ? t("Tun Mode Info Windows") : t("Tun Mode Info Unix")}
+            placement="top"
+          >
+            <IconButton color="inherit" size="small">
+              <InfoRounded
+                fontSize="inherit"
+                style={{ cursor: "pointer", opacity: 0.75 }}
+              />
+            </IconButton>
+          </Tooltip>
+        }
+      >
         <GuardState
           value={enable_tun_mode ?? false}
           valueProps="checked"

+ 3 - 1
src/locales/en.json

@@ -160,5 +160,7 @@
   "Retain 30 Days": "Retain 30 Days",
   "Retain 90 Days": "Retain 90 Days",
 
-  "Portable Updater Error": "The portable version does not support in-app updates. Please manually download and replace it"
+  "Portable Updater Error": "The portable version does not support in-app updates. Please manually download and replace it",
+  "Tun Mode Info Windows": "The Tun mode requires granting core-related permissions. Please enable service mode before using it",
+  "Tun Mode Info Unix": "The Tun mode requires granting core-related permissions. Before using it, please authorize the core in the core settings"
 }

+ 3 - 1
src/locales/zh.json

@@ -160,5 +160,7 @@
   "Retain 30 Days": "保留30天",
   "Retain 90 Days": "保留90天",
 
-  "Portable Updater Error": "便携版不支持应用内更新,请手动下载替换"
+  "Portable Updater Error": "便携版不支持应用内更新,请手动下载替换",
+  "Tun Mode Info Windows": "Tun模式需要授予内核相关权限,使用前请先开启服务模式",
+  "Tun Mode Info Unix": "Tun模式需要授予内核相关权限,使用前请先在内核设置中给内核授权"
 }