Unverified Commit 44511d4f authored by zhu-mingye's avatar zhu-mingye Committed by GitHub

improve some feature & added `flinksql` language for editor (#2533)

* Spotless Apply * improve some feature * improve some feature * Spotless Apply * format code * format code * format code * format code --------- Co-authored-by: 's avatarzhu-mingye <zhu-mingye@users.noreply.github.com>
parent ca88bace
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
package org.dinky.data.dto; package org.dinky.data.dto;
import org.dinky.config.Dialect;
import org.dinky.data.model.Task; import org.dinky.data.model.Task;
import org.dinky.data.model.ext.TaskExtConfig; import org.dinky.data.model.ext.TaskExtConfig;
import org.dinky.job.JobConfig; import org.dinky.job.JobConfig;
...@@ -231,7 +230,6 @@ public class TaskDTO extends AbstractStatementDTO { ...@@ -231,7 +230,6 @@ public class TaskDTO extends AbstractStatementDTO {
JobConfig jobConfig = new JobConfig(); JobConfig jobConfig = new JobConfig();
BeanUtil.copyProperties(this, jobConfig); BeanUtil.copyProperties(this, jobConfig);
jobConfig.setConfigJson(parsedConfig); jobConfig.setConfigJson(parsedConfig);
jobConfig.setJarTask(isJarTask());
jobConfig.setTaskId(id); jobConfig.setTaskId(id);
jobConfig.setJobName(name); jobConfig.setJobName(name);
...@@ -243,8 +241,4 @@ public class TaskDTO extends AbstractStatementDTO { ...@@ -243,8 +241,4 @@ public class TaskDTO extends AbstractStatementDTO {
BeanUtil.copyProperties(this, task); BeanUtil.copyProperties(this, task);
return task; return task;
} }
public boolean isJarTask() {
return Dialect.isJarDialect(dialect);
}
} }
...@@ -387,9 +387,6 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen ...@@ -387,9 +387,6 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
} }
JobManager jobManager = JobManager.build(config); JobManager jobManager = JobManager.build(config);
if (config.isJarTask()) {
return "";
}
return jobManager.exportSql(task.getStatement()); return jobManager.exportSql(task.getStatement());
} }
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<!--这个是输出日志的格式,如果对里面的参数不理解,可以去看我的这篇文章,网址是:“https://blog.csdn.net/qq_42449963/article/details/104617356”--> <!--这个是输出日志的格式,如果对里面的参数不理解,可以去看我的这篇文章,网址是:“https://blog.csdn.net/qq_42449963/article/details/104617356”-->
<!--<PatternLayout pattern="[dinky] %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %class{36} %L %M - %msg%xEx%n"/>--> <!--<PatternLayout pattern="[dinky] %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %class{36} %L %M - %msg%xEx%n"/>-->
<PatternLayout <PatternLayout
pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %p [%15.15t] %c{20}(%L): %m"/> pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %p %c{20}(%L): %m"/>
</LogSseAppender> </LogSseAppender>
</appenders> </appenders>
......
...@@ -80,9 +80,6 @@ public class JobConfig { ...@@ -80,9 +80,6 @@ public class JobConfig {
notes = "Cluster configuration ID") notes = "Cluster configuration ID")
private Integer clusterConfigurationId; private Integer clusterConfigurationId;
@ApiModelProperty(value = "JAR file ID", dataType = "Integer", example = "101", notes = "JAR file ID")
private Integer jarId;
@ApiModelProperty(value = "Task JobLifeCycle", dataType = "Integer", example = "2", notes = "Task JobLifeCycle") @ApiModelProperty(value = "Task JobLifeCycle", dataType = "Integer", example = "2", notes = "Task JobLifeCycle")
private Integer step; private Integer step;
...@@ -128,13 +125,6 @@ public class JobConfig { ...@@ -128,13 +125,6 @@ public class JobConfig {
notes = "Flag indicating whether to use remote execution") notes = "Flag indicating whether to use remote execution")
private boolean useRemote; private boolean useRemote;
@ApiModelProperty(
value = "Flag indicating whether it's a JAR task",
dataType = "boolean",
example = "false",
notes = "Flag indicating whether it's a JAR task")
private boolean isJarTask;
@ApiModelProperty( @ApiModelProperty(
value = "Job manager address", value = "Job manager address",
dataType = "String", dataType = "String",
......
...@@ -37,30 +37,30 @@ ...@@ -37,30 +37,30 @@
"dependencies": { "dependencies": {
"@ant-design/charts": "^1.4.2", "@ant-design/charts": "^1.4.2",
"@ant-design/icons": "^5.2.6", "@ant-design/icons": "^5.2.6",
"@ant-design/pro-components": "^2.6.27", "@ant-design/pro-components": "^2.6.41",
"@ant-design/pro-layout": "^7.17.6", "@ant-design/pro-layout": "^7.17.15",
"@ant-design/pro-table": "^3.12.11", "@ant-design/pro-table": "^3.13.9",
"@ant-design/use-emotion-css": "^1.0.4", "@ant-design/use-emotion-css": "^1.0.4",
"@antv/x6": "^2.15.1", "@antv/x6": "^2.15.6",
"@antv/x6-plugin-selection": "^2.2.1", "@antv/x6-plugin-selection": "^2.2.1",
"@antv/x6-react-shape": "^2.2.2", "@antv/x6-react-shape": "^2.2.2",
"@monaco-editor/react": "^4.5.2", "@monaco-editor/react": "^4.6.0",
"@umijs/route-utils": "^4.0.1", "@umijs/route-utils": "^4.0.1",
"antd": "^5.9.3", "antd": "^5.11.1",
"butterfly-dag": "^4.3.28", "butterfly-dag": "^4.3.28",
"classnames": "^2.3.2", "classnames": "^2.3.2",
"dayjs": "^1.11.10", "dayjs": "^1.11.10",
"js-cookie": "^3.0.5", "js-cookie": "^3.0.5",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"million": "^2.6.1", "million": "^2.6.4",
"moment": "^2.29.4", "moment": "^2.29.4",
"monaco-editor": "^0.44.0", "monaco-editor": "^0.44.0",
"omit.js": "^2.0.2", "omit.js": "^2.0.2",
"rc-menu": "^9.12.0", "rc-menu": "^9.12.2",
"rc-util": "^5.37.0", "rc-util": "^5.38.1",
"re-resizable": "^6.9.11", "re-resizable": "^6.9.11",
"react": "^18.2.0", "react": "^18.2.0",
"react-countup": "^6.4.2", "react-countup": "^6.5.0",
"react-dom": "^18.0.0", "react-dom": "^18.0.0",
"react-helmet-async": "^1.3.0", "react-helmet-async": "^1.3.0",
"react-lineage-dag": "^2.0.36", "react-lineage-dag": "^2.0.36",
...@@ -70,8 +70,8 @@ ...@@ -70,8 +70,8 @@
"redux-persist": "^6.0.0", "redux-persist": "^6.0.0",
"remark-gfm": "^4.0.0", "remark-gfm": "^4.0.0",
"screenfull": "^6.0.2", "screenfull": "^6.0.2",
"sql-formatter": "^13.0.2", "sql-formatter": "^13.1.0",
"styled-components": "^6.0.8", "styled-components": "^6.1.1",
"use-sse": "^2.0.1" "use-sse": "^2.0.1"
}, },
"devDependencies": { "devDependencies": {
......
/* /*
*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
...@@ -16,7 +17,7 @@ ...@@ -16,7 +17,7 @@
* *
*/ */
import { TabsItemType } from '@/pages/DataStudio/types'; import { TabsItemType } from '@/pages/DataStudio/model';
import { Button } from 'antd'; import { Button } from 'antd';
import React from 'react'; import React from 'react';
......
...@@ -22,13 +22,14 @@ import { editor, languages, Position } from 'monaco-editor'; ...@@ -22,13 +22,14 @@ import { editor, languages, Position } from 'monaco-editor';
import { buildAllSuggestionsToEditor } from '@/components/CustomEditor/CodeEdit/function'; import { buildAllSuggestionsToEditor } from '@/components/CustomEditor/CodeEdit/function';
import EditorFloatBtn from '@/components/CustomEditor/EditorFloatBtn'; import EditorFloatBtn from '@/components/CustomEditor/EditorFloatBtn';
import { LoadCustomEditorLanguage } from '@/components/CustomEditor/languages';
import { StateType } from '@/pages/DataStudio/model'; import { StateType } from '@/pages/DataStudio/model';
import { MonacoEditorOptions } from '@/types/Public/data'; import { MonacoEditorOptions } from '@/types/Public/data';
import { convertCodeEditTheme } from '@/utils/function'; import { convertCodeEditTheme } from '@/utils/function';
import { Editor, Monaco, OnChange } from '@monaco-editor/react'; import { Editor, Monaco, OnChange, useMonaco } from '@monaco-editor/react';
import { connect } from '@umijs/max'; import { connect } from '@umijs/max';
import useMemoCallback from 'rc-menu/es/hooks/useMemoCallback'; import useMemoCallback from 'rc-menu/es/hooks/useMemoCallback';
import { memo, useCallback, useRef } from 'react'; import { memo, useCallback, useEffect, useRef } from 'react';
import ITextModel = editor.ITextModel; import ITextModel = editor.ITextModel;
import CompletionItem = languages.CompletionItem; import CompletionItem = languages.CompletionItem;
import CompletionContext = languages.CompletionContext; import CompletionContext = languages.CompletionContext;
...@@ -94,6 +95,15 @@ const CodeEdit = (props: CodeEditFormProps & connect) => { ...@@ -94,6 +95,15 @@ const CodeEdit = (props: CodeEditFormProps & connect) => {
const { ScrollType } = editor; const { ScrollType } = editor;
// 使用编辑器钩子, 拿到编辑器实例
const monacoHook = useMonaco();
useEffect(() => {
convertCodeEditTheme(monacoHook?.editor);
// 需要调用 手动注册下自定义语言
LoadCustomEditorLanguage(monacoHook);
}, [monacoHook]);
// todo: 已知 bug , 切换 tab 时 , 会造成buildAllSuggestions 的重复调用 , 造成建议项重复 ,但不影响原有数据, 编辑器会将建议项自动缓存,不会进行去重 // todo: 已知 bug , 切换 tab 时 , 会造成buildAllSuggestions 的重复调用 , 造成建议项重复 ,但不影响原有数据, 编辑器会将建议项自动缓存,不会进行去重
/** /**
* build all suggestions * build all suggestions
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
*/ */
import EditorFloatBtn from '@/components/CustomEditor/EditorFloatBtn'; import EditorFloatBtn from '@/components/CustomEditor/EditorFloatBtn';
import { LogLanguage } from '@/components/CustomEditor/languages/javalog'; import { LoadCustomEditorLanguage } from '@/components/CustomEditor/languages';
import { Loading } from '@/pages/Other/Loading'; import { Loading } from '@/pages/Other/Loading';
import { MonacoEditorOptions } from '@/types/Public/data'; import { MonacoEditorOptions } from '@/types/Public/data';
import { convertCodeEditTheme } from '@/utils/function'; import { convertCodeEditTheme } from '@/utils/function';
...@@ -94,7 +94,7 @@ const CodeShow = (props: CodeShowFormProps) => { ...@@ -94,7 +94,7 @@ const CodeShow = (props: CodeShowFormProps) => {
useEffect(() => { useEffect(() => {
convertCodeEditTheme(monaco?.editor); convertCodeEditTheme(monaco?.editor);
// 需要调用 手动注册下自定义语言 // 需要调用 手动注册下自定义语言
LogLanguage(monaco); LoadCustomEditorLanguage(monaco);
}, [monaco]); }, [monaco]);
/** /**
......
/*
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
export const TokenClassConsts = {
BINARY: 'binary',
BINARY_ESCAPE: 'binary.escape',
COMMENT: 'comment',
COMMENT_QUOTE: 'comment.quote',
DELIMITER: 'delimiter',
DELIMITER_CURLY: 'delimiter.curly',
DELIMITER_PAREN: 'delimiter.paren',
DELIMITER_SQUARE: 'delimiter.square',
IDENTIFIER: 'identifier',
IDENTIFIER_QUOTE: 'identifier.quote',
KEYWORD: 'keyword',
KEYWORD_SCOPE: 'keyword.scope',
NUMBER: 'number',
NUMBER_FLOAT: 'number.float',
NUMBER_BINARY: 'number.binary',
NUMBER_OCTAL: 'number.octal',
NUMBER_HEX: 'number.hex',
OPERATOR: 'operators',
OPERATOR_KEYWORD: 'operators.keyword',
OPERATOR_SYMBOL: 'operators.symbol',
PREDEFINED: 'predefined',
STRING: 'string',
STRING_ESCAPE: 'string.escape',
STRING_ESCAPE_CHAR: 'string.escape.char',
TYPE: 'type',
VARIABLE: 'variable',
WHITE: 'white'
};
/*
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { TokenClassConsts } from '@/components/CustomEditor/languages/flinksql/constants';
import {
EXTEND_SQL_KEYWORD,
FLINK_SQL_BUILTIN_FUNCTIONS,
FLINK_SQL_KEYWORD,
FLINK_SQL_OPERATORS,
FLINK_SQL_SCOPE_KEYWORDS,
FLINK_SQL_TYPE_KEYWORDS
} from '@/components/CustomEditor/languages/flinksql/keyword';
import { Monaco } from '@monaco-editor/react';
export function FlinkSQLLanguage(monaco: Monaco | null) {
// Register a new language
monaco?.languages.register({
id: 'flinksql',
extensions: ['.sql'],
aliases: ['flinksql', 'fsql', 'flinksql', 'flinkSQL', 'FlinkSQL']
});
monaco?.languages.setMonarchTokensProvider('flinksql', {
defaultToken: '',
tokenPostfix: '.sql',
keywords: [...FLINK_SQL_KEYWORD, ...EXTEND_SQL_KEYWORD],
operators: FLINK_SQL_OPERATORS,
ignoreCase: true, // 忽略大小写
builtinFunctions: FLINK_SQL_BUILTIN_FUNCTIONS,
builtinVariables: [],
typeKeywords: FLINK_SQL_TYPE_KEYWORDS,
scopeKeywords: FLINK_SQL_SCOPE_KEYWORDS,
pseudoColumns: [],
comments: {
lineComment: '--',
blockComment: ['/*', '*/']
},
brackets: [
{ open: '{', close: '}', token: 'delimiter.curly' },
{ open: '[', close: ']', token: 'delimiter.bracket' },
{ open: '(', close: ')', token: 'delimiter.parenthesis' }
],
autoClosingPairs: [
{ open: '{', close: '}' },
{ open: '[', close: ']' },
{ open: '(', close: ')' },
{ open: '"', close: '"' },
{ open: "'", close: "'" },
{ open: '`', close: '`' }
],
surroundingPairs: [
{ open: '{', close: '}' },
{ open: '[', close: ']' },
{ open: '(', close: ')' },
{ open: '"', close: '"' },
{ open: "'", close: "'" },
{ open: '`', close: '`' }
],
folding: {
markers: {
start:
/((create|alter|drop|rename\s+)?(TABLE|DATABASE|STREAM|FUNCTION|PROCEDURE|PACKAGE|TYPE|TRIGGER|INDEX|SCHEMA|VIEW)\b)|((EXECUTE\s+)?(JAR|CDCSOURCE)?\b)/i,
end: /\)\\;\b/i
}
},
tokenizer: {
root: [
{ include: '@comments' },
{ include: '@whitespace' },
{ include: '@pseudoColumns' },
{ include: '@numbers' },
{ include: '@strings' },
{ include: '@complexIdentifiers' },
{ include: '@scopes' },
{ include: '@complexDataTypes' },
[
/[\w@#$]+/,
{
cases: {
'@scopeKeywords': TokenClassConsts.KEYWORD_SCOPE,
'@operators': TokenClassConsts.OPERATOR_KEYWORD,
'@typeKeywords': TokenClassConsts.TYPE,
'@builtinVariables': TokenClassConsts.VARIABLE,
'@builtinFunctions': TokenClassConsts.PREDEFINED,
'@keywords': TokenClassConsts.KEYWORD,
'@default': TokenClassConsts.IDENTIFIER,
fontWeight: 'normal'
}
}
]
],
whitespace: [[/[\s\t\r\n]+/, TokenClassConsts.WHITE]],
comments: [
[/--+.*/, TokenClassConsts.COMMENT],
[/\/\*/, { token: TokenClassConsts.COMMENT_QUOTE, next: '@comment' }]
],
comment: [
[/[^*/]+/, TokenClassConsts.COMMENT],
[/\/\*/, { token: TokenClassConsts.COMMENT_QUOTE, next: '@push' }], // nested comment not allowed :-(
[/\*\//, { token: TokenClassConsts.COMMENT_QUOTE, next: '@pop' }],
[/./, TokenClassConsts.COMMENT]
],
pseudoColumns: [
[
/[$][A-Za-z_][\w@#$]*/,
{
cases: {
'@pseudoColumns': TokenClassConsts.PREDEFINED,
'@default': TokenClassConsts.IDENTIFIER
}
}
]
],
numbers: [
[/0[xX][0-9a-fA-F]*/, TokenClassConsts.NUMBER_HEX],
[/[$][+-]*\d*(\.\d*)?/, TokenClassConsts.NUMBER],
[/((\d+(\.\d*)?)|(\.\d+))([eE][\\\-+]?\d+)?/, TokenClassConsts.NUMBER]
],
strings: [[/'/, { token: 'custom-error', next: '@string' }]],
string: [
[/[^']+/, TokenClassConsts.STRING],
[/''/, TokenClassConsts.STRING],
[/'/, { token: TokenClassConsts.STRING, next: '@pop' }]
],
complexIdentifiers: [
[/`/, { token: TokenClassConsts.IDENTIFIER_QUOTE, next: '@quotedIdentifier' }]
],
quotedIdentifier: [
[/[^`]+/, TokenClassConsts.IDENTIFIER_QUOTE],
[/``/, TokenClassConsts.IDENTIFIER_QUOTE],
[/`/, { token: TokenClassConsts.IDENTIFIER_QUOTE, next: '@pop' }]
],
scopes: [
[/(EXECUTE\s+)?JAR\s+/i, TokenClassConsts.KEYWORD_SCOPE],
[/(EXECUTE\s+)?CDCSOURCE\s/i, TokenClassConsts.KEYWORD_SCOPE],
[/(PRINT\s+)?\s/i, TokenClassConsts.KEYWORD_SCOPE]
],
complexDataTypes: [
[/DOUBLE\s+PRECISION\b/i, { token: TokenClassConsts.TYPE }],
[/WITHOUT\s+TIME\s+ZONE\b/i, { token: TokenClassConsts.TYPE }],
[/WITH\s+LOCAL\s+TIME\s+ZONE\b/i, { token: TokenClassConsts.TYPE }]
]
},
unicode: true
});
monaco?.languages?.registerCompletionItemProvider('flinksql', {
provideCompletionItems: function (model, position) {
const word = model.getWordUntilPosition(position);
const range = {
startLineNumber: position.lineNumber,
endLineNumber: position.lineNumber,
startColumn: word.startColumn,
endColumn: word.endColumn
};
return {
suggestions: FLINK_SQL_KEYWORD.map((item) => {
return {
label: item,
range: range,
kind: monaco.languages.CompletionItemKind.Keyword,
insertText: item
};
})
};
}
});
monaco?.languages?.setLanguageConfiguration('flinksql', {
comments: {
lineComment: '--',
blockComment: ['/*', '*/']
},
brackets: [
['{', '}'],
['[', ']'],
['(', ')']
],
autoClosingPairs: [
{ open: '{', close: '}' },
{ open: '[', close: ']' },
{ open: '(', close: ')' },
{ open: '"', close: '"' },
{ open: "'", close: "'" },
{ open: '`', close: '`' }
],
indentationRules: {
increaseIndentPattern: /^\s*(\w+\s+)+\w/,
decreaseIndentPattern: /^\s*(\w+\s+)+\w/
},
onEnterRules: [
{
beforeText: /^\s*(\/\*)/,
afterText: /^\s*\*\/$/,
action: { indentAction: monaco.languages.IndentAction.IndentOutdent, appendText: ' * ' }
}
],
surroundingPairs: [
{ open: '{', close: '}' },
{ open: '[', close: ']' },
{ open: '(', close: ')' },
{ open: '"', close: '"' },
{ open: "'", close: "'" },
{ open: '`', close: '`' }
],
colorizedBracketPairs: [
['{', '}'],
['[', ']'],
['(', ')']
],
folding: {
offSide: true,
markers: {
start:
/((create|alter|drop|rename\s+)?(TABLE|DATABASE|STREAM|FUNCTION|PROCEDURE|PACKAGE|TYPE|TRIGGER|INDEX|SCHEMA|VIEW)\b)|((EXECUTE\s+)?(JAR|CDCSOURCE)?\b)/i,
end: /\)\\;\b/i
}
}
});
}
/*
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { FlinkSQLLanguage } from '@/components/CustomEditor/languages/flinksql';
import { LogLanguage } from '@/components/CustomEditor/languages/javalog';
import { Monaco } from '@monaco-editor/react';
/**
* 加载自定义语言 关键字
* @param monaco
* @constructor
*/
// function LoadLanguagesKeyWord(monaco: Monaco | null) {
// if (!monaco) {
// return;
// }
// monaco?.languages?.getLanguages().forEach((language) => {
// return monaco?.languages?.registerCompletionItemProvider(language.id , {
// provideCompletionItems: function (model, position) {
// const word = model.getWordUntilPosition(position);
// const range = {
// startLineNumber: position.lineNumber,
// endLineNumber: position.lineNumber,
// startColumn: word.startColumn,
// endColumn: word.endColumn
// };
// return {
// suggestions: FLINK_SQL_KEYWORD.map((item) => {
// return {
// label: item,
// range: range,
// kind: monaco.languages.CompletionItemKind.Keyword,
// insertText: item
// };
// })
// };
// }
// });
// })
// }
export function LoadCustomEditorLanguage(monaco: Monaco | null) {
// LoadLanguagesKeyWord(monaco);
LogLanguage(monaco);
FlinkSQLLanguage(monaco);
}
// todo 自定义语言不生效 /*
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
export function LogLanguage(monaco: any) { export function LogLanguage(monaco: any) {
// Register a new language // Register a new language
monaco?.languages.register({ monaco?.languages.register({
...@@ -7,7 +25,6 @@ export function LogLanguage(monaco: any) { ...@@ -7,7 +25,6 @@ export function LogLanguage(monaco: any) {
aliases: ['javalog', 'Javalog', 'Javalog', 'jl', 'log'] aliases: ['javalog', 'Javalog', 'Javalog', 'jl', 'log']
}); });
monaco?.languages.setMonarchTokensProvider('javalog', { monaco?.languages.setMonarchTokensProvider('javalog', {
// todo: 如果需要分段展示不同的颜色 则需要在这里添加规则, 且正则必须是严格模式, 否则会匹配一整行,无法达到预期效果
tokenizer: { tokenizer: {
root: [ root: [
// 默认不区分大小写 // // 默认不区分大小写 //
......
/* /*
* *
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with * (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
* *
*/ */
...@@ -81,6 +81,8 @@ export default class LineageDagExt extends LineageDag { ...@@ -81,6 +81,8 @@ export default class LineageDagExt extends LineageDag {
result.edges = result.edges.map((item) => { result.edges = result.edges.map((item) => {
return { return {
...item, ...item,
// 线条的类型: Bezier/Flow/Straight/Manhattan/AdvancedBezier/Bezier2-1/Bezier2-2/Bezier2-3/BrokenLine , 新版本可以指定 但是布局调整了
// https://github.com/zhu-mingye/butterfly/blob/master/docs/zh-CN/edge.md#shapetype--string----%E9%80%89%E5%A1%AB
shapeType: 'AdvancedBezier' shapeType: 'AdvancedBezier'
}; };
}); });
......
...@@ -608,3 +608,8 @@ h5 { ...@@ -608,3 +608,8 @@ h5 {
.card-list-item:hover { .card-list-item:hover {
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
} }
// 自定义语言会把 '' 中间的内容加粗 , 在这里重置 不加粗
span .mtkb {
font-weight: inherit;
}
...@@ -1052,7 +1052,8 @@ export default { ...@@ -1052,7 +1052,8 @@ export default {
'user.request.type': 'Type', 'user.request.type': 'Type',
'user.reset': 'Are you sure to Reset this User Password?', 'user.reset': 'Are you sure to Reset this User Password?',
'user.resetPassword': 'Reset your password', 'user.resetPassword': 'Reset your password',
'user.resetPasswordSuccess': 'User', 'user.resetPasswordSuccess':
'User [{username}] reset password successfully, new password: {password}',
'user.role': 'Role', 'user.role': 'Role',
'user.status': 'Is Deleted', 'user.status': 'Is Deleted',
'user.superAdminFlag': 'Super Admin', 'user.superAdminFlag': 'Super Admin',
......
...@@ -1010,7 +1010,7 @@ export default { ...@@ -1010,7 +1010,7 @@ export default {
'user.request.type': '请求类型', 'user.request.type': '请求类型',
'user.reset': '您确定要重置此用户密码吗?', 'user.reset': '您确定要重置此用户密码吗?',
'user.resetPassword': '重置密码', 'user.resetPassword': '重置密码',
'user.resetPasswordSuccess': '用户', 'user.resetPasswordSuccess': '用户 [{username}] 重置密码成功, 新密码: {password}',
'user.role': '角色', 'user.role': '角色',
'user.status': '是否删除', 'user.status': '是否删除',
'user.superAdminFlag': '超级管理员', 'user.superAdminFlag': '超级管理员',
......
...@@ -23,7 +23,7 @@ import { NORMAL_MODAL_OPTIONS } from '@/services/constants'; ...@@ -23,7 +23,7 @@ import { NORMAL_MODAL_OPTIONS } from '@/services/constants';
import { UserBaseInfo } from '@/types/AuthCenter/data'; import { UserBaseInfo } from '@/types/AuthCenter/data';
import { l } from '@/utils/intl'; import { l } from '@/utils/intl';
import { Form, Modal } from 'antd'; import { Form, Modal } from 'antd';
import React, { useEffect, useState } from 'react'; import React, { useEffect } from 'react';
type PasswordModalFormProps = { type PasswordModalFormProps = {
onCancel: (flag?: boolean) => void; onCancel: (flag?: boolean) => void;
...@@ -59,10 +59,6 @@ const PasswordModal: React.FC<PasswordModalFormProps> = (props) => { ...@@ -59,10 +59,6 @@ const PasswordModal: React.FC<PasswordModalFormProps> = (props) => {
form.setFieldsValue(values); form.setFieldsValue(values);
}, [modalVisible, values, form]); }, [modalVisible, values, form]);
const [formVals, setFormVals] = useState<Partial<UserBaseInfo.ChangePasswordParams>>({
...values
});
/** /**
* handle cancel * handle cancel
*/ */
...@@ -76,9 +72,8 @@ const PasswordModal: React.FC<PasswordModalFormProps> = (props) => { ...@@ -76,9 +72,8 @@ const PasswordModal: React.FC<PasswordModalFormProps> = (props) => {
*/ */
const submitForm = async () => { const submitForm = async () => {
const fieldsValue = await form.validateFields(); const fieldsValue = await form.validateFields();
setFormVals({ ...formVals, ...fieldsValue }); handleSubmit({ ...values, ...fieldsValue });
await handleSubmit({ ...formVals, ...fieldsValue }); handleCancel();
await handleCancel();
}; };
/** /**
...@@ -92,7 +87,7 @@ const PasswordModal: React.FC<PasswordModalFormProps> = (props) => { ...@@ -92,7 +87,7 @@ const PasswordModal: React.FC<PasswordModalFormProps> = (props) => {
onCancel={() => handleCancel()} onCancel={() => handleCancel()}
onOk={() => submitForm()} onOk={() => submitForm()}
> >
<PasswordForm values={values as any} form={form} /> <PasswordForm values={values as UserBaseInfo.User} form={form} />
</Modal> </Modal>
); );
}; };
......
...@@ -23,7 +23,7 @@ import { EditBtn } from '@/components/CallBackButton/EditBtn'; ...@@ -23,7 +23,7 @@ import { EditBtn } from '@/components/CallBackButton/EditBtn';
import { EnableSwitchBtn } from '@/components/CallBackButton/EnableSwitchBtn'; import { EnableSwitchBtn } from '@/components/CallBackButton/EnableSwitchBtn';
import { PopconfirmDeleteBtn } from '@/components/CallBackButton/PopconfirmDeleteBtn'; import { PopconfirmDeleteBtn } from '@/components/CallBackButton/PopconfirmDeleteBtn';
import { BackIcon } from '@/components/Icons/CustomIcons'; import { BackIcon } from '@/components/Icons/CustomIcons';
import { Authorized, useAccess } from '@/hooks/useAccess'; import { Authorized, HasAuthority, useAccess } from '@/hooks/useAccess';
import { UserType, USER_TYPE_ENUM } from '@/pages/AuthCenter/User/components/constants'; import { UserType, USER_TYPE_ENUM } from '@/pages/AuthCenter/User/components/constants';
import PasswordModal from '@/pages/AuthCenter/User/components/PasswordModal'; import PasswordModal from '@/pages/AuthCenter/User/components/PasswordModal';
import UserModalForm from '@/pages/AuthCenter/User/components/UserModalForm'; import UserModalForm from '@/pages/AuthCenter/User/components/UserModalForm';
...@@ -225,6 +225,7 @@ const UserProTable = () => { ...@@ -225,6 +225,7 @@ const UserProTable = () => {
<EnableSwitchBtn <EnableSwitchBtn
key={`${record.id}_enable`} key={`${record.id}_enable`}
record={record} record={record}
disabled={!HasAuthority('/auth/user/edit')}
onChange={() => handleChangeEnable(record)} onChange={() => handleChangeEnable(record)}
/> />
// </Authorized> // </Authorized>
......
...@@ -34,11 +34,12 @@ export type DiffModalProps = { ...@@ -34,11 +34,12 @@ export type DiffModalProps = {
diffs: any[]; diffs: any[];
open: boolean; open: boolean;
fileName?: string; fileName?: string;
language?: string;
onUse: (server: boolean) => void; onUse: (server: boolean) => void;
}; };
const DiffModal: React.FC<DiffModalProps> = (props) => { const DiffModal: React.FC<DiffModalProps> = (props) => {
const { diffs, open, fileName, onUse } = props; const { diffs, open, fileName, language = 'sql', onUse } = props;
// Find the diff object with key 'statement' // Find the diff object with key 'statement'
const statementDiff = diffs.find((diff) => diff.key === 'statement'); const statementDiff = diffs.find((diff) => diff.key === 'statement');
// Filter out the diff objects with key other than 'statement' // Filter out the diff objects with key other than 'statement'
...@@ -60,6 +61,7 @@ const DiffModal: React.FC<DiffModalProps> = (props) => { ...@@ -60,6 +61,7 @@ const DiffModal: React.FC<DiffModalProps> = (props) => {
</Row> </Row>
<DiffEditor <DiffEditor
{...DIFF_EDITOR_PARAMS} {...DIFF_EDITOR_PARAMS}
language={language}
original={statementDiff?.server} original={statementDiff?.server}
modified={statementDiff?.cache} modified={statementDiff?.cache}
theme={convertCodeEditTheme()} theme={convertCodeEditTheme()}
......
...@@ -30,6 +30,7 @@ import { ...@@ -30,6 +30,7 @@ import {
TaskDataType TaskDataType
} from '@/pages/DataStudio/model'; } from '@/pages/DataStudio/model';
import { JOB_LIFE_CYCLE } from '@/pages/DevOps/constants'; import { JOB_LIFE_CYCLE } from '@/pages/DevOps/constants';
import { DIALECT } from '@/services/constants';
import { API_CONSTANTS } from '@/services/endpoints'; import { API_CONSTANTS } from '@/services/endpoints';
import { l } from '@/utils/intl'; import { l } from '@/utils/intl';
import { connect, useRequest } from '@@/exports'; import { connect, useRequest } from '@@/exports';
...@@ -147,6 +148,11 @@ const CodeEditor: React.FC<EditorProps & any> = (props) => { ...@@ -147,6 +148,11 @@ const CodeEditor: React.FC<EditorProps & any> = (props) => {
<DiffModal <DiffModal
diffs={diff} diffs={diff}
open={isModalOpen} open={isModalOpen}
language={
currentTab?.params?.taskData?.dialect?.toLowerCase() === DIALECT.FLINK_SQL
? 'flinksql'
: 'sql'
}
fileName={currentData?.name} fileName={currentData?.name}
onUse={upDateTask} onUse={upDateTask}
/> />
...@@ -154,7 +160,12 @@ const CodeEditor: React.FC<EditorProps & any> = (props) => { ...@@ -154,7 +160,12 @@ const CodeEditor: React.FC<EditorProps & any> = (props) => {
monacoRef={monacoInstance} monacoRef={monacoInstance}
editorRef={editorInstance} editorRef={editorInstance}
code={currentTab?.params?.taskData?.statement} code={currentTab?.params?.taskData?.statement}
language={'sql'} language={
currentTab?.params?.taskData?.dialect?.toLowerCase() === DIALECT.FLINK_SQL
? 'flinksql'
: 'sql'
}
// language={'sql'}
editorDidMount={editorDidMount} editorDidMount={editorDidMount}
onChange={handleEditChange} onChange={handleEditChange}
enableSuggestions={true} enableSuggestions={true}
......
...@@ -109,7 +109,7 @@ const MiddleContainer = (props: any) => { ...@@ -109,7 +109,7 @@ const MiddleContainer = (props: any) => {
}; };
const updateActiveKey = (item: TabsItemType) => { const updateActiveKey = (item: TabsItemType) => {
const { key, value, treeKey } = item; const { key, label } = item;
if (key === activeKey) { if (key === activeKey) {
return; return;
} }
...@@ -133,7 +133,7 @@ const MiddleContainer = (props: any) => { ...@@ -133,7 +133,7 @@ const MiddleContainer = (props: any) => {
if (item.type === TabsPageType.metadata) { if (item.type === TabsPageType.metadata) {
// 替换掉 . 为 /, 因为再 tree 里选中的 key 是 / 分割的 // 替换掉 . 为 /, 因为再 tree 里选中的 key 是 / 分割的
const name = value.toString().replace('.', '/'); const name = label.replace('.', '/');
dispatch({ dispatch({
type: STUDIO_MODEL.updateDatabaseSelectKey, type: STUDIO_MODEL.updateDatabaseSelectKey,
payload: [name] payload: [name]
......
/* /*
* *
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with * (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
* *
*/ */
import { TagAlignLeft } from '@/components/StyledComponents'; import { TagAlignLeft } from '@/components/StyledComponents';
import { getAlertIcon } from '@/pages/RegCenter/Alert/AlertInstance/function';
import { RUN_MODE } from '@/services/constants'; import { RUN_MODE } from '@/services/constants';
import { Alert, Cluster } from '@/types/RegCenter/data'; import { Alert, ALERT_TYPE, Cluster } from '@/types/RegCenter/data.d';
import { l } from '@/utils/intl'; import { l } from '@/utils/intl';
import { PaperClipOutlined } from '@ant-design/icons'; import { PaperClipOutlined } from '@ant-design/icons';
import { Badge, Tag } from 'antd'; import { Badge, Tag } from 'antd';
...@@ -150,13 +151,24 @@ export const buildEnvOptions = (env: any[]) => { ...@@ -150,13 +151,24 @@ export const buildEnvOptions = (env: any[]) => {
export const buildAlertGroupOptions = (alertGroups: Alert.AlertGroup[]) => { export const buildAlertGroupOptions = (alertGroups: Alert.AlertGroup[]) => {
const alertGroupOptions: DefaultOptionType[] = [ const alertGroupOptions: DefaultOptionType[] = [
{ {
label: l('button.disable'), label: (
value: -1 <TagAlignLeft>
{getAlertIcon(ALERT_TYPE.GROUP, 20)}
{l('button.disable')}
</TagAlignLeft>
),
value: -1,
key: -1
} }
]; ];
for (const item of alertGroups) { for (const item of alertGroups) {
alertGroupOptions.push({ alertGroupOptions.push({
label: item.name, label: (
<TagAlignLeft>
{getAlertIcon(ALERT_TYPE.GROUP, 20)}
{item.name}
</TagAlignLeft>
),
value: item.id, value: item.id,
key: item.id key: item.id
}); });
......
...@@ -23,7 +23,7 @@ import { ...@@ -23,7 +23,7 @@ import {
getCurrentTab, getCurrentTab,
isDataStudioTabsItemType isDataStudioTabsItemType
} from '@/pages/DataStudio/function'; } from '@/pages/DataStudio/function';
import { SessionType, StateType, STUDIO_MODEL } from '@/pages/DataStudio/model'; import { SessionType, StateType, STUDIO_MODEL, STUDIO_MODEL_ASYNC } from '@/pages/DataStudio/model';
import { import {
buildAlertGroupOptions, buildAlertGroupOptions,
buildClusterConfigOptions, buildClusterConfigOptions,
...@@ -32,7 +32,7 @@ import { ...@@ -32,7 +32,7 @@ import {
buildRunModelOptions, buildRunModelOptions,
calculatorWidth calculatorWidth
} from '@/pages/DataStudio/RightContainer/JobConfig/function'; } from '@/pages/DataStudio/RightContainer/JobConfig/function';
import { AlertStateType } from '@/pages/RegCenter/Alert/AlertInstance/model'; import { AlertStateType, ALERT_MODEL_ASYNC } from '@/pages/RegCenter/Alert/AlertInstance/model';
import { RUN_MODE, SWITCH_OPTIONS } from '@/services/constants'; import { RUN_MODE, SWITCH_OPTIONS } from '@/services/constants';
import { l } from '@/utils/intl'; import { l } from '@/utils/intl';
import { InfoCircleOutlined } from '@ant-design/icons'; import { InfoCircleOutlined } from '@ant-design/icons';
...@@ -78,7 +78,10 @@ const JobConfig = (props: any) => { ...@@ -78,7 +78,10 @@ const JobConfig = (props: any) => {
useEffect(() => { useEffect(() => {
dispatch({ dispatch({
type: 'Studio/queryFlinkConfigOptions' type: STUDIO_MODEL_ASYNC.queryFlinkConfigOptions
});
dispatch({
type: ALERT_MODEL_ASYNC.queryAlertGroup
}); });
form.setFieldsValue(current); form.setFieldsValue(current);
}, [current]); }, [current]);
......
/* /*
* *
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with * (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
* *
*/ */
...@@ -26,7 +26,7 @@ import { RocketOutlined } from '@ant-design/icons'; ...@@ -26,7 +26,7 @@ import { RocketOutlined } from '@ant-design/icons';
import { ProCard } from '@ant-design/pro-components'; import { ProCard } from '@ant-design/pro-components';
import { Descriptions, Tag, Typography } from 'antd'; import { Descriptions, Tag, Typography } from 'antd';
const { Text, Paragraph } = Typography; const { Text } = Typography;
/** /**
* Renders the JobConfigTab component. * Renders the JobConfigTab component.
...@@ -64,13 +64,13 @@ const JobDesc = (props: JobProps) => { ...@@ -64,13 +64,13 @@ const JobDesc = (props: JobProps) => {
* @param {object} config - The user configuration object. * @param {object} config - The user configuration object.
* @returns {JSX.Element[]} - An array of Descriptions.Item components representing the user configuration. * @returns {JSX.Element[]} - An array of Descriptions.Item components representing the user configuration.
*/ */
const getUserConfig = (config: any) => { // const getUserConfig = (config: any) => {
let formList = []; // let formList = [];
for (let configKey in config) { // for (let configKey in config) {
formList.push(<Descriptions.Item label={configKey}>{config[configKey]}</Descriptions.Item>); // formList.push(<Descriptions.Item label={configKey}>{config[configKey]}</Descriptions.Item>);
} // }
return formList; // return formList;
}; // };
return ( return (
<> <>
...@@ -93,7 +93,7 @@ const JobDesc = (props: JobProps) => { ...@@ -93,7 +93,7 @@ const JobDesc = (props: JobProps) => {
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item label={l('devops.jobinfo.config.ClusterInstanceName')}> <Descriptions.Item label={l('devops.jobinfo.config.ClusterInstanceName')}>
<Link to={'/registration/cluster/instance'}>{jobDetail?.cluster?.alias}</Link> <Link to={'/registration/cluster/instance'}>{jobDetail?.clusterInstance?.alias}</Link>
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item label={l('devops.jobinfo.config.JobId')}> <Descriptions.Item label={l('devops.jobinfo.config.JobId')}>
...@@ -120,10 +120,6 @@ const JobDesc = (props: JobProps) => { ...@@ -120,10 +120,6 @@ const JobDesc = (props: JobProps) => {
{jobDetail?.history?.config?.useSqlFragment ? l('button.enable') : l('button.disable')} {jobDetail?.history?.config?.useSqlFragment ? l('button.enable') : l('button.disable')}
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item label={l('devops.jobinfo.config.JobType')}>
{jobDetail?.history?.config?.isJarTask ? 'Jar' : 'FlinkSQL'}
</Descriptions.Item>
<Descriptions.Item label={l('devops.jobinfo.config.execmode')}> <Descriptions.Item label={l('devops.jobinfo.config.execmode')}>
{jobDetail?.history?.config?.useBatchModel {jobDetail?.history?.config?.useBatchModel
? l('global.table.execmode.batch') ? l('global.table.execmode.batch')
......
...@@ -21,6 +21,7 @@ import CodeShow from '@/components/CustomEditor/CodeShow'; ...@@ -21,6 +21,7 @@ import CodeShow from '@/components/CustomEditor/CodeShow';
import VersionList from '@/components/VersionList'; import VersionList from '@/components/VersionList';
import { JobProps } from '@/pages/DevOps/JobDetail/data'; import { JobProps } from '@/pages/DevOps/JobDetail/data';
import { handleRemoveById } from '@/services/BusinessCrud'; import { handleRemoveById } from '@/services/BusinessCrud';
import { DIALECT } from '@/services/constants';
import { API_CONSTANTS } from '@/services/endpoints'; import { API_CONSTANTS } from '@/services/endpoints';
import { TaskVersionListItem } from '@/types/Studio/data'; import { TaskVersionListItem } from '@/types/Studio/data';
import { l } from '@/utils/intl'; import { l } from '@/utils/intl';
...@@ -85,7 +86,13 @@ const JobVersionTab = (props: JobProps) => { ...@@ -85,7 +86,13 @@ const JobVersionTab = (props: JobProps) => {
</> </>
} }
> >
<CodeShow code={currentVersion?.statement ?? ''} height={500} language={'sql'} /> <CodeShow
code={currentVersion?.statement ?? ''}
height={500}
language={
currentVersion?.dialect?.toLowerCase() === DIALECT.FLINK_SQL ? 'flinksql' : 'sql'
}
/>
</Card> </Card>
</Col> </Col>
</Row> </Row>
......
...@@ -67,7 +67,8 @@ const JobHistoryList = (props: HistoryProps) => { ...@@ -67,7 +67,8 @@ const JobHistoryList = (props: HistoryProps) => {
render: (text: any, record: Jobs.JobInstance) => [ render: (text: any, record: Jobs.JobInstance) => [
<a <a
key={'history-detail'} key={'history-detail'}
onClick={() => history.push(`/devops/job-detail?id=${record.id}`)}> onClick={() => history.push(`/devops/job-detail?id=${record.id}`)}
>
{l('devops.joblist.detail')} {l('devops.joblist.detail')}
</a> </a>
] ]
......
...@@ -17,7 +17,11 @@ ...@@ -17,7 +17,11 @@
* *
*/ */
import { buildFormData, getFormData } from '@/pages/RegCenter/Alert/AlertGroup/function'; import {
buildAlertInstanceSelect,
buildFormData,
getFormData
} from '@/pages/RegCenter/Alert/AlertGroup/function';
import { AlertStateType } from '@/pages/RegCenter/Alert/AlertInstance/model'; import { AlertStateType } from '@/pages/RegCenter/Alert/AlertInstance/model';
import { MODAL_FORM_STYLE, SWITCH_OPTIONS } from '@/services/constants'; import { MODAL_FORM_STYLE, SWITCH_OPTIONS } from '@/services/constants';
import { Alert } from '@/types/RegCenter/data'; import { Alert } from '@/types/RegCenter/data';
...@@ -30,7 +34,7 @@ import { ...@@ -30,7 +34,7 @@ import {
ProFormTextArea ProFormTextArea
} from '@ant-design/pro-components'; } from '@ant-design/pro-components';
import { connect } from '@umijs/max'; import { connect } from '@umijs/max';
import { Button, Form, Tag } from 'antd'; import { Button, Form } from 'antd';
import React, { useState } from 'react'; import React, { useState } from 'react';
/** /**
...@@ -41,10 +45,9 @@ type AlertGroupFormProps = { ...@@ -41,10 +45,9 @@ type AlertGroupFormProps = {
onSubmit: (values: Partial<Alert.AlertGroup>) => void; onSubmit: (values: Partial<Alert.AlertGroup>) => void;
modalVisible: boolean; modalVisible: boolean;
values: Partial<Alert.AlertGroup>; values: Partial<Alert.AlertGroup>;
instance: Alert.AlertInstance[];
}; };
const AlertGroupForm: React.FC<AlertGroupFormProps> = (props) => { const AlertGroupForm: React.FC<AlertGroupFormProps & connect> = (props) => {
/** /**
* extract props * extract props
*/ */
...@@ -52,7 +55,7 @@ const AlertGroupForm: React.FC<AlertGroupFormProps> = (props) => { ...@@ -52,7 +55,7 @@ const AlertGroupForm: React.FC<AlertGroupFormProps> = (props) => {
onSubmit: handleSubmit, onSubmit: handleSubmit,
onCancel: handleModalVisible, onCancel: handleModalVisible,
modalVisible, modalVisible,
instance, alertInstance,
values values
} = props; } = props;
/** /**
...@@ -61,26 +64,6 @@ const AlertGroupForm: React.FC<AlertGroupFormProps> = (props) => { ...@@ -61,26 +64,6 @@ const AlertGroupForm: React.FC<AlertGroupFormProps> = (props) => {
const [form] = Form.useForm(); const [form] = Form.useForm();
const [formVals, setFormVals] = useState<Partial<Alert.AlertGroup>>({ ...values }); const [formVals, setFormVals] = useState<Partial<Alert.AlertGroup>>({ ...values });
/**
* build alert instance select options
*/
const buildAlertInstanceSelect = () => {
const itemList = [];
for (const item of instance) {
const tag = (
<>
<Tag color='processing'>{item.type}</Tag>
{item.name}
</>
);
itemList.push({
label: tag,
value: item.id.toString()
});
}
return itemList;
};
/** /**
* submit form * submit form
*/ */
...@@ -108,7 +91,7 @@ const AlertGroupForm: React.FC<AlertGroupFormProps> = (props) => { ...@@ -108,7 +91,7 @@ const AlertGroupForm: React.FC<AlertGroupFormProps> = (props) => {
label={l('rc.ag.alertInstanceIds')} label={l('rc.ag.alertInstanceIds')}
rules={[{ required: true, message: l('rc.ag.chooseAlertInstanceIds') }]} rules={[{ required: true, message: l('rc.ag.chooseAlertInstanceIds') }]}
mode='multiple' mode='multiple'
options={buildAlertInstanceSelect()} options={buildAlertInstanceSelect(alertInstance ?? [])}
/> />
<ProFormTextArea <ProFormTextArea
...@@ -158,5 +141,5 @@ const AlertGroupForm: React.FC<AlertGroupFormProps> = (props) => { ...@@ -158,5 +141,5 @@ const AlertGroupForm: React.FC<AlertGroupFormProps> = (props) => {
}; };
export default connect(({ Alert }: { Alert: AlertStateType }) => ({ export default connect(({ Alert }: { Alert: AlertStateType }) => ({
instance: Alert.instance alertInstance: Alert.instance
}))(AlertGroupForm); }))(AlertGroupForm);
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
* *
*/ */
import { Alert } from '@/types/RegCenter/data'; import { Alert } from '@/types/RegCenter/data.d';
import { Tag } from 'antd';
/** /**
* parse alertInstanceIds to array and rebuild form data * parse alertInstanceIds to array and rebuild form data
...@@ -44,3 +45,19 @@ export const buildFormData = (values: Partial<Alert.AlertGroup>, params: any) => ...@@ -44,3 +45,19 @@ export const buildFormData = (values: Partial<Alert.AlertGroup>, params: any) =>
} }
return { ...newValue, ...params }; return { ...newValue, ...params };
}; };
export const buildAlertInstanceSelect = (alertInstance: Alert.AlertInstance[]) => {
return alertInstance.map((item) => {
const tag = (
<>
{' '}
<Tag color='processing'>{item.type}</Tag>
{item.name}
</>
);
return {
label: tag,
value: item.id.toString()
};
});
};
...@@ -79,7 +79,7 @@ const AlertGroupTableList: React.FC = (props: any) => { ...@@ -79,7 +79,7 @@ const AlertGroupTableList: React.FC = (props: any) => {
* execute and refresh loading * execute and refresh loading
* @param callback * @param callback
*/ */
const exexuteWithRefreshLoading = async (callback: any) => { const executeWithRefreshLoading = async (callback: any) => {
setAlertGroupState((prevState) => ({ ...prevState, loading: true })); setAlertGroupState((prevState) => ({ ...prevState, loading: true }));
await callback(); await callback();
await queryAlertGroupList(); await queryAlertGroupList();
...@@ -97,7 +97,7 @@ const AlertGroupTableList: React.FC = (props: any) => { ...@@ -97,7 +97,7 @@ const AlertGroupTableList: React.FC = (props: any) => {
okText: l('button.confirm'), okText: l('button.confirm'),
cancelText: l('button.cancel'), cancelText: l('button.cancel'),
onOk: async () => onOk: async () =>
exexuteWithRefreshLoading(async () => executeWithRefreshLoading(async () =>
handleRemoveById(API_CONSTANTS.ALERT_GROUP_DELETE, id) handleRemoveById(API_CONSTANTS.ALERT_GROUP_DELETE, id)
) )
}); });
...@@ -108,7 +108,7 @@ const AlertGroupTableList: React.FC = (props: any) => { ...@@ -108,7 +108,7 @@ const AlertGroupTableList: React.FC = (props: any) => {
* @param item * @param item
*/ */
const handleEnable = async (item: Alert.AlertGroup) => { const handleEnable = async (item: Alert.AlertGroup) => {
await exexuteWithRefreshLoading(async () => await executeWithRefreshLoading(async () =>
updateDataByParam(API_CONSTANTS.ALERT_GROUP_ENABLE, { id: item.id }) updateDataByParam(API_CONSTANTS.ALERT_GROUP_ENABLE, { id: item.id })
); );
}; };
...@@ -129,7 +129,7 @@ const AlertGroupTableList: React.FC = (props: any) => { ...@@ -129,7 +129,7 @@ const AlertGroupTableList: React.FC = (props: any) => {
* handle add alert instance * handle add alert instance
*/ */
const handleSubmit = async (value: Alert.AlertGroup) => { const handleSubmit = async (value: Alert.AlertGroup) => {
await exexuteWithRefreshLoading(async () => await executeWithRefreshLoading(async () =>
handleAddOrUpdate( handleAddOrUpdate(
API_CONSTANTS.ALERT_GROUP_ADD_OR_UPDATE, API_CONSTANTS.ALERT_GROUP_ADD_OR_UPDATE,
value, value,
......
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
/*--- get alert instance ---*/ import { queryDataByParams } from '@/services/BusinessCrud';
import { getData } from '@/services/api';
import { API_CONSTANTS } from '@/services/endpoints'; import { API_CONSTANTS } from '@/services/endpoints';
export function showAlertInstance() { export function showAlertInstance() {
return getData(API_CONSTANTS.ALERT_INSTANCE_LIST_ENABLE_ALL); return queryDataByParams(API_CONSTANTS.ALERT_INSTANCE_LIST_ENABLE_ALL) ?? [];
}
export function showAlertGroup() {
return queryDataByParams(API_CONSTANTS.ALERT_GROUP_LIST_ENABLE_ALL) ?? [];
} }
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* *
*/ */
import { showAlertInstance } from '@/pages/RegCenter/Alert/AlertGroup/service'; import { showAlertGroup, showAlertInstance } from '@/pages/RegCenter/Alert/AlertGroup/service';
import { Alert } from '@/types/RegCenter/data.d'; import { Alert } from '@/types/RegCenter/data.d';
import { Reducer } from 'umi'; import { Reducer } from 'umi';
...@@ -34,6 +34,7 @@ export type AlertModelType = { ...@@ -34,6 +34,7 @@ export type AlertModelType = {
state: AlertStateType; state: AlertStateType;
effects: { effects: {
queryInstance: Effect; queryInstance: Effect;
queryAlertGroup: Effect;
}; };
reducers: { reducers: {
saveInstance: Reducer<AlertStateType>; saveInstance: Reducer<AlertStateType>;
...@@ -50,8 +51,12 @@ const AlertModel: AlertModelType = { ...@@ -50,8 +51,12 @@ const AlertModel: AlertModelType = {
effects: { effects: {
*queryInstance({}, { call, put }) { *queryInstance({}, { call, put }) {
const { data } = yield call(showAlertInstance); const data: Alert.AlertInstance[] = yield call(showAlertInstance);
yield put({ type: 'saveInstance', payload: data }); yield put({ type: 'saveInstance', payload: data });
},
*queryAlertGroup({}, { call, put }) {
const data: Alert.AlertGroup[] = yield call(showAlertGroup);
yield put({ type: 'saveGroup', payload: data });
} }
}, },
......
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
import CodeShow from '@/components/CustomEditor/CodeShow'; import CodeShow from '@/components/CustomEditor/CodeShow';
...@@ -21,6 +23,7 @@ import { queryDataByParams } from '@/services/BusinessCrud'; ...@@ -21,6 +23,7 @@ import { queryDataByParams } from '@/services/BusinessCrud';
import { API_CONSTANTS } from '@/services/endpoints'; import { API_CONSTANTS } from '@/services/endpoints';
import { DataSources } from '@/types/RegCenter/data'; import { DataSources } from '@/types/RegCenter/data';
import { l } from '@/utils/intl'; import { l } from '@/utils/intl';
import { ProCardTabsProps } from '@ant-design/pro-card/es/typing';
import { ProCard } from '@ant-design/pro-components'; import { ProCard } from '@ant-design/pro-components';
import { Empty, Typography } from 'antd'; import { Empty, Typography } from 'antd';
import React, { useCallback, useEffect, useState } from 'react'; import React, { useCallback, useEffect, useState } from 'react';
...@@ -53,7 +56,7 @@ const GenSQL: React.FC<GenSQLProps> = (props) => { ...@@ -53,7 +56,7 @@ const GenSQL: React.FC<GenSQLProps> = (props) => {
const genSQLData = await queryDataByParams(API_CONSTANTS.DATASOURCE_GET_GEN_SQL, { const genSQLData = await queryDataByParams(API_CONSTANTS.DATASOURCE_GET_GEN_SQL, {
...queryParams ...queryParams
}); });
setGenSQL(genSQLData); setGenSQL(genSQLData as DataSources.SqlGeneration);
}, [queryParams]); }, [queryParams]);
/** /**
...@@ -70,7 +73,7 @@ const GenSQL: React.FC<GenSQLProps> = (props) => { ...@@ -70,7 +73,7 @@ const GenSQL: React.FC<GenSQLProps> = (props) => {
* @param code * @param code
*/ */
const renderContent = (code = '') => { const renderContent = (code = '') => {
return <CodeShow {...CodeShowProps} code={tagDisabled ? '' : code} />; return <CodeShow {...CodeShowProps} language={'flinksql'} code={tagDisabled ? '' : code} />;
}; };
/** /**
...@@ -108,7 +111,7 @@ const GenSQL: React.FC<GenSQLProps> = (props) => { ...@@ -108,7 +111,7 @@ const GenSQL: React.FC<GenSQLProps> = (props) => {
]; ];
// tab props // tab props
const restTabProps = { const restTabProps: ProCardTabsProps = {
activeKey, activeKey,
onChange: (key: string) => setActiveKey(key), onChange: (key: string) => setActiveKey(key),
tabPosition: 'left', tabPosition: 'left',
......
/* /*
* *
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with * (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
* *
*/ */
import CodeEdit from '@/components/CustomEditor/CodeEdit'; import CodeShow from '@/components/CustomEditor/CodeShow';
import { renderLanguage, unSupportView } from '@/utils/function'; import { renderLanguage, unSupportView } from '@/utils/function';
import { l } from '@/utils/intl'; import { l } from '@/utils/intl';
import { Empty, Space, Typography } from 'antd'; import { Empty, Space, Typography } from 'antd';
...@@ -103,7 +103,7 @@ const FileShow: React.FC<FileShowProps> = (props) => { ...@@ -103,7 +103,7 @@ const FileShow: React.FC<FileShowProps> = (props) => {
</> </>
); );
} else { } else {
return <CodeEdit {...restCodeShowProps} {...CodeEditProps} />; return <CodeShow {...restCodeShowProps} {...CodeEditProps} />;
} }
}; };
......
...@@ -147,7 +147,7 @@ export enum API_CONSTANTS { ...@@ -147,7 +147,7 @@ export enum API_CONSTANTS {
// ---- alert instance ---- // ---- alert instance ----
// alert instance list // alert instance list
ALERT_INSTANCE = '/api/alertInstance/list', ALERT_INSTANCE = '/api/alertInstance/list',
ALERT_INSTANCE_ADD_OR_UPDATE = '/api/alertInstance/addOrUpdate', ALERT_INSTANCE_ADD_OR_UPDATE = '/api/alertInstance/saveOrUpdate',
// delete alert instance by id // delete alert instance by id
ALERT_INSTANCE_DELETE = '/api/alertInstance/delete', ALERT_INSTANCE_DELETE = '/api/alertInstance/delete',
// alert instance enable or disable // alert instance enable or disable
...@@ -159,6 +159,7 @@ export enum API_CONSTANTS { ...@@ -159,6 +159,7 @@ export enum API_CONSTANTS {
// ---- alert group ---- // ---- alert group ----
ALERT_GROUP = '/api/alertGroup/list', ALERT_GROUP = '/api/alertGroup/list',
ALERT_GROUP_LIST_ENABLE_ALL = '/api/alertGroup/listEnabledAll',
ALERT_GROUP_ADD_OR_UPDATE = '/api/alertGroup/addOrUpdate', ALERT_GROUP_ADD_OR_UPDATE = '/api/alertGroup/addOrUpdate',
// delete alert group by id // delete alert group by id
ALERT_GROUP_DELETE = '/api/alertGroup/delete', ALERT_GROUP_DELETE = '/api/alertGroup/delete',
......
/* /*
* *
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with * (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
* *
*/ */
...@@ -45,7 +45,6 @@ declare namespace Jobs { ...@@ -45,7 +45,6 @@ declare namespace Jobs {
savePointStrategy: string; savePointStrategy: string;
savePointPath: string; savePointPath: string;
useSqlFragment: string; useSqlFragment: string;
isJarTask: string;
useBatchModel: string; useBatchModel: string;
}; };
......
...@@ -141,7 +141,7 @@ export function convertCodeEditTheme(editorInstance?: any) { ...@@ -141,7 +141,7 @@ export function convertCodeEditTheme(editorInstance?: any) {
rules: [ rules: [
// 注意,默认的不做修改 因为上边继承了父主题, 只添加自己定义的 , 否则会覆盖默认的 , 导致编辑器样式不一致 // 注意,默认的不做修改 因为上边继承了父主题, 只添加自己定义的 , 否则会覆盖默认的 , 导致编辑器样式不一致
{ token: 'custom-info', foreground: '#808080' }, { token: 'custom-info', foreground: '#808080' },
{ token: 'custom-thread', foreground: '#07f313' }, { token: 'custom-thread', foreground: '#9fa19f' },
{ token: 'custom-class', foreground: '#1060d9' }, { token: 'custom-class', foreground: '#1060d9' },
{ token: 'custom-error', foreground: '#ff0000', fontStyle: 'bold' }, { token: 'custom-error', foreground: '#ff0000', fontStyle: 'bold' },
{ token: 'custom-warning', foreground: '#FFA500', fontStyle: 'bold' }, { token: 'custom-warning', foreground: '#FFA500', fontStyle: 'bold' },
...@@ -161,7 +161,7 @@ export function convertCodeEditTheme(editorInstance?: any) { ...@@ -161,7 +161,7 @@ export function convertCodeEditTheme(editorInstance?: any) {
rules: [ rules: [
// 注意,默认的不做修改 因为上边继承了父主题, 只添加自己定义的 , 否则会覆盖默认的 , 导致编辑器样式不一致 // 注意,默认的不做修改 因为上边继承了父主题, 只添加自己定义的 , 否则会覆盖默认的 , 导致编辑器样式不一致
{ token: 'custom-info', foreground: '#008800' }, { token: 'custom-info', foreground: '#008800' },
{ token: 'custom-thread', foreground: '#07f313' }, { token: 'custom-thread', foreground: '#9fa19f' },
{ token: 'custom-class', foreground: '#1060d9' }, { token: 'custom-class', foreground: '#1060d9' },
{ token: 'custom-error', foreground: '#ff0000', fontStyle: 'bold' }, { token: 'custom-error', foreground: '#ff0000', fontStyle: 'bold' },
{ token: 'custom-warning', foreground: '#FFA500', fontStyle: 'bold' }, { token: 'custom-warning', foreground: '#FFA500', fontStyle: 'bold' },
......
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