mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-09-24 16:05:44 +08:00
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>
6 lines
295 B
Lua
6 lines
295 B
Lua
-- 清理过期成员后返回反向索引的 clientID 列表(按最近使用降序)
|
|
-- KEYS[1] = client_affinity_rev:{groupID}:{accountID}
|
|
-- ARGV[1] = 过期阈值时间戳 (now - ttl)
|
|
redis.call('ZREMRANGEBYSCORE', KEYS[1], '-inf', ARGV[1])
|
|
return redis.call('ZREVRANGE', KEYS[1], 0, -1)
|