Unverified Commit bedf519f authored by ZackYoung's avatar ZackYoung Committed by GitHub

[Optimize][Web]Optimize java log highlight (#2452)

* fix_some_web_bug * optimize_javalog_highlight
parent f875ba72
...@@ -52,7 +52,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -52,7 +52,7 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j @Slf4j
public class MavenUtil { public class MavenUtil {
static final String javaExecutor = FileUtil.file( static final String javaExecutor = FileUtil.file(
FileUtil.file(SystemUtil.getJavaRuntimeInfo().getHomeDir()).getParentFile(), "/bin/java") FileUtil.file(SystemUtil.getJavaRuntimeInfo().getHomeDir()), "/bin/java")
.getAbsolutePath(); .getAbsolutePath();
private static final String EXECTOR = SystemUtil.getOsInfo().isWindows() ? "mvn.cmd" : "mvn"; private static final String EXECTOR = SystemUtil.getOsInfo().isWindows() ? "mvn.cmd" : "mvn";
......
...@@ -12,7 +12,8 @@ export function LogLanguage(monaco: any) { ...@@ -12,7 +12,8 @@ export function LogLanguage(monaco: any) {
root: [ root: [
// 默认不区分大小写 // // 默认不区分大小写 //
[/\[(\w*-\d*)+\]/, 'custom-thread'], [/\[(\w*-\d*)+\]/, 'custom-thread'],
[/\s+(\w.+):$/, 'custom-class'], [/(\w+(\.))+(\w+)(\(\d+\))?(:){1}/, 'custom-class'],
[/(\w+(\.))+(\w+)(\(\d+\))?\s+/, 'custom-class'],
[/error/, 'custom-error'], [/error/, 'custom-error'],
[/warring/, 'custom-warning'], [/warring/, 'custom-warning'],
[/warn/, 'custom-warning'], [/warn/, 'custom-warning'],
...@@ -20,6 +21,10 @@ export function LogLanguage(monaco: any) { ...@@ -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}/, /^[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' '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'
] ]
] ]
}, },
......
...@@ -45,7 +45,7 @@ type BuildStepsProps = { ...@@ -45,7 +45,7 @@ type BuildStepsProps = {
const CodeShowProps = { const CodeShowProps = {
height: '50vh', height: '50vh',
language: 'java', language: 'javalog',
lineNumbers: 'on', lineNumbers: 'on',
showFloatButton: true showFloatButton: true
}; };
......
...@@ -27,7 +27,8 @@ const CodeEditProps = { ...@@ -27,7 +27,8 @@ const CodeEditProps = {
height: '82vh', height: '82vh',
width: '100%', width: '100%',
lineNumbers: 'on', lineNumbers: 'on',
language: 'java' language: 'javalog',
autoWrap: 'off'
}; };
const RootLogs = () => { const RootLogs = () => {
const [code, setCode] = useState<string>(''); const [code, setCode] = useState<string>('');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment