Repository navigation
feat: 节点分组 - #51
Merged
Merged
feat: 节点分组#51
Conversation
节点加一个分组(node.group_name,接口字段 group),公开可见,最多 32 字,空为未分组; 分组顺序跟着节点顺序。schema 升到 7。 PUT /api/nodes/batch 把同一份修改应用到选中的全部节点,一个事务,有一台已不存在则整批 不写;名称、备注、地址、国家只能逐台改。单台编辑与批量共用同一套校验和写入。 POST /api/nodes/delete 批量删除,已不存在的跳过,每台一个事务,删除后断开对应 agent。 面板:节点列表加勾选列、分组筛选和批量修改/删除,编辑框加分组输入并列出已有分组, 搜索匹配分组名。NodePicker 加分组筛选,离线通知与延迟监控共用;离线通知的开关改为 一次批量请求。
This was referenced Sep 23, 2026
节点列表不再有勾选列和操作条。工具栏的「分组」打开对话框:填分组名,在节点选择器里勾选 (可按搜索与分组筛选后全选),一次设好;名字留空即移出分组,改名、解散同样由此完成。 选择器的悬停提示带上节点当前的分组。 批量修改价格、周期、流量等的对话框与批量删除一并去掉,POST /api/nodes/delete 删除,删除 节点回到单台接口。PUT /api/nodes/batch 保留,供分组对话框与离线通知使用。
原来每次勾选、全选都立刻发请求,勾选框要等返回和刷新才变化。现在勾选只是草稿,卡片上显示 待保存的台数,「保存」时打开、关闭各至多一个批量请求,「撤销」丢弃草稿。保存后草稿保留到 列表报回新状态为止,勾选不会闪回旧值。
- PUT /api/nodes/batch 的 patch 换成白名单结构 BatchPatch(deny_unknown_fields),NodePatch 以后加的字段不会默认可批量写 - 离线通知的草稿只记在这里勾过的节点,不再是整个集合的快照;另一个会话同时打开的节点不会在保存时被关掉 - 分组筛选停在「未分组」而分组全被解散时回到全部,拖动排序不再被锁住;失效的筛选直接重置,同名分组再出现时不会自己跳回去
# Conflicts: # src/api.rs # web-admin/src/components/Admin.tsx # web-admin/src/lib/api.test.ts
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.
节点分组,以及一次请求完成的批量设置。
group_name(schema 7),接口字段group,公开可见,最多 32 字,空为未分组;分组顺序跟着节点顺序PUT /api/nodes/batch {ids, patch}:同一份修改应用到全部选中节点,一个事务,有一台已不存在则整批不写(404);patch只接受group与notify,其余字段一律 400。单台编辑与批量共用patch_error和Db::update_nodesNodePicker加分组筛选,离线通知与延迟监控共用,悬停提示带上节点当前的分组;离线通知由每次勾选立即逐台请求,改为勾选后点「保存」才提交,打开、关闭各至多一个批量请求;草稿只记本页勾过的节点,其他会话同时改的不会被带回测试:
cargo test新增批量的全有或全无、拒绝的字段、分组公开,迁移一致性测试通过;npm test覆盖分组顺序与筛选;npm run build、oxlint。预览环境 36 台节点浏览器实测分组对话框的设组、筛选后全选、解散,离线通知按分组全选后保存(只发一个请求、保存过程中勾选不闪回),含手机宽度。相关 #45。
文档:monitor-probe/monitor-document#17;默认主题:monitor-probe/monitor-theme-default#7。