feat(dns): remember override state per profile

Save the DNS override switch and session confirmation per profile so automatic protection only disables the affected profile. Preserve the legacy switch as the initial preference and show the profile scope beside the settings gear and in the DNS editor.

Refs #7993
This commit is contained in:
wonfen
2026-09-22 10:54:55 +08:00
parent 6a85d0344e
commit ff1ce92fac
25 changed files with 237 additions and 64 deletions
+6 -2
View File
@@ -172,10 +172,14 @@ export async function patchVergeConfig(payload: IVergeConfig) {
return invoke<void>('patch_verge_config', { payload })
}
export async function setDnsOverride(enabled: boolean, confirmation?: string) {
export async function setDnsOverride(
profileUid: string,
enabled: boolean,
confirmation?: string,
) {
return invoke<
{ status: 'applied' } | { status: 'confirmation_required'; source: string }
>('set_dns_override', { enabled, confirmation })
>('set_dns_override', { profileUid, enabled, confirmation })
}
export async function takeDnsOverrideNotice() {