mirror of
https://gitee.com/dromara/Jpom.git
synced 2024-12-02 20:08:40 +08:00
ssh 安装插件端新增配置脚本执行权限参数
This commit is contained in:
parent
188631bb0a
commit
1e4f3f99e6
@ -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);
|
||||
|
@ -132,6 +132,25 @@
|
||||
<a-form-model-item label="安装路径" prop="path">
|
||||
<a-input v-model="tempNode.path" placeholder="安装路径" />
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="脚本权限" prop="chmod">
|
||||
<a-input v-model="tempNode.chmod" placeholder="非 root 状态下,需要给脚本文件添加权限的命令">
|
||||
<a-tooltip slot="suffix">
|
||||
<template slot="title">
|
||||
<div>非 root 状态下,需要给脚本文件添加权限的命令</div>
|
||||
<div><br /></div>
|
||||
<div>
|
||||
例如
|
||||
<ul>
|
||||
<li>chmod 755</li>
|
||||
<li>chmod u=rwx</li>
|
||||
<li>chmod u+x</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
<a-icon type="question-circle" theme="filled" />
|
||||
</a-tooltip>
|
||||
</a-input>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="等待次数" prop="waitCount">
|
||||
<a-input v-model="tempNode.waitCount" placeholder="上传插件端后,等待插件端启动成功次数,1次5秒。默认5次" />
|
||||
</a-form-model-item>
|
||||
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user