mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-19 18:32:10 +08:00
feat(home): follow url-test/fallback groups picked on the node card
The card lists fallback groups again, and switching it to a url-test or fallback group points the first select group at it without fixing a node.
This commit is contained in:
@@ -55,6 +55,7 @@ import {
|
||||
useCoreDataStatus,
|
||||
useProxiesData,
|
||||
} from '@/providers/app-data-context'
|
||||
import { followProxyGroup } from '@/services/cmds'
|
||||
import delayManager from '@/services/delay'
|
||||
import {
|
||||
findCurrentGroupMember,
|
||||
@@ -665,7 +666,7 @@ export const CurrentProxyCard = () => {
|
||||
return proxyView.groups.filter(
|
||||
(group) =>
|
||||
!group.hidden &&
|
||||
(group.type === 'Selector' || group.type === 'URLTest'),
|
||||
['Selector', 'URLTest', 'Fallback'].includes(group.type),
|
||||
)
|
||||
}, [proxyView])
|
||||
|
||||
@@ -765,6 +766,7 @@ export const CurrentProxyCard = () => {
|
||||
if (isGlobalMode || isDirectMode) return
|
||||
setLastGroupName(newGroupName)
|
||||
writeProfileScopedItem(STORAGE_KEY_GROUP, newGroupName)
|
||||
void followProxyGroup(newGroupName)
|
||||
},
|
||||
[isDirectMode, isGlobalMode, writeProfileScopedItem],
|
||||
)
|
||||
|
||||
@@ -83,6 +83,8 @@ export const commands = {
|
||||
__TAURI_INVOKE<null>('record_selected_node', { groupName, node }),
|
||||
switchProxyNode: (groupName: string, proxyName: string, unfix: boolean) =>
|
||||
__TAURI_INVOKE<null>('switch_proxy_node', { groupName, proxyName, unfix }),
|
||||
followProxyGroup: (groupName: string) =>
|
||||
__TAURI_INVOKE<void>('follow_proxy_group', { groupName }),
|
||||
saveDnsConfig: (dnsConfig: YamlMapping) =>
|
||||
__TAURI_INVOKE<null>('save_dns_config', { dnsConfig }),
|
||||
applyDnsConfig: (apply: boolean) =>
|
||||
|
||||
@@ -165,6 +165,10 @@ export async function switchProxyNode(
|
||||
return commands.switchProxyNode(groupName, proxyName, unfix)
|
||||
}
|
||||
|
||||
export async function followProxyGroup(groupName: string) {
|
||||
return commands.followProxyGroup(groupName)
|
||||
}
|
||||
|
||||
export async function getProxyView(): Promise<ProxyViewV1> {
|
||||
const view = await commands.getProxyView()
|
||||
if (view.schemaVersion !== 1) {
|
||||
|
||||
Reference in New Issue
Block a user