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> => {
|
const handleImport = async (): Promise<void> => {
|
||||||
setImporting(true)
|
setImporting(true)
|
||||||
try {
|
try {
|
||||||
|
const urlObj = new URL(url)
|
||||||
|
const name = urlObj.pathname.split('/').pop()
|
||||||
await addOverrideItem({
|
await addOverrideItem({
|
||||||
name: '',
|
name: name ? decodeURIComponent(name) : undefined,
|
||||||
type: 'remote',
|
type: 'remote',
|
||||||
url,
|
url,
|
||||||
ext: url.endsWith('.js') ? 'js' : 'yaml'
|
ext: urlObj.pathname.endsWith('.js') ? 'js' : 'yaml'
|
||||||
})
|
})
|
||||||
} finally {
|
} finally {
|
||||||
setImporting(false)
|
setImporting(false)
|
||||||
@ -106,7 +108,31 @@ const Override: React.FC = () => {
|
|||||||
}, [items])
|
}, [items])
|
||||||
|
|
||||||
return (
|
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">
|
<div className="sticky top-[48px] z-40 backdrop-blur bg-background/40 flex p-2">
|
||||||
<Input
|
<Input
|
||||||
variant="bordered"
|
variant="bordered"
|
||||||
|
|||||||
@ -17,6 +17,7 @@ import {
|
|||||||
webdavBackup,
|
webdavBackup,
|
||||||
listWebdavBackups
|
listWebdavBackups
|
||||||
} from '@renderer/utils/ipc'
|
} from '@renderer/utils/ipc'
|
||||||
|
import { CgWebsite } from 'react-icons/cg'
|
||||||
import { IoLogoGithub } from 'react-icons/io5'
|
import { IoLogoGithub } from 'react-icons/io5'
|
||||||
import { platform, version } from '@renderer/utils/init'
|
import { platform, version } from '@renderer/utils/init'
|
||||||
import useSWR from 'swr'
|
import useSWR from 'swr'
|
||||||
@ -130,15 +131,29 @@ const Settings: React.FC = () => {
|
|||||||
<BasePage
|
<BasePage
|
||||||
title="应用设置"
|
title="应用设置"
|
||||||
header={
|
header={
|
||||||
<Button
|
<>
|
||||||
isIconOnly
|
<Button
|
||||||
size="sm"
|
isIconOnly
|
||||||
onPress={() => {
|
size="sm"
|
||||||
window.open('https://github.com/pompurin404/mihomo-party')
|
title="官方文档"
|
||||||
}}
|
className="mr-2"
|
||||||
>
|
onPress={() => {
|
||||||
<IoLogoGithub className="text-lg" />
|
window.open('https://mihomo.party')
|
||||||
</Button>
|
}}
|
||||||
|
>
|
||||||
|
<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>
|
<SettingCard>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user