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, '加载失败')) {