fix: show affinity badge for enabled accounts even with 0 clients

- Backend: remove count > 0 filter in GetAccountAffinityCountBatch so
  accounts with 0 bound clients are included in the response
- Frontend: change badge condition from affinityClientCount > 0 to
  account.client_affinity_enabled so the badge always shows for accounts
  with affinity enabled

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
erio
2026-03-06 17:00:46 +08:00
co-authored by Claude Opus 4.6
parent 064a70db29
commit 7fe246b784
2 changed files with 2 additions and 4 deletions
+1 -3
View File
@@ -188,9 +188,7 @@ func (c *gatewayCache) GetAccountAffinityCountBatch(ctx context.Context, account
if err != nil && err != redis.Nil {
continue
}
if count > 0 {
result[id] = count
}
result[id] = count
}
return result, nil
}
@@ -2,7 +2,7 @@
<div class="flex items-center gap-2">
<!-- Affinity Client Count Badge -->
<div
v-if="affinityClientCount > 0"
v-if="account.client_affinity_enabled"
class="group/affinity relative"
@mouseenter="loadAffinityClients"
>