diff --git a/modules/server/src/main/java/io/jpom/service/node/NodeService.java b/modules/server/src/main/java/io/jpom/service/node/NodeService.java index acf669ede..a8bc40374 100644 --- a/modules/server/src/main/java/io/jpom/service/node/NodeService.java +++ b/modules/server/src/main/java/io/jpom/service/node/NodeService.java @@ -83,6 +83,10 @@ public class NodeService extends BaseWorkspaceService { if (StrUtil.isNotEmpty(sshId)) { SshModel byKey = sshService.getByKey(sshId, request); Assert.notNull(byKey, "对应的 SSH 不存在"); + List nodeBySshId = this.getNodeBySshId(sshId); + nodeBySshId = ObjectUtil.defaultIfNull(nodeBySshId, Collections.EMPTY_LIST); + Optional any = nodeBySshId.stream().filter(nodeModel2 -> !StrUtil.equals(id, nodeModel2.getId())).findAny(); + Assert.state(!any.isPresent(), "对应的SSH已经被其他节点绑定啦"); } if (nodeModel.isOpenStatus()) { int timeOut = nodeModel.getTimeOut(); diff --git a/web-vue/src/api/ssh.js b/web-vue/src/api/ssh.js index 381438a3e..32e36e92f 100644 --- a/web-vue/src/api/ssh.js +++ b/web-vue/src/api/ssh.js @@ -15,6 +15,10 @@ export function getSshCheckAgent(params) { url: "/node/ssh/check_agent.json", method: "get", params: params, + timeout: 0, + headers: { + loading: "no", + }, }); } diff --git a/web-vue/src/pages/node/search.vue b/web-vue/src/pages/node/search.vue index d47bd0809..6508fc02c 100644 --- a/web-vue/src/pages/node/search.vue +++ b/web-vue/src/pages/node/search.vue @@ -25,8 +25,12 @@ {{ text }} + - {{ record.port }}/{{ record.pid }} diff --git a/web-vue/src/pages/node/ssh.vue b/web-vue/src/pages/node/ssh.vue index c101faf87..780dc0c68 100644 --- a/web-vue/src/pages/node/ssh.vue +++ b/web-vue/src/pages/node/ssh.vue @@ -5,6 +5,7 @@ 搜索 新增 + 关联节点数据是异步获取有一定时间延迟 @@ -386,6 +387,7 @@ export default { this.list = res.data.result; this.listQuery.total = res.data.total; // + this.sshAgentInfo = {}; let ids = this.list .map((item) => { return item.id;