From b30a48f174ff46cb3f04e1f867086aa42ac736f6 Mon Sep 17 00:00:00 2001 From: lijiahangmax Date: Sun, 25 Feb 2024 19:29:39 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E4=BC=98=E5=8C=96=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/orion-ops-pro/nginx.conf | 2 ++ .../terminal/handler/SftpGetContentHandler.java | 3 ++- .../handler/host/terminal/session/SftpSession.java | 14 +++++++++++++- .../host/transfer/handler/TransferHandler.java | 2 +- .../host/transfer/session/DownloadSession.java | 8 +++++++- .../components/config/ssh/ssh-config-form.vue | 2 +- .../asset/host-list/types/host.table.columns.ts | 4 ++-- .../terminal/components/layout/terminal-panel.vue | 4 ++-- .../host/terminal/components/sftp/sftp-table.vue | 11 ++++++----- .../host/terminal/components/sftp/sftp-view.vue | 2 ++ 10 files changed, 38 insertions(+), 14 deletions(-) diff --git a/docker/orion-ops-pro/nginx.conf b/docker/orion-ops-pro/nginx.conf index 9542e7ea..cd23ac2f 100644 --- a/docker/orion-ops-pro/nginx.conf +++ b/docker/orion-ops-pro/nginx.conf @@ -21,6 +21,8 @@ server { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; + # web history 模式 404 + try_files $uri $uri/ /index.html; } location /orion/api { diff --git a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/handler/host/terminal/handler/SftpGetContentHandler.java b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/handler/host/terminal/handler/SftpGetContentHandler.java index ce1e716f..f4364fe1 100644 --- a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/handler/host/terminal/handler/SftpGetContentHandler.java +++ b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/handler/host/terminal/handler/SftpGetContentHandler.java @@ -1,5 +1,6 @@ package com.orion.ops.module.asset.handler.host.terminal.handler; +import com.orion.ops.framework.common.constant.Const; import com.orion.ops.framework.common.enums.BooleanBit; import com.orion.ops.module.asset.handler.host.terminal.enums.OutputTypeEnum; import com.orion.ops.module.asset.handler.host.terminal.model.request.SftpBaseRequest; @@ -27,7 +28,7 @@ public class SftpGetContentHandler extends AbstractTerminalHandler - { - // 非文件夹并且文件小于 配置大小(MB) 可以编辑 - return !isDir && size <= previewSize * 1024 * 1024; + const canEditable = (size: number, attr: string) => { + // 是普通文件 && 文件小于 配置大小(MB) 可以编辑 + return FILE_TYPE.NORMAL_FILE.value == formatFileType(attr).value + && size <= previewSize * 1024 * 1024; }; // 点击文件名称 const clickFilename = (record: TableData) => { - if (FILE_TYPE.DIRECTORY.value === formatFileType(record.attr).value) { + if (record.isDir) { // 进入文件夹 emits('loadFile', record.path); } else { diff --git a/orion-ops-ui/src/views/host/terminal/components/sftp/sftp-view.vue b/orion-ops-ui/src/views/host/terminal/components/sftp/sftp-view.vue index 579dbd38..459ced7a 100644 --- a/orion-ops-ui/src/views/host/terminal/components/sftp/sftp-view.vue +++ b/orion-ops-ui/src/views/host/terminal/components/sftp/sftp-view.vue @@ -121,6 +121,7 @@ // 编辑文件 const editFile = (name: string, path: string) => { setEditorLoading(true); + setTableLoading(true); splitSize.value = 0.6; editorView.value = true; editorFileName.value = name; @@ -208,6 +209,7 @@ // 接收获取文件内容响应 const resolveSftpGetContent = (path: string, result: string, content: string) => { + setTableLoading(false); setEditorLoading(false); // 检查结果 if (!checkResult(result, '加载失败')) {