From f9ee62d30ee07ff13e26a0fb7d9a11f376231fc6 Mon Sep 17 00:00:00 2001 From: bwcx_jzy Date: Thu, 16 Jun 2022 12:35:30 +0800 Subject: [PATCH] =?UTF-8?q?fix=20SSH=20=E7=BB=88=E7=AB=AF=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=A0=87=E7=AD=BE=E9=A1=B5=E6=89=93=E5=BC=80=E6=96=B9?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 + .../io/jpom/controller/ssh/SshController.java | 9 ++ web-vue/src/api/ssh.js | 9 ++ web-vue/src/pages/build/list-info.vue | 21 ++--- web-vue/src/pages/ssh/full-terminal.vue | 87 +++++++++++++++++++ web-vue/src/pages/ssh/ssh.vue | 15 ++-- web-vue/src/pages/ssh/terminal.vue | 20 ++--- web-vue/src/router/auth.js | 5 ++ web-vue/src/router/index.js | 5 ++ 9 files changed, 150 insertions(+), 25 deletions(-) create mode 100644 web-vue/src/pages/ssh/full-terminal.vue diff --git a/CHANGELOG.md b/CHANGELOG.md index c393517c0..3121789f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ ### 🐣 新增功能 +1. 【server】SSH 终端新增标签页打开方式(感谢@hu丶向...🤡) + ### 🐞 解决BUG、优化功能 1. 【server】db 安全检查时机前置(是否开启 web 访问),避免突然关闭数据库(感谢@信徒) @@ -35,6 +37,8 @@ > 此版本为不兼容升级,需要手动升级操作数据相关迁移,操作流程如下: +**(下述流程仅供简单思路参考,不同版本间存在部分差异,详细流程还请差异完整文档:[https://jpom.io/pages/upgrade/2.8.x-to-2.9.x](https://jpom.io/pages/upgrade/2.8.x-to-2.9.x) )** + 1. 导出低版本数据 1. 启动程序参数里面添加 --backup-h2 2. linux 环境举例:`sh /xxxx/Server.sh restart --backup-h2` diff --git a/modules/server/src/main/java/io/jpom/controller/ssh/SshController.java b/modules/server/src/main/java/io/jpom/controller/ssh/SshController.java index 785c0ccfc..376d63780 100644 --- a/modules/server/src/main/java/io/jpom/controller/ssh/SshController.java +++ b/modules/server/src/main/java/io/jpom/controller/ssh/SshController.java @@ -101,6 +101,15 @@ public class SshController extends BaseServerController { return new JsonMessage<>(200, "", list); } + @GetMapping(value = "get-item.json", produces = MediaType.APPLICATION_JSON_VALUE) + @Feature(method = MethodFeature.LIST) + public JsonMessage getItem(@ValidatorItem String id) { + SshModel byKey = sshService.getByKey(id, getRequest()); + Assert.notNull(byKey, "对应的 ssh 不存在"); + return new JsonMessage<>(200, "", byKey); + } + + /** * 编辑 * diff --git a/web-vue/src/api/ssh.js b/web-vue/src/api/ssh.js index d0daa92b8..143a3ddf4 100644 --- a/web-vue/src/api/ssh.js +++ b/web-vue/src/api/ssh.js @@ -9,6 +9,15 @@ export function getSshList(params) { }); } +// 查询单个 ssh +export function getItem(params) { + return axios({ + url: "/node/ssh/get-item.json", + method: "get", + params: params, + }); +} + // 检查 ssh 是否安装 插件端 export function getSshCheckAgent(params) { return axios({ diff --git a/web-vue/src/pages/build/list-info.vue b/web-vue/src/pages/build/list-info.vue index 71cdf3b27..f99d99e0c 100644 --- a/web-vue/src/pages/build/list-info.vue +++ b/web-vue/src/pages/build/list-info.vue @@ -88,6 +88,7 @@ 清除代码 @@ -735,30 +736,30 @@ diff --git a/web-vue/src/pages/ssh/ssh.vue b/web-vue/src/pages/ssh/ssh.vue index f5f9455b4..c7ba64a83 100644 --- a/web-vue/src/pages/ssh/ssh.vue +++ b/web-vue/src/pages/ssh/ssh.vue @@ -74,6 +74,11 @@ 全屏终端 + + + 新标签终端 + + @@ -371,14 +376,14 @@