From 1e4f3f99e6f29a62703ebc77ac35e0cd9bb384b7 Mon Sep 17 00:00:00 2001 From: bwcx_jzy Date: Mon, 27 Sep 2021 21:43:44 +0800 Subject: [PATCH] =?UTF-8?q?ssh=20=E5=AE=89=E8=A3=85=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E7=AB=AF=E6=96=B0=E5=A2=9E=E9=85=8D=E7=BD=AE=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E6=9D=83=E9=99=90=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../node/ssh/SshInstallAgentController.java | 16 +++++++-------- web-vue/src/pages/node/ssh.vue | 20 +++++++++++++++++++ 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/modules/server/src/main/java/io/jpom/controller/node/ssh/SshInstallAgentController.java b/modules/server/src/main/java/io/jpom/controller/node/ssh/SshInstallAgentController.java index fd4fe9fea..10c71ea03 100644 --- a/modules/server/src/main/java/io/jpom/controller/node/ssh/SshInstallAgentController.java +++ b/modules/server/src/main/java/io/jpom/controller/node/ssh/SshInstallAgentController.java @@ -130,16 +130,14 @@ public class SshInstallAgentController extends BaseServerController { sshService.uploadDir(sshModel, path, outFle); // String shPtah = FileUtil.normalize(path + "/" + Type.Agent.name() + ".sh"); - String command = StrUtil.format("sh {} start upgrade", shPtah); + String chmod = getParameter("chmod"); + if (StrUtil.isEmpty(chmod)) { + chmod = StrUtil.EMPTY; + } else { + chmod = StrUtil.format("{} {} && ", chmod, shPtah); + } + String command = StrUtil.format("{}sh {} start upgrade", chmod, shPtah); String result = sshService.exec(sshModel, command); - // 休眠10秒 - /*Thread.sleep(15 * 1000); - if (StrUtil.isEmpty(nodeModel.getLoginName()) || StrUtil.isEmpty(nodeModel.getLoginPwd())) { - String error = this.getAuthorize(sshModel, nodeModel, path); - if (error != null) { - return error; - } - }*/ // 休眠 5 秒, 尝试 5 次 int waitCount = getParameterInt("waitCount", 5); waitCount = Math.max(waitCount, 5); diff --git a/web-vue/src/pages/node/ssh.vue b/web-vue/src/pages/node/ssh.vue index 91f7e8bf4..acd362a88 100644 --- a/web-vue/src/pages/node/ssh.vue +++ b/web-vue/src/pages/node/ssh.vue @@ -132,6 +132,25 @@ + + + + + + + + @@ -507,6 +526,7 @@ export default { formData.append("nodeData", JSON.stringify({ ...this.tempNode })); formData.append("path", this.tempNode.path); formData.append("waitCount", this.tempNode.waitCount); + formData.append("chmod", this.tempNode.chmod); // 提交数据 installAgentNode(formData).then((res) => { if (res.code === 200) {