From 635a9f7a0eb72194e6a92a9caefca277640290c3 Mon Sep 17 00:00:00 2001 From: ZhouZhou <466902955@qq.com> Date: Fri, 26 May 2023 15:25:44 +0800 Subject: [PATCH] [fix](ui)(fe-system) fix fe System Info query error when the fe server run in Windows. (#20072) (#20073) 1. Fix duplicate '/' in front-end request URI. 2. When the FileSystemSeparator is '\\', replace '\\' as '/' Co-authored-by: labuladuo --- .../org/apache/doris/httpv2/controller/SystemController.java | 4 ++++ ui/src/components/table/table.utils.tsx | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/httpv2/controller/SystemController.java b/fe/fe-core/src/main/java/org/apache/doris/httpv2/controller/SystemController.java index 1bcc7bfc8c..35f682b020 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/httpv2/controller/SystemController.java +++ b/fe/fe-core/src/main/java/org/apache/doris/httpv2/controller/SystemController.java @@ -190,6 +190,10 @@ public class SystemController extends BaseController { if (path == null) { return "/rest/v1/system"; } else { + final String windowsFileSystemSeparator = "\\"; + if (windowsFileSystemSeparator.equals(path.getFileSystem().getSeparator())) { + return "/rest/v1/system?path=" + path.toString().replace("\\", "/"); + } return "/rest/v1/system?path=" + path.toString(); } } diff --git a/ui/src/components/table/table.utils.tsx b/ui/src/components/table/table.utils.tsx index 40ece58f1e..a3fad4b40b 100644 --- a/ui/src/components/table/table.utils.tsx +++ b/ui/src/components/table/table.utils.tsx @@ -30,7 +30,10 @@ function getLinkItem(text, record, index, isInner, item, hrefColumn, path){ if (record.__hrefPaths[hrefColumn.indexOf(item)].includes('http')) { return {text}; } - return {text}; + if (location.search[location.search.length -1] === '/') { + return {text}; + } + return {text}; } return text === '\\N' ? '-' : text; }