mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-09-24 16:05:44 +08:00
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:
@@ -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"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user