fix(connection): 复制连接时保持在同一组内

- 修改 `addConnection` 方法以支持指定目标组 ID
- 更新 `duplicateConnection` 函数以传递目标组 ID
- 添加测试用例以验证复制连接的功能
This commit is contained in:
二丫讲梵 authored and GitHub committed 2026-07-02 10:34:48 +08:00
1 parent 60f941aa27
commit c2cc9f22cf
3 files changed
+61 -3

No files matched your search

@@ -1459,7 +1459,7 @@ async function duplicateConnection() {
const config = connectionStore.getConfig(connId);
if (!config) return;
const newConfig = { ...config, id: uuid(), name: `${config.name} (Copy)` };
await connectionStore.addConnection(newConfig);
await connectionStore.addConnection(newConfig, connectionStore.groupIdForConnection(connId));
toast(t("connection.duplicated"), 2000);
}