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:
wonfen
2026-11-19 01:57:09 +08:00
parent 54119cb187
commit 7b7a5947b9
7 changed files with 32 additions and 2 deletions
+3 -1
View File
@@ -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],
)
+2
View File
@@ -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) =>
+4
View File
@@ -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) {