From 165cd336217a8d5c8c2836aa22cd1b3d6776236f Mon Sep 17 00:00:00 2001 From: erio Date: Sat, 7 Mar 2026 17:20:43 +0800 Subject: [PATCH] refactor: move affinity config to quota section with unified style - AffinityConfigCard redesigned to match QuotaLimitCard style (section title + toggle card) - Moved from standalone section to quota area, visible for all Anthropic account types - Green zone (base) allows empty = no limit, min=1 when set; yellow zone hidden when base unset - Deduplicated affinity save logic in EditAccountModal (single block for all Anthropic types) Co-Authored-By: Claude Opus 4.6 --- .../components/account/AffinityConfigCard.vue | 159 ++++++++++-------- .../components/account/EditAccountModal.vue | 71 ++------ frontend/src/i18n/locales/en.ts | 4 +- frontend/src/i18n/locales/zh.ts | 4 +- 4 files changed, 102 insertions(+), 136 deletions(-) diff --git a/frontend/src/components/account/AffinityConfigCard.vue b/frontend/src/components/account/AffinityConfigCard.vue index 099162ac61..c51deb9ac2 100644 --- a/frontend/src/components/account/AffinityConfigCard.vue +++ b/frontend/src/components/account/AffinityConfigCard.vue @@ -35,6 +35,8 @@ const onBaseInput = (e: Event) => { emit('update:base', Number.isNaN(raw) ? null : Math.max(1, Math.floor(raw))) } +const hasBaseLimit = computed(() => props.base != null && props.base > 0) + // buffer: empty = null (infinite yellow), 0 = no yellow, >0 = yellow range const bufferIsInfinite = ref(props.buffer === null || props.buffer === undefined) @@ -78,85 +80,94 @@ const zonePreview = computed(() => {