add rules help button
This commit is contained in:
@@ -352,4 +352,12 @@ export const I18N = {
|
|||||||
zh: `清除失败`,
|
zh: `清除失败`,
|
||||||
en: `Clear failed`,
|
en: `Clear failed`,
|
||||||
},
|
},
|
||||||
|
share: {
|
||||||
|
zh: `分享`,
|
||||||
|
en: `Share`,
|
||||||
|
},
|
||||||
|
help: {
|
||||||
|
zh: `求助`,
|
||||||
|
en: `Help`,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ export const THEME_DARK = "dark";
|
|||||||
|
|
||||||
export const URL_KISS_WORKER = "https://github.com/fishjar/kiss-worker";
|
export const URL_KISS_WORKER = "https://github.com/fishjar/kiss-worker";
|
||||||
export const URL_KISS_PROXY = "https://github.com/fishjar/kiss-proxy";
|
export const URL_KISS_PROXY = "https://github.com/fishjar/kiss-proxy";
|
||||||
|
export const URL_KISS_RULES = "https://github.com/fishjar/kiss-rules";
|
||||||
export const URL_RAW_PREFIX =
|
export const URL_RAW_PREFIX =
|
||||||
"https://raw.githubusercontent.com/fishjar/kiss-translator/master";
|
"https://raw.githubusercontent.com/fishjar/kiss-translator/master";
|
||||||
export const URL_MICROSOFT_AUTH = "https://edge.microsoft.com/translate/auth";
|
export const URL_MICROSOFT_AUTH = "https://edge.microsoft.com/translate/auth";
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ function Header(props) {
|
|||||||
underline="none"
|
underline="none"
|
||||||
color="inherit"
|
color="inherit"
|
||||||
href={process.env.REACT_APP_HOMEPAGE}
|
href={process.env.REACT_APP_HOMEPAGE}
|
||||||
|
target="_blank"
|
||||||
>{`${i18n("app_name")} v${process.env.REACT_APP_VERSION}`}</Link>
|
>{`${i18n("app_name")} v${process.env.REACT_APP_VERSION}`}</Link>
|
||||||
</Box>
|
</Box>
|
||||||
<DarkModeButton />
|
<DarkModeButton />
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import {
|
|||||||
OPT_STYLE_ALL,
|
OPT_STYLE_ALL,
|
||||||
OPT_STYLE_DIY,
|
OPT_STYLE_DIY,
|
||||||
OPT_STYLE_USE_COLOR,
|
OPT_STYLE_USE_COLOR,
|
||||||
|
URL_KISS_RULES,
|
||||||
} from "../../config";
|
} from "../../config";
|
||||||
import { useState, useRef, useEffect, useMemo } from "react";
|
import { useState, useRef, useEffect, useMemo } from "react";
|
||||||
import { useI18n } from "../../hooks/I18n";
|
import { useI18n } from "../../hooks/I18n";
|
||||||
@@ -35,6 +36,7 @@ import Radio from "@mui/material/Radio";
|
|||||||
import RadioGroup from "@mui/material/RadioGroup";
|
import RadioGroup from "@mui/material/RadioGroup";
|
||||||
import DeleteIcon from "@mui/icons-material/Delete";
|
import DeleteIcon from "@mui/icons-material/Delete";
|
||||||
import IconButton from "@mui/material/IconButton";
|
import IconButton from "@mui/material/IconButton";
|
||||||
|
import HelpIcon from "@mui/icons-material/Help";
|
||||||
import ShareIcon from "@mui/icons-material/Share";
|
import ShareIcon from "@mui/icons-material/Share";
|
||||||
import SyncIcon from "@mui/icons-material/Sync";
|
import SyncIcon from "@mui/icons-material/Sync";
|
||||||
import { useSubRules } from "../../hooks/SubRules";
|
import { useSubRules } from "../../hooks/SubRules";
|
||||||
@@ -470,7 +472,23 @@ function ShareButton({ rules, injectRules, selectedUrl }) {
|
|||||||
onClick={handleClick}
|
onClick={handleClick}
|
||||||
startIcon={<ShareIcon />}
|
startIcon={<ShareIcon />}
|
||||||
>
|
>
|
||||||
{"分享"}
|
{i18n("share")}
|
||||||
|
</Button>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function HelpButton() {
|
||||||
|
const i18n = useI18n();
|
||||||
|
return (
|
||||||
|
<Button
|
||||||
|
size="small"
|
||||||
|
variant="outlined"
|
||||||
|
onClick={() => {
|
||||||
|
window.open(URL_KISS_RULES, "_blank");
|
||||||
|
}}
|
||||||
|
startIcon={<HelpIcon />}
|
||||||
|
>
|
||||||
|
{i18n("help")}
|
||||||
</Button>
|
</Button>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -552,6 +570,8 @@ function UserRules({ subRules }) {
|
|||||||
selectedUrl={selectedUrl}
|
selectedUrl={selectedUrl}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<HelpButton />
|
||||||
|
|
||||||
<FormControlLabel
|
<FormControlLabel
|
||||||
control={
|
control={
|
||||||
<Switch
|
<Switch
|
||||||
@@ -715,6 +735,7 @@ function SubRulesEdit({ subList, addSub }) {
|
|||||||
>
|
>
|
||||||
{i18n("add")}
|
{i18n("add")}
|
||||||
</Button>
|
</Button>
|
||||||
|
<HelpButton />
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
{showInput && (
|
{showInput && (
|
||||||
|
|||||||
@@ -213,7 +213,9 @@ export default function Settings() {
|
|||||||
value={googleUrl}
|
value={googleUrl}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
helperText={
|
helperText={
|
||||||
<Link href={URL_KISS_PROXY}>{i18n("about_api_proxy")}</Link>
|
<Link href={URL_KISS_PROXY} target="_blank">
|
||||||
|
{i18n("about_api_proxy")}
|
||||||
|
</Link>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -254,7 +256,9 @@ export default function Settings() {
|
|||||||
value={openaiUrl}
|
value={openaiUrl}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
helperText={
|
helperText={
|
||||||
<Link href={URL_KISS_PROXY}>{i18n("about_api_proxy")}</Link>
|
<Link href={URL_KISS_PROXY} target="_blank">
|
||||||
|
{i18n("about_api_proxy")}
|
||||||
|
</Link>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,9 @@ export default function SyncSetting() {
|
|||||||
value={syncUrl}
|
value={syncUrl}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
helperText={
|
helperText={
|
||||||
<Link href={URL_KISS_WORKER}>{i18n("about_sync_api")}</Link>
|
<Link href={URL_KISS_WORKER} target="_blank">
|
||||||
|
{i18n("about_sync_api")}
|
||||||
|
</Link>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user