mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-11-20 15:06:36 +00:00
feat: display client affinity count badge in account status column
Add colored circle badge showing affinity client count before the account status indicator. Badge color reflects count severity (gray=0, green=1-5, yellow=6-15, red=16+). Tooltip shows full client ID list on hover. Backend: AccountHandler batch queries reverse affinity index via GetAccountAffinityClientsBatch, returns affinity_client_count and affinity_clients in DTO. GatewayCache interface extended with the new batch method backed by a Lua script (get_affinity_clients.lua). All test mocks synchronized with updated GatewayCache interface. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
b9dc2e8eb5
commit
ea5e5dd9c7
23 files changed
+176
-15
No files matched your search
@@ -244,6 +244,9 @@ func (m *mockGatewayCacheForPlatform) UpdateClientAffinity(_ context.Context, _
|
||||
func (m *mockGatewayCacheForPlatform) GetAccountAffinityCountBatch(_ context.Context, _ int64, _ []int64, _ time.Duration) (map[int64]int64, error) {
|
||||
return map[int64]int64{}, nil
|
||||
}
|
||||
func (m *mockGatewayCacheForPlatform) GetAccountAffinityClientsBatch(_ context.Context, _ map[int64][]int64, _ time.Duration) (map[int64][]string, error) {
|
||||
return map[int64][]string{}, nil
|
||||
}
|
||||
|
||||
type mockGroupRepoForGateway struct {
|
||||
groups map[int64]*Group
|
||||
|
||||
Reference in new issue
Block a user