From bedf519f9a27e74db044cf713f6acf1dcc64a364 Mon Sep 17 00:00:00 2001 From: ZackYoung Date: Sat, 28 Oct 2023 23:20:03 +0800 Subject: [PATCH] [Optimize][Web]Optimize java log highlight (#2452) * fix_some_web_bug * optimize_javalog_highlight --- dinky-admin/src/main/java/org/dinky/utils/MavenUtil.java | 2 +- .../components/CustomEditor/languages/javalog/index.tsx | 7 ++++++- .../GitProject/components/BuildSteps/AutoSteps/index.tsx | 2 +- .../SettingCenter/SystemLogs/TagInfo/RootLogs/index.tsx | 3 ++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/dinky-admin/src/main/java/org/dinky/utils/MavenUtil.java b/dinky-admin/src/main/java/org/dinky/utils/MavenUtil.java index c54148339f..63a0289f5f 100644 --- a/dinky-admin/src/main/java/org/dinky/utils/MavenUtil.java +++ b/dinky-admin/src/main/java/org/dinky/utils/MavenUtil.java @@ -52,7 +52,7 @@ @Slf4j public class MavenUtil { static final String javaExecutor = FileUtil.file( - FileUtil.file(SystemUtil.getJavaRuntimeInfo().getHomeDir()).getParentFile(), "/bin/java") + FileUtil.file(SystemUtil.getJavaRuntimeInfo().getHomeDir()), "/bin/java") .getAbsolutePath(); private static final String EXECTOR = SystemUtil.getOsInfo().isWindows() ? "mvn.cmd" : "mvn"; diff --git a/dinky-web/src/components/CustomEditor/languages/javalog/index.tsx b/dinky-web/src/components/CustomEditor/languages/javalog/index.tsx index 01948a1db4..c956b43e1a 100644 --- a/dinky-web/src/components/CustomEditor/languages/javalog/index.tsx +++ b/dinky-web/src/components/CustomEditor/languages/javalog/index.tsx @@ -12,7 +12,8 @@ export function LogLanguage(monaco: any) { root: [ // 默认不区分大小写 // [/\[(\w*-\d*)+\]/, 'custom-thread'], - [/\s+(\w.+):$/, 'custom-class'], + [/(\w+(\.))+(\w+)(\(\d+\))?(:){1}/, 'custom-class'], + [/(\w+(\.))+(\w+)(\(\d+\))?\s+/, 'custom-class'], [/error/, 'custom-error'], [/warring/, 'custom-warning'], [/warn/, 'custom-warning'], @@ -20,6 +21,10 @@ export function LogLanguage(monaco: any) { [ /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])\s+(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d\.\d{3}/, 'custom-date' + ], + [ + /[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])\s+(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d\s(CST)/, + 'custom-date' ] ] }, diff --git a/dinky-web/src/pages/RegCenter/GitProject/components/BuildSteps/AutoSteps/index.tsx b/dinky-web/src/pages/RegCenter/GitProject/components/BuildSteps/AutoSteps/index.tsx index fba708241d..d5b83e5095 100644 --- a/dinky-web/src/pages/RegCenter/GitProject/components/BuildSteps/AutoSteps/index.tsx +++ b/dinky-web/src/pages/RegCenter/GitProject/components/BuildSteps/AutoSteps/index.tsx @@ -45,7 +45,7 @@ type BuildStepsProps = { const CodeShowProps = { height: '50vh', - language: 'java', + language: 'javalog', lineNumbers: 'on', showFloatButton: true }; diff --git a/dinky-web/src/pages/SettingCenter/SystemLogs/TagInfo/RootLogs/index.tsx b/dinky-web/src/pages/SettingCenter/SystemLogs/TagInfo/RootLogs/index.tsx index 4f3a0a3738..1156079ad0 100644 --- a/dinky-web/src/pages/SettingCenter/SystemLogs/TagInfo/RootLogs/index.tsx +++ b/dinky-web/src/pages/SettingCenter/SystemLogs/TagInfo/RootLogs/index.tsx @@ -27,7 +27,8 @@ const CodeEditProps = { height: '82vh', width: '100%', lineNumbers: 'on', - language: 'java' + language: 'javalog', + autoWrap: 'off' }; const RootLogs = () => { const [code, setCode] = useState('');