mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 21:20:29 +08:00
Compare commits
No commits in common. "d51d6ed0d7870ab2833b30310bcab57d76ed75ad" and "c73d1479380d53dc9cf09105f883b2eeb07c438c" have entirely different histories.
d51d6ed0d7
...
c73d147938
@ -12,9 +12,6 @@ export async function getControledMihomoConfig(force = false): Promise<Partial<I
|
||||
if (force || !controledMihomoConfig) {
|
||||
const data = await readFile(controledMihomoConfigPath(), 'utf-8')
|
||||
controledMihomoConfig = yaml.parse(data, { merge: true }) || defaultControledMihomoConfig
|
||||
|
||||
// 确保配置包含所有必要的默认字段,处理升级场景
|
||||
controledMihomoConfig = deepMerge(defaultControledMihomoConfig, controledMihomoConfig)
|
||||
}
|
||||
if (typeof controledMihomoConfig !== 'object')
|
||||
controledMihomoConfig = defaultControledMihomoConfig
|
||||
@ -34,12 +31,8 @@ export async function patchControledMihomoConfig(patch: Partial<IMihomoConfig>):
|
||||
controledMihomoConfig = deepMerge(controledMihomoConfig, patch)
|
||||
|
||||
// 从不接管状态恢复
|
||||
if (controlDns) {
|
||||
// 确保DNS配置包含所有必要的默认字段,特别是新增的fallback等
|
||||
controledMihomoConfig.dns = deepMerge(
|
||||
defaultControledMihomoConfig.dns || {},
|
||||
controledMihomoConfig.dns || {}
|
||||
)
|
||||
if (controlDns && controledMihomoConfig.dns?.ipv6 === undefined) {
|
||||
controledMihomoConfig.dns = defaultControledMihomoConfig.dns
|
||||
}
|
||||
if (controlSniff && !controledMihomoConfig.sniffer) {
|
||||
controledMihomoConfig.sniffer = defaultControledMihomoConfig.sniffer
|
||||
|
||||
@ -86,18 +86,10 @@ export const defaultControledMihomoConfig: Partial<IMihomoConfig> = {
|
||||
'fake-ip-filter': ['*', '+.lan', '+.local', 'time.*.com', 'ntp.*.com', '+.market.xiaomi.com'],
|
||||
'use-hosts': false,
|
||||
'use-system-hosts': false,
|
||||
'respect-rules': false,
|
||||
'default-nameserver': ['tls://223.5.5.5'],
|
||||
nameserver: ['https://doh.pub/dns-query', 'https://dns.alidns.com/dns-query'],
|
||||
'proxy-server-nameserver': ['https://doh.pub/dns-query', 'https://dns.alidns.com/dns-query'],
|
||||
'direct-nameserver': [],
|
||||
fallback: [],
|
||||
'fallback-filter': {
|
||||
geoip: true,
|
||||
'geoip-code': 'CN',
|
||||
ipcidr: ['240.0.0.0/4', '0.0.0.0/32'],
|
||||
domain: ['+.google.com', '+.facebook.com', '+.youtube.com']
|
||||
}
|
||||
nameserver: ['https://120.53.53.53/dns-query', 'https://223.5.5.5/dns-query'],
|
||||
'proxy-server-nameserver': ['https://120.53.53.53/dns-query', 'https://223.5.5.5/dns-query'],
|
||||
'direct-nameserver': []
|
||||
},
|
||||
sniffer: {
|
||||
enable: true,
|
||||
|
||||
@ -51,7 +51,6 @@ const GeneralConfig: React.FC = () => {
|
||||
proxyInTray = true,
|
||||
disableTray = false,
|
||||
disableTrayIconColor = false,
|
||||
disableAnimations = false,
|
||||
showFloatingWindow: showFloating = false,
|
||||
spinFloatingIcon = true,
|
||||
floatingWindowCompatMode = true,
|
||||
@ -389,15 +388,6 @@ const GeneralConfig: React.FC = () => {
|
||||
}, 1000)}
|
||||
/>
|
||||
</SettingItem>
|
||||
<SettingItem title={t('settings.disableAnimations')} divider>
|
||||
<Switch
|
||||
size="sm"
|
||||
isSelected={disableAnimations}
|
||||
onValueChange={async (v) => {
|
||||
await patchAppConfig({ disableAnimations: v })
|
||||
}}
|
||||
/>
|
||||
</SettingItem>
|
||||
<SettingItem
|
||||
title={t('settings.disableHardwareAcceleration')}
|
||||
actions={
|
||||
|
||||
@ -36,7 +36,7 @@ interface Props {
|
||||
const ConnCard: React.FC<Props> = (props) => {
|
||||
const { iconOnly } = props
|
||||
const { appConfig } = useAppConfig()
|
||||
const { showTraffic = false, connectionCardStatus = 'col-span-2', disableAnimations = false } = appConfig || {}
|
||||
const { showTraffic = false, connectionCardStatus = 'col-span-2' } = appConfig || {}
|
||||
const location = useLocation()
|
||||
const navigate = useNavigate()
|
||||
const match = location.pathname.includes('/connections')
|
||||
@ -187,7 +187,7 @@ const ConnCard: React.FC<Props> = (props) => {
|
||||
ref={setNodeRef}
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? `${disableAnimations ? '' : 'scale-[0.95] tap-highlight-transparent'}` : ''}`}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody className="pb-1 pt-0 px-0">
|
||||
<div className="flex justify-between">
|
||||
@ -234,7 +234,7 @@ const ConnCard: React.FC<Props> = (props) => {
|
||||
ref={setNodeRef}
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? `${disableAnimations ? '' : 'scale-[0.95] tap-highlight-transparent'}` : ''}`}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody className="pb-1 pt-0 px-0">
|
||||
<div className="flex justify-between">
|
||||
|
||||
@ -17,7 +17,7 @@ const DNSCard: React.FC<Props> = (props) => {
|
||||
const { t } = useTranslation()
|
||||
const { appConfig, patchAppConfig } = useAppConfig()
|
||||
const { iconOnly } = props
|
||||
const { dnsCardStatus = 'col-span-1', controlDns = true, disableAnimations = false } = appConfig || {}
|
||||
const { dnsCardStatus = 'col-span-1', controlDns = true } = appConfig || {}
|
||||
const location = useLocation()
|
||||
const navigate = useNavigate()
|
||||
const match = location.pathname.includes('/dns')
|
||||
@ -78,7 +78,7 @@ const DNSCard: React.FC<Props> = (props) => {
|
||||
ref={setNodeRef}
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? `${disableAnimations ? '' : 'scale-[0.95] tap-highlight-transparent'}` : ''}`}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody className="pb-1 pt-0 px-0">
|
||||
<div className="flex justify-between">
|
||||
|
||||
@ -15,7 +15,7 @@ const LogCard: React.FC<Props> = (props) => {
|
||||
const { t } = useTranslation()
|
||||
const { appConfig } = useAppConfig()
|
||||
const { iconOnly } = props
|
||||
const { logCardStatus = 'col-span-1', disableAnimations = false } = appConfig || {}
|
||||
const { logCardStatus = 'col-span-1' } = appConfig || {}
|
||||
const location = useLocation()
|
||||
const navigate = useNavigate()
|
||||
const match = location.pathname.includes('/logs')
|
||||
@ -65,7 +65,7 @@ const LogCard: React.FC<Props> = (props) => {
|
||||
ref={setNodeRef}
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? `${disableAnimations ? '' : 'scale-[0.95] tap-highlight-transparent'}` : ''}`}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody className="pb-1 pt-0 px-0">
|
||||
<div className="flex justify-between">
|
||||
|
||||
@ -19,7 +19,7 @@ interface Props {
|
||||
const MihomoCoreCard: React.FC<Props> = (props) => {
|
||||
const { appConfig } = useAppConfig()
|
||||
const { iconOnly } = props
|
||||
const { mihomoCoreCardStatus = 'col-span-2', disableAnimations = false } = appConfig || {}
|
||||
const { mihomoCoreCardStatus = 'col-span-2' } = appConfig || {}
|
||||
const { data: version, mutate } = useSWR('mihomoVersion', mihomoVersion)
|
||||
const location = useLocation()
|
||||
const navigate = useNavigate()
|
||||
@ -87,7 +87,7 @@ const MihomoCoreCard: React.FC<Props> = (props) => {
|
||||
ref={setNodeRef}
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? `${disableAnimations ? '' : 'scale-[0.95] tap-highlight-transparent'}` : ''}`}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody>
|
||||
<div
|
||||
@ -138,7 +138,7 @@ const MihomoCoreCard: React.FC<Props> = (props) => {
|
||||
ref={setNodeRef}
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? `${disableAnimations ? '' : 'scale-[0.95] tap-highlight-transparent'}` : ''}`}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody className="pb-1 pt-0 px-0">
|
||||
<div className="flex justify-between">
|
||||
|
||||
@ -15,7 +15,7 @@ const OverrideCard: React.FC<Props> = (props) => {
|
||||
const { t } = useTranslation()
|
||||
const { appConfig } = useAppConfig()
|
||||
const { iconOnly } = props
|
||||
const { overrideCardStatus = 'col-span-1', disableAnimations = false } = appConfig || {}
|
||||
const { overrideCardStatus = 'col-span-1' } = appConfig || {}
|
||||
const location = useLocation()
|
||||
const navigate = useNavigate()
|
||||
const match = location.pathname.includes('/override')
|
||||
@ -64,7 +64,7 @@ const OverrideCard: React.FC<Props> = (props) => {
|
||||
ref={setNodeRef}
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? `${disableAnimations ? '' : 'scale-[0.95] tap-highlight-transparent'}` : ''}`}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody className="pb-1 pt-0 px-0">
|
||||
<div className="flex justify-between">
|
||||
|
||||
@ -26,7 +26,7 @@ const ProfileCard: React.FC<Props> = (props) => {
|
||||
const { t } = useTranslation()
|
||||
const { appConfig, patchAppConfig } = useAppConfig()
|
||||
const { iconOnly } = props
|
||||
const { profileCardStatus = 'col-span-2', profileDisplayDate = 'expire', disableAnimations = false } = appConfig || {}
|
||||
const { profileCardStatus = 'col-span-2', profileDisplayDate = 'expire' } = appConfig || {}
|
||||
const location = useLocation()
|
||||
const navigate = useNavigate()
|
||||
const match = location.pathname.includes('/profiles')
|
||||
@ -92,7 +92,7 @@ const ProfileCard: React.FC<Props> = (props) => {
|
||||
ref={setNodeRef}
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? `${disableAnimations ? '' : 'scale-[0.95] tap-highlight-transparent'}` : ''}`}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody className="pb-1">
|
||||
<div
|
||||
@ -219,7 +219,7 @@ const ProfileCard: React.FC<Props> = (props) => {
|
||||
ref={setNodeRef}
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? `${disableAnimations ? '' : 'scale-[0.95] tap-highlight-transparent'}` : ''}`}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody className="pb-1 pt-0 px-0">
|
||||
<div className="flex justify-between">
|
||||
|
||||
@ -16,7 +16,7 @@ const ProxyCard: React.FC<Props> = (props) => {
|
||||
const { t } = useTranslation()
|
||||
const { appConfig } = useAppConfig()
|
||||
const { iconOnly } = props
|
||||
const { proxyCardStatus = 'col-span-1', disableAnimations = false } = appConfig || {}
|
||||
const { proxyCardStatus = 'col-span-1' } = appConfig || {}
|
||||
const location = useLocation()
|
||||
const navigate = useNavigate()
|
||||
const match = location.pathname.includes('/proxies')
|
||||
@ -67,7 +67,7 @@ const ProxyCard: React.FC<Props> = (props) => {
|
||||
ref={setNodeRef}
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? `${disableAnimations ? '' : 'scale-[0.95] tap-highlight-transparent'}` : ''}`}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody className="pb-1 pt-0 px-0">
|
||||
<div className="flex justify-between">
|
||||
|
||||
@ -15,7 +15,7 @@ const ResourceCard: React.FC<Props> = (props) => {
|
||||
const { t } = useTranslation()
|
||||
const { appConfig } = useAppConfig()
|
||||
const { iconOnly } = props
|
||||
const { resourceCardStatus = 'col-span-1', disableAnimations = false } = appConfig || {}
|
||||
const { resourceCardStatus = 'col-span-1' } = appConfig || {}
|
||||
const location = useLocation()
|
||||
const navigate = useNavigate()
|
||||
const match = location.pathname.includes('/resources')
|
||||
@ -65,7 +65,7 @@ const ResourceCard: React.FC<Props> = (props) => {
|
||||
ref={setNodeRef}
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? `${disableAnimations ? '' : 'scale-[0.95] tap-highlight-transparent'}` : ''}`}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody className="pb-1 pt-0 px-0">
|
||||
<div className="flex justify-between">
|
||||
|
||||
@ -16,7 +16,7 @@ const RuleCard: React.FC<Props> = (props) => {
|
||||
const { t } = useTranslation()
|
||||
const { appConfig } = useAppConfig()
|
||||
const { iconOnly } = props
|
||||
const { ruleCardStatus = 'col-span-1', disableAnimations = false } = appConfig || {}
|
||||
const { ruleCardStatus = 'col-span-1' } = appConfig || {}
|
||||
const location = useLocation()
|
||||
const navigate = useNavigate()
|
||||
const match = location.pathname.includes('/rules')
|
||||
@ -67,7 +67,7 @@ const RuleCard: React.FC<Props> = (props) => {
|
||||
ref={setNodeRef}
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? `${disableAnimations ? '' : 'scale-[0.95] tap-highlight-transparent'}` : ''}`}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody className="pb-1 pt-0 px-0">
|
||||
<div className="flex justify-between">
|
||||
|
||||
@ -17,7 +17,7 @@ const SniffCard: React.FC<Props> = (props) => {
|
||||
const { t } = useTranslation()
|
||||
const { appConfig, patchAppConfig } = useAppConfig()
|
||||
const { iconOnly } = props
|
||||
const { sniffCardStatus = 'col-span-1', controlSniff = true, disableAnimations = false } = appConfig || {}
|
||||
const { sniffCardStatus = 'col-span-1', controlSniff = true } = appConfig || {}
|
||||
const location = useLocation()
|
||||
const navigate = useNavigate()
|
||||
const match = location.pathname.includes('/sniffer')
|
||||
@ -78,7 +78,7 @@ const SniffCard: React.FC<Props> = (props) => {
|
||||
ref={setNodeRef}
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? `${disableAnimations ? '' : 'scale-[0.95] tap-highlight-transparent'}` : ''}`}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody className="pb-1 pt-0 px-0">
|
||||
<div className="flex justify-between">
|
||||
|
||||
@ -15,7 +15,7 @@ const SubStoreCard: React.FC<Props> = (props) => {
|
||||
const { t } = useTranslation()
|
||||
const { appConfig } = useAppConfig()
|
||||
const { iconOnly } = props
|
||||
const { substoreCardStatus = 'col-span-1', useSubStore = true, disableAnimations = false } = appConfig || {}
|
||||
const { substoreCardStatus = 'col-span-1', useSubStore = true } = appConfig || {}
|
||||
const location = useLocation()
|
||||
const navigate = useNavigate()
|
||||
const match = location.pathname.includes('/substore')
|
||||
@ -66,7 +66,7 @@ const SubStoreCard: React.FC<Props> = (props) => {
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
fullWidth
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? `${disableAnimations ? '' : 'scale-[0.95] tap-highlight-transparent'}` : ''}`}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody className="pb-1 pt-0 px-0">
|
||||
<div className="flex justify-between">
|
||||
|
||||
@ -22,7 +22,7 @@ const SysproxySwitcher: React.FC<Props> = (props) => {
|
||||
const match = location.pathname.includes('/sysproxy')
|
||||
const { appConfig, patchAppConfig } = useAppConfig()
|
||||
const { controledMihomoConfig } = useControledMihomoConfig()
|
||||
const { sysProxy, sysproxyCardStatus = 'col-span-1', disableAnimations = false } = appConfig || {}
|
||||
const { sysProxy, sysproxyCardStatus = 'col-span-1' } = appConfig || {}
|
||||
const { tun } = controledMihomoConfig || {}
|
||||
const { enable } = sysProxy || {}
|
||||
const {
|
||||
@ -93,7 +93,7 @@ const SysproxySwitcher: React.FC<Props> = (props) => {
|
||||
ref={setNodeRef}
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? `${disableAnimations ? '' : 'scale-[0.95] tap-highlight-transparent'}` : ''}`}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody className="pb-1 pt-0 px-0">
|
||||
<div className="flex justify-between">
|
||||
|
||||
@ -21,7 +21,7 @@ const TunSwitcher: React.FC<Props> = (props) => {
|
||||
const navigate = useNavigate()
|
||||
const match = location.pathname.includes('/tun') || false
|
||||
const { appConfig } = useAppConfig()
|
||||
const { tunCardStatus = 'col-span-1', disableAnimations = false } = appConfig || {}
|
||||
const { tunCardStatus = 'col-span-1' } = appConfig || {}
|
||||
const sysProxyEnabled = appConfig?.sysProxy?.enable ?? false
|
||||
const { controledMihomoConfig, patchControledMihomoConfig } = useControledMihomoConfig()
|
||||
const { tun } = controledMihomoConfig || {}
|
||||
@ -127,7 +127,7 @@ const TunSwitcher: React.FC<Props> = (props) => {
|
||||
ref={setNodeRef}
|
||||
{...attributes}
|
||||
{...listeners}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? `${disableAnimations ? '' : 'scale-[0.95] tap-highlight-transparent'}` : ''}`}
|
||||
className={`${match ? 'bg-primary' : 'hover:bg-primary/30'} ${isDragging ? 'scale-[0.97] tap-highlight-transparent' : ''}`}
|
||||
>
|
||||
<CardBody className="pb-1 pt-0 px-0">
|
||||
<div className="flex justify-between">
|
||||
|
||||
@ -62,7 +62,6 @@
|
||||
"settings.disableTray": "Disable Tray Icon",
|
||||
"settings.proxyInTray": "Show Proxy Info in Tray Menu",
|
||||
"settings.disableTrayIconColor": "Disable Tray Icon Color Changes",
|
||||
"settings.disableAnimations": "Disable Animation Effects",
|
||||
"settings.showTraffic_windows": "Show Network Speed in Taskbar",
|
||||
"settings.showTraffic_mac": "Show Network Speed in Status Bar",
|
||||
"settings.showDockIcon": "Show Dock Icon",
|
||||
@ -351,15 +350,6 @@
|
||||
"dns.nameserverPlaceholder": "Example: tls://dns.alidns.com",
|
||||
"dns.directNameserver": "Direct Resolution Server",
|
||||
"dns.directNameserverPlaceholder": "Example: tls://dns.alidns.com",
|
||||
"dns.fallback": "Fallback Servers",
|
||||
"dns.fallbackPlaceholder": "Example: https://dns.alidns.com/dns-query",
|
||||
"dns.fallbackFilter.title": "Fallback Filter Settings",
|
||||
"dns.fallbackFilter.geoip": "GeoIP Filter",
|
||||
"dns.fallbackFilter.geoipCode": "GeoIP Country Code",
|
||||
"dns.fallbackFilter.ipcidr": "Fallback IP CIDR",
|
||||
"dns.fallbackFilter.ipcidrPlaceholder": "Example: 240.0.0.0/4",
|
||||
"dns.fallbackFilter.domain": "Fallback Domains",
|
||||
"dns.fallbackFilter.domainPlaceholder": "Example: +.google.com",
|
||||
"dns.nameserverPolicy.title": "Override DNS Policy",
|
||||
"dns.nameserverPolicy.list": "DNS Policy List",
|
||||
"dns.nameserverPolicy.domainPlaceholder": "Domain",
|
||||
|
||||
@ -59,7 +59,6 @@
|
||||
"settings.disableTray": "غیرفعال کردن آیکون سیستمتری",
|
||||
"settings.proxyInTray": "نمایش اطلاعات پراکسی در منوی سیستمتری",
|
||||
"settings.disableTrayIconColor": "غیرفعال کردن تغییر رنگ آیکون تری",
|
||||
"settings.disableAnimations": "غیرفعال کردن جلوههای انیمیشن",
|
||||
"settings.showTraffic_windows": "نمایش سرعت شبکه در نوار وظیفه",
|
||||
"settings.showTraffic_mac": "نمایش سرعت شبکه در نوار وضعیت",
|
||||
"settings.showDockIcon": "نمایش آیکون Dock",
|
||||
@ -345,15 +344,6 @@
|
||||
"dns.nameserverPlaceholder": "مثال: tls://dns.alidns.com",
|
||||
"dns.directNameserver": "سرور حل نام مستقیم",
|
||||
"dns.directNameserverPlaceholder": "مثال: tls://dns.alidns.com",
|
||||
"dns.fallback": "سرورهای پشتیبان",
|
||||
"dns.fallbackPlaceholder": "مثال: https://dns.alidns.com/dns-query",
|
||||
"dns.fallbackFilter.title": "تنظیمات فیلتر پشتیبان",
|
||||
"dns.fallbackFilter.geoip": "فیلتر GeoIP",
|
||||
"dns.fallbackFilter.geoipCode": "کد کشور GeoIP",
|
||||
"dns.fallbackFilter.ipcidr": "CIDR آیپی پشتیبان",
|
||||
"dns.fallbackFilter.ipcidrPlaceholder": "مثال: 240.0.0.0/4",
|
||||
"dns.fallbackFilter.domain": "دامنههای پشتیبان",
|
||||
"dns.fallbackFilter.domainPlaceholder": "مثال: +.google.com",
|
||||
"dns.nameserverPolicy.title": "سیاست جایگزینی DNS",
|
||||
"dns.nameserverPolicy.list": "لیست سیاست DNS",
|
||||
"dns.nameserverPolicy.domainPlaceholder": "دامنه",
|
||||
|
||||
@ -59,7 +59,6 @@
|
||||
"settings.disableTray": "Отключить значок в трее",
|
||||
"settings.proxyInTray": "Показывать информацию о прокси в трее",
|
||||
"settings.disableTrayIconColor": "Отключить смену цвета значка в трее",
|
||||
"settings.disableAnimations": "Отключить анимационные эффекты",
|
||||
"settings.showTraffic_windows": "Показывать скорость в панели задач",
|
||||
"settings.showTraffic_mac": "Показывать скорость в строке состояния",
|
||||
"settings.showDockIcon": "Показывать значок в доке",
|
||||
@ -345,15 +344,6 @@
|
||||
"dns.nameserverPlaceholder": "Пример: tls://dns.alidns.com",
|
||||
"dns.directNameserver": "Сервер прямого разрешения",
|
||||
"dns.directNameserverPlaceholder": "Пример: tls://dns.alidns.com",
|
||||
"dns.fallback": "Резервные серверы",
|
||||
"dns.fallbackPlaceholder": "Пример: https://dns.alidns.com/dns-query",
|
||||
"dns.fallbackFilter.title": "Настройки резервного фильтра",
|
||||
"dns.fallbackFilter.geoip": "GeoIP фильтр",
|
||||
"dns.fallbackFilter.geoipCode": "GeoIP код страны",
|
||||
"dns.fallbackFilter.ipcidr": "Резервные IP CIDR",
|
||||
"dns.fallbackFilter.ipcidrPlaceholder": "Пример: 240.0.0.0/4",
|
||||
"dns.fallbackFilter.domain": "Резервные домены",
|
||||
"dns.fallbackFilter.domainPlaceholder": "Пример: +.google.com",
|
||||
"dns.nameserverPolicy.title": "Переопределение политики DNS",
|
||||
"dns.nameserverPolicy.list": "Список политик DNS",
|
||||
"dns.nameserverPolicy.domainPlaceholder": "Домен",
|
||||
|
||||
@ -62,7 +62,6 @@
|
||||
"settings.disableTray": "禁用托盘图标",
|
||||
"settings.proxyInTray": "在托盘菜单显示代理信息",
|
||||
"settings.disableTrayIconColor": "禁用托盘图标颜色变化",
|
||||
"settings.disableAnimations": "禁用动画效果",
|
||||
"settings.showTraffic_windows": "在任务栏显示网速",
|
||||
"settings.showTraffic_mac": "在状态栏显示网速",
|
||||
"settings.showDockIcon": "显示 Dock 图标",
|
||||
@ -360,15 +359,6 @@
|
||||
"dns.customHosts.list": "Hosts 列表",
|
||||
"dns.customHosts.domainPlaceholder": "域名",
|
||||
"dns.customHosts.valuePlaceholder": "域名或 IP",
|
||||
"dns.fallback": "回退服务器",
|
||||
"dns.fallbackPlaceholder": "例:https://dns.alidns.com/dns-query",
|
||||
"dns.fallbackFilter.title": "回退过滤设置",
|
||||
"dns.fallbackFilter.geoip": "GeoIP 过滤",
|
||||
"dns.fallbackFilter.geoipCode": "GeoIP 国家代码",
|
||||
"dns.fallbackFilter.ipcidr": "回退 IP CIDR",
|
||||
"dns.fallbackFilter.ipcidrPlaceholder": "例:240.0.0.0/4",
|
||||
"dns.fallbackFilter.domain": "回退域名",
|
||||
"dns.fallbackFilter.domainPlaceholder": "例:+.google.com",
|
||||
"dns.saveOnly": "仅保存",
|
||||
"profiles.title": "订阅管理",
|
||||
"profiles.updateAll": "更新全部订阅",
|
||||
|
||||
@ -37,14 +37,7 @@ const DNS: React.FC = () => {
|
||||
'https://doh.pub/dns-query',
|
||||
'https://dns.alidns.com/dns-query'
|
||||
],
|
||||
'direct-nameserver': directNameserver = [],
|
||||
fallback = [],
|
||||
'fallback-filter': fallbackFilter = {
|
||||
geoip: true,
|
||||
'geoip-code': 'CN',
|
||||
ipcidr: ['240.0.0.0/4', '0.0.0.0/32'],
|
||||
domain: ['+.google.com', '+.facebook.com', '+.youtube.com']
|
||||
}
|
||||
'direct-nameserver': directNameserver = []
|
||||
} = dns || {}
|
||||
const [changed, setChanged] = useState(false)
|
||||
const [values, originSetValues] = useState({
|
||||
@ -60,11 +53,6 @@ const DNS: React.FC = () => {
|
||||
nameserver,
|
||||
proxyServerNameserver,
|
||||
directNameserver,
|
||||
fallback,
|
||||
fallbackGeoip: fallbackFilter?.geoip || true,
|
||||
fallbackGeoipCode: fallbackFilter?.['geoip-code'] || 'CN',
|
||||
fallbackIpcidr: fallbackFilter?.ipcidr || ['240.0.0.0/4', '0.0.0.0/32'],
|
||||
fallbackDomain: fallbackFilter?.domain || ['+.google.com', '+.facebook.com', '+.youtube.com'],
|
||||
useNameserverPolicy,
|
||||
nameserverPolicy: Object.entries(nameserverPolicy || {}).map(([domain, value]) => ({
|
||||
domain,
|
||||
@ -172,13 +160,8 @@ const DNS: React.FC = () => {
|
||||
nameserver: values.nameserver,
|
||||
'proxy-server-nameserver': values.proxyServerNameserver,
|
||||
'direct-nameserver': values.directNameserver,
|
||||
fallback: values.fallback,
|
||||
'fallback-filter': {
|
||||
geoip: values.fallbackGeoip,
|
||||
'geoip-code': values.fallbackGeoipCode,
|
||||
ipcidr: values.fallbackIpcidr,
|
||||
domain: values.fallbackDomain
|
||||
}
|
||||
fallback: undefined,
|
||||
'fallback-filter': undefined
|
||||
}
|
||||
if (values.useNameserverPolicy) {
|
||||
dnsConfig['nameserver-policy'] = Object.fromEntries(
|
||||
@ -405,42 +388,6 @@ const DNS: React.FC = () => {
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
<Divider className="my-2" />
|
||||
<div className="flex flex-col items-stretch">
|
||||
<h3>{t('dns.fallback')}</h3>
|
||||
{renderListInputs('fallback', t('dns.fallbackPlaceholder'))}
|
||||
</div>
|
||||
</SettingCard>
|
||||
<SettingCard title={t('dns.fallbackFilter.title')}>
|
||||
<SettingItem title={t('dns.fallbackFilter.geoip')} divider>
|
||||
<Switch
|
||||
size="sm"
|
||||
isSelected={values.fallbackGeoip}
|
||||
onValueChange={(v) => {
|
||||
setValues({ ...values, fallbackGeoip: v })
|
||||
}}
|
||||
/>
|
||||
</SettingItem>
|
||||
<SettingItem title={t('dns.fallbackFilter.geoipCode')} divider>
|
||||
<Input
|
||||
size="sm"
|
||||
className="w-[100px]"
|
||||
value={values.fallbackGeoipCode}
|
||||
placeholder="CN"
|
||||
onValueChange={(v) => {
|
||||
setValues({ ...values, fallbackGeoipCode: v })
|
||||
}}
|
||||
/>
|
||||
</SettingItem>
|
||||
<div className="flex flex-col items-stretch">
|
||||
<h3>{t('dns.fallbackFilter.ipcidr')}</h3>
|
||||
{renderListInputs('fallbackIpcidr', t('dns.fallbackFilter.ipcidrPlaceholder'))}
|
||||
</div>
|
||||
<Divider className="my-2" />
|
||||
<div className="flex flex-col items-stretch">
|
||||
<h3>{t('dns.fallbackFilter.domain')}</h3>
|
||||
{renderListInputs('fallbackDomain', t('dns.fallbackFilter.domainPlaceholder'))}
|
||||
</div>
|
||||
</SettingCard>
|
||||
</BasePage>
|
||||
)
|
||||
|
||||
1
src/shared/types.d.ts
vendored
1
src/shared/types.d.ts
vendored
@ -288,7 +288,6 @@ interface IAppConfig {
|
||||
useDockIcon?: boolean
|
||||
showTraffic?: boolean
|
||||
disableTrayIconColor?: boolean
|
||||
disableAnimations?: boolean
|
||||
webdavUrl?: string
|
||||
webdavDir?: string
|
||||
webdavUsername?: string
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user