mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-26 20:50:30 +08:00
feat: change default UA and add version
This commit is contained in:
parent
6cb432dea9
commit
c54ce3577d
@ -10,6 +10,7 @@ import yaml from 'yaml'
|
||||
import { defaultProfile } from '../utils/template'
|
||||
import { subStorePort } from '../resolve/server'
|
||||
import { join } from 'path'
|
||||
import { app } from 'electron'
|
||||
|
||||
let profileConfig: IProfileConfig // profile.yaml
|
||||
|
||||
@ -134,7 +135,7 @@ export async function createProfile(item: Partial<IProfileItem>): Promise<IProfi
|
||||
}
|
||||
res = await axios.get(urlObj.toString(), {
|
||||
headers: {
|
||||
'User-Agent': userAgent || 'clash.meta'
|
||||
'User-Agent': userAgent || `mihomo.party/v${app.getVersion()} (clash.meta)`
|
||||
},
|
||||
responseType: 'text'
|
||||
})
|
||||
@ -148,7 +149,7 @@ export async function createProfile(item: Partial<IProfileItem>): Promise<IProfi
|
||||
}
|
||||
: false,
|
||||
headers: {
|
||||
'User-Agent': userAgent || 'clash.meta'
|
||||
'User-Agent': userAgent || `mihomo.party/v${app.getVersion()} (clash.meta)`
|
||||
},
|
||||
responseType: 'text'
|
||||
})
|
||||
|
||||
@ -8,7 +8,7 @@ import { getGistUrl, patchControledMihomoConfig, restartCore } from '@renderer/u
|
||||
import { MdDeleteForever } from 'react-icons/md'
|
||||
import { BiCopy } from 'react-icons/bi'
|
||||
import { IoIosHelpCircle } from 'react-icons/io'
|
||||
import { platform } from '@renderer/utils/init'
|
||||
import { platform, version } from '@renderer/utils/init'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
const MihomoConfig: React.FC = () => {
|
||||
@ -44,7 +44,7 @@ const MihomoConfig: React.FC = () => {
|
||||
size="sm"
|
||||
className="w-[60%]"
|
||||
value={ua}
|
||||
placeholder={t('mihomo.userAgentPlaceholder')}
|
||||
placeholder={t('mihomo.userAgentPlaceholder', { version })}
|
||||
onValueChange={(v) => {
|
||||
setUa(v)
|
||||
setUaDebounce(v)
|
||||
|
||||
@ -67,7 +67,7 @@
|
||||
"settings.links.telegram": "Telegram Group",
|
||||
"settings.title": "Application Settings",
|
||||
"mihomo.userAgent": "Subscription User Agent",
|
||||
"mihomo.userAgentPlaceholder": "Default: clash.meta",
|
||||
"mihomo.userAgentPlaceholder": "Default: mihomo.party/v{{version}} (clash.meta)",
|
||||
"mihomo.delayTest.url": "Delay Test URL",
|
||||
"mihomo.delayTest.urlPlaceholder": "Default: http://www.gstatic.com/generate_204",
|
||||
"mihomo.delayTest.concurrency": "Delay Test Concurrency",
|
||||
|
||||
@ -67,7 +67,7 @@
|
||||
"settings.links.telegram": "گروه تلگرام",
|
||||
"settings.title": "تنظیمات برنامه",
|
||||
"mihomo.userAgent": "User Agent اشتراک",
|
||||
"mihomo.userAgentPlaceholder": "پیشفرض: clash.meta",
|
||||
"mihomo.userAgentPlaceholder": "پیشفرض: mihomo.party/v{{version}} (clash.meta)",
|
||||
"mihomo.title": "تنظیمات هسته",
|
||||
"mihomo.restart": "راهاندازی مجدد هسته",
|
||||
"mihomo.memory": "مصرف حافظه",
|
||||
|
||||
@ -70,7 +70,7 @@
|
||||
"mihomo.restart": "Перезапустить ядро",
|
||||
"mihomo.memory": "Использование памяти",
|
||||
"mihomo.userAgent": "User Agent подписки",
|
||||
"mihomo.userAgentPlaceholder": "По умолчанию: clash.meta",
|
||||
"mihomo.userAgentPlaceholder": "По умолчанию: mihomo.party/v{{version}} (clash.meta)",
|
||||
"mihomo.delayTest.url": "URL теста задержки",
|
||||
"mihomo.delayTest.urlPlaceholder": "По умолчанию: http://www.gstatic.com/generate_204",
|
||||
"mihomo.delayTest.concurrency": "Параллельность теста задержки",
|
||||
|
||||
@ -70,7 +70,7 @@
|
||||
"mihomo.restart": "重启内核",
|
||||
"mihomo.memory": "内存使用",
|
||||
"mihomo.userAgent": "订阅 User Agent",
|
||||
"mihomo.userAgentPlaceholder": "默认:clash.meta",
|
||||
"mihomo.userAgentPlaceholder": "默认:mihomo.party/v{{version}} (clash.meta)",
|
||||
"mihomo.delayTest.url": "延迟测试 URL",
|
||||
"mihomo.delayTest.urlPlaceholder": "默认:http://www.gstatic.com/generate_204",
|
||||
"mihomo.delayTest.concurrency": "延迟测试并发数",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user