chore: tooltips and locales

This commit is contained in:
dongchengjie
2024-06-26 05:33:06 +08:00
parent 04be747d52
commit 753395965a
21 changed files with 108 additions and 32 deletions

View File

@@ -6,18 +6,22 @@ import { useVerge } from "@/hooks/use-verge";
import { useLockFn } from "ahooks";
import { LoadingButton } from "@mui/lab";
import { SwitchAccessShortcut, RestartAlt } from "@mui/icons-material";
import { Box, Button, List, ListItemButton, ListItemText } from "@mui/material";
import {
Box,
Button,
Chip,
List,
ListItemButton,
ListItemText,
} from "@mui/material";
import { changeClashCore, restartSidecar } from "@/services/cmds";
import { closeAllConnections, upgradeCore } from "@/services/api";
import getSystem from "@/utils/get-system";
const VALID_CORE = [
{ name: "Mihomo", core: "verge-mihomo" },
{ name: "Mihomo Alpha", core: "verge-mihomo-alpha" },
{ name: "Mihomo", core: "verge-mihomo", chip: "Release Version" },
{ name: "Mihomo Alpha", core: "verge-mihomo-alpha", chip: "Alpha Version" },
];
const OS = getSystem();
export const ClashCoreViewer = forwardRef<DialogRef>((props, ref) => {
const { t } = useTranslation();
@@ -109,7 +113,7 @@ export const ClashCoreViewer = forwardRef<DialogRef>((props, ref) => {
marginTop: "-8px",
}}
disableOk
cancelBtn={t("Back")}
cancelBtn={t("Close")}
onClose={() => setOpen(false)}
onCancel={() => setOpen(false)}
>
@@ -121,6 +125,7 @@ export const ClashCoreViewer = forwardRef<DialogRef>((props, ref) => {
onClick={() => onCoreChange(each.core)}
>
<ListItemText primary={each.name} secondary={`/${each.core}`} />
<Chip label={t(`${each.chip}`)} size="small" />
</ListItemButton>
))}
</List>