From c66e62623eb7516bc20d684dd64a949d5fbc3232 Mon Sep 17 00:00:00 2001 From: lijiahangmax Date: Mon, 22 Apr 2024 21:43:12 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E9=87=8A=E6=94=BE=E8=B5=84=E6=BA=90.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ops/module/asset/service/impl/ExecLogServiceImpl.java | 5 ++++- .../host/authorized-host-modal/components/host-group.vue | 2 +- .../terminal/components/new-connection/host-group-view.vue | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/service/impl/ExecLogServiceImpl.java b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/service/impl/ExecLogServiceImpl.java index 3e07df17..5510e7d5 100644 --- a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/service/impl/ExecLogServiceImpl.java +++ b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/service/impl/ExecLogServiceImpl.java @@ -10,6 +10,7 @@ import com.orion.lang.utils.Objects1; import com.orion.lang.utils.Strings; import com.orion.lang.utils.collect.Lists; import com.orion.lang.utils.io.Files1; +import com.orion.lang.utils.io.Streams; import com.orion.ops.framework.biz.operator.log.core.utils.OperatorLogs; import com.orion.ops.framework.common.constant.Const; import com.orion.ops.framework.common.constant.ErrorMessage; @@ -405,6 +406,7 @@ public class ExecLogServiceImpl implements ExecLogService { @Override public void downloadLogFile(Long id, String source, HttpServletResponse response) { log.info("ExecLogService.downloadLogFile id: {}, source: {}", id, source); + InputStream in = null; try { // 获取主机执行日志 ExecHostLogDO hostLog = execHostLogDAO.selectById(id); @@ -418,11 +420,12 @@ public class ExecLogServiceImpl implements ExecLogService { OperatorLogs.add(OperatorLogs.HOST_ID, hostLog.getHostId()); OperatorLogs.add(OperatorLogs.HOST_NAME, hostLog.getHostName()); // 获取日志 - InputStream in = logsFileClient.getContentInputStream(logPath); + in = logsFileClient.getContentInputStream(logPath); // 返回 Servlets.transfer(response, in, Files1.getFileName(logPath)); } catch (Exception e) { log.error("ExecLogService.downloadLogFile error id: {}", id, e); + Streams.close(in); String errorMessage = ErrorMessage.FILE_READ_ERROR; if (e instanceof InvalidArgumentException) { errorMessage = e.getMessage(); diff --git a/orion-ops-ui/src/components/asset/host/authorized-host-modal/components/host-group.vue b/orion-ops-ui/src/components/asset/host/authorized-host-modal/components/host-group.vue index 2789458b..059d86f1 100644 --- a/orion-ops-ui/src/components/asset/host/authorized-host-modal/components/host-group.vue +++ b/orion-ops-ui/src/components/asset/host/authorized-host-modal/components/host-group.vue @@ -77,8 +77,8 @@ .group-view-container { display: flex; justify-content: space-between; - height: 100%; width: 100%; + height: 100%; } .host-group-container { diff --git a/orion-ops-ui/src/views/host/terminal/components/new-connection/host-group-view.vue b/orion-ops-ui/src/views/host/terminal/components/new-connection/host-group-view.vue index 00c67d0f..c15faa64 100644 --- a/orion-ops-ui/src/views/host/terminal/components/new-connection/host-group-view.vue +++ b/orion-ops-ui/src/views/host/terminal/components/new-connection/host-group-view.vue @@ -60,8 +60,8 @@ .group-view-container { display: flex; justify-content: space-between; - max-height: 100%; width: 100%; + height: 100%; } .host-group-container {