feat(pool): 支持号池筛选结果快照批量操作#616
Open
novcky wants to merge 7 commits into
Open
Conversation
aadae3a to
f7b96d4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
管理端号池批量操作里,“全选筛选结果”之前会在执行时按当前筛选条件重新解析账号。
这在筛选结果较大、账号被并发导入/删除/更新,或执行动作前筛选结果发生漂移时,容易让用户确认时看到的选择范围和实际执行范围不完全一致。尤其是删除、禁用、配置代理这类批量写操作,更适合基于确认时的固定账号集合执行。
改动
/keys/selection-snapshot本地管理端接口,用于创建筛选结果快照,并返回数量/分页漂移信息。/keys/resolve-selection,支持通过 snapshot 解析已选账号,同时报告快照成员中已不存在的账号数量。/keys/batch-action,支持 snapshot-backed selection,批量启用、禁用、删除、配置代理、清除代理时按快照成员执行。search_scope时,状态筛选、快捷筛选、评分排序等旧路径继续按 full search 匹配备注、套餐、代理状态等字段;显式search_scope=name时仍只匹配名称/ID。行为变化
范围
本 PR 聚焦管理端号池账号列表的批量选择和批量写操作,不改变普通调度路径,也不改变单个账号操作路径。
验证
cargo test -p aether-gateway selection_snapshot -- --nocapturecargo test -p aether-gateway gateway_pool_list_keys_keeps_legacy_full_search_for_default_filtered_scope -- --nocapturecargo test -p aether-gateway classifies_admin_pool -- --nocapturecargo test -p aether-gateway gateway_handles_admin_pool_batch_action_locally_with_trusted_admin_principal -- --nocapturepnpm vitest run src/features/pool/components/__tests__/PoolAccountBatchDialog.selection.spec.tspnpm -s exec vue-tsc --noEmit风险说明
改动涉及管理端号池本地路由、runtime KV 快照存储和前端批量操作弹窗。快照设置了 TTL、数量上限、管理员归属校验和 Provider 校验,避免长期占用 runtime 状态或跨管理员复用。
主要行为变化是批量写操作会更严格地绑定用户确认时的账号集合,降低筛选结果漂移导致误操作的风险。