mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 05:00:30 +08:00
complete override
This commit is contained in:
parent
82edf850b8
commit
2dead0f521
@ -33,11 +33,13 @@ const Override: React.FC = () => {
|
||||
const handleImport = async (): Promise<void> => {
|
||||
setImporting(true)
|
||||
try {
|
||||
const urlObj = new URL(url)
|
||||
const name = urlObj.pathname.split('/').pop()
|
||||
await addOverrideItem({
|
||||
name: '',
|
||||
name: name ? decodeURIComponent(name) : undefined,
|
||||
type: 'remote',
|
||||
url,
|
||||
ext: url.endsWith('.js') ? 'js' : 'yaml'
|
||||
ext: urlObj.pathname.endsWith('.js') ? 'js' : 'yaml'
|
||||
})
|
||||
} finally {
|
||||
setImporting(false)
|
||||
@ -106,7 +108,31 @@ const Override: React.FC = () => {
|
||||
}, [items])
|
||||
|
||||
return (
|
||||
<BasePage ref={pageRef} title="覆写">
|
||||
<BasePage
|
||||
ref={pageRef}
|
||||
title="覆写"
|
||||
header={
|
||||
<>
|
||||
<Button
|
||||
size="sm"
|
||||
className="mr-2"
|
||||
onPress={() => {
|
||||
open('https://mihomo.party/guides/function/override/yaml/')
|
||||
}}
|
||||
>
|
||||
使用文档
|
||||
</Button>
|
||||
<Button
|
||||
size="sm"
|
||||
onPress={() => {
|
||||
open('https://github.com/pompurin404/override-hub')
|
||||
}}
|
||||
>
|
||||
常用覆写仓库
|
||||
</Button>
|
||||
</>
|
||||
}
|
||||
>
|
||||
<div className="sticky top-[48px] z-40 backdrop-blur bg-background/40 flex p-2">
|
||||
<Input
|
||||
variant="bordered"
|
||||
|
||||
@ -17,6 +17,7 @@ import {
|
||||
webdavBackup,
|
||||
listWebdavBackups
|
||||
} from '@renderer/utils/ipc'
|
||||
import { CgWebsite } from 'react-icons/cg'
|
||||
import { IoLogoGithub } from 'react-icons/io5'
|
||||
import { platform, version } from '@renderer/utils/init'
|
||||
import useSWR from 'swr'
|
||||
@ -130,15 +131,29 @@ const Settings: React.FC = () => {
|
||||
<BasePage
|
||||
title="应用设置"
|
||||
header={
|
||||
<Button
|
||||
isIconOnly
|
||||
size="sm"
|
||||
onPress={() => {
|
||||
window.open('https://github.com/pompurin404/mihomo-party')
|
||||
}}
|
||||
>
|
||||
<IoLogoGithub className="text-lg" />
|
||||
</Button>
|
||||
<>
|
||||
<Button
|
||||
isIconOnly
|
||||
size="sm"
|
||||
title="官方文档"
|
||||
className="mr-2"
|
||||
onPress={() => {
|
||||
window.open('https://mihomo.party')
|
||||
}}
|
||||
>
|
||||
<CgWebsite className="text-lg" />
|
||||
</Button>
|
||||
<Button
|
||||
isIconOnly
|
||||
size="sm"
|
||||
title="GitHub仓库"
|
||||
onPress={() => {
|
||||
window.open('https://github.com/pompurin404/mihomo-party')
|
||||
}}
|
||||
>
|
||||
<IoLogoGithub className="text-lg" />
|
||||
</Button>
|
||||
</>
|
||||
}
|
||||
>
|
||||
<SettingCard>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user