mirror of
https://gitee.com/dromara/Jpom.git
synced 2024-11-30 02:48:17 +08:00
ssh 安装插件端
This commit is contained in:
parent
fc40158393
commit
ecd528c366
@ -17,6 +17,7 @@
|
||||
11. 【Server】 新增清空构建代码(解决代码冲突)(感谢@xieyue200810)
|
||||
12. 搭建插件化基础架构
|
||||
13. 用户权限重构,使用角色支持更细粒的权限控制
|
||||
14. 新增ssh快速部署插件端
|
||||
|
||||
### 解决BUG、优化功能
|
||||
|
||||
|
@ -129,21 +129,25 @@ public class SshInstallAgentController extends BaseServerController {
|
||||
// 休眠10秒
|
||||
Thread.sleep(10 * 1000);
|
||||
if (StrUtil.isEmpty(nodeModel.getLoginName()) || StrUtil.isEmpty(nodeModel.getLoginPwd())) {
|
||||
File saveFile;
|
||||
File saveFile = null;
|
||||
try {
|
||||
// 获取远程的授权信息
|
||||
String normalize = FileUtil.normalize(StrUtil.format("{}/{}/{}", path, ConfigBean.DATA, ConfigBean.AUTHORIZE));
|
||||
saveFile = FileUtil.file(tempFilePath, IdUtil.fastSimpleUUID() + ConfigBean.AUTHORIZE);
|
||||
sshService.download(sshModel, normalize, saveFile);
|
||||
//
|
||||
String json = FileUtil.readString(saveFile, CharsetUtil.CHARSET_UTF_8);
|
||||
AgentAutoUser autoUser = JSONObject.parseObject(json, AgentAutoUser.class);
|
||||
nodeModel.setLoginPwd(autoUser.getAgentPwd());
|
||||
nodeModel.setLoginName(autoUser.getAgentName());
|
||||
} catch (Exception e) {
|
||||
DefaultSystemLog.ERROR().error("拉取授权信息失败", e);
|
||||
return JsonMessage.getString(500, "获取授权信息失败", e);
|
||||
} finally {
|
||||
FileUtil.del(saveFile);
|
||||
}
|
||||
String json = FileUtil.readString(saveFile, CharsetUtil.CHARSET_UTF_8);
|
||||
AgentAutoUser autoUser = JSONObject.parseObject(json, AgentAutoUser.class);
|
||||
nodeModel.setLoginPwd(autoUser.getAgentPwd());
|
||||
nodeModel.setLoginName(autoUser.getAgentName());
|
||||
}
|
||||
nodeModel.setOpenStatus(true);
|
||||
// 绑定关系
|
||||
nodeModel.setSshId(sshModel.getId());
|
||||
nodeService.addItem(nodeModel);
|
||||
|
@ -23,7 +23,8 @@
|
||||
进入
|
||||
</button>
|
||||
|
||||
<button th:if="${item.sshId}" op="terminal" th:data-name="${sshName.get(item.sshId)}"
|
||||
<button th:if="${item.sshId!=null && sshName.get(item.sshId)!=null}" op="terminal"
|
||||
th:data-name="${sshName.get(item.sshId)}"
|
||||
th:data-id="${item.sshId}"
|
||||
class="layui-btn layui-btn-sm layui-btn-normal ">
|
||||
<i class="layui-icon layui-icon-layer"></i>
|
||||
|
Loading…
Reference in New Issue
Block a user