Skip to content

Commit 2a380c9

Browse files
committed
add JDBC Node
1 parent 390ae7c commit 2a380c9

File tree

9 files changed

+77
-5
lines changed

9 files changed

+77
-5
lines changed

web/src/js/module/process/component/nodeparameter.vue

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,18 @@ export default {
298298
}
299299
};
300300
return {
301+
'jdbcUrl': [
302+
{ required: true, message: 'joburl为必填项', trigger: 'blur' },
303+
{ type: 'string', pattern: /(jdbc)[a-zA-Z0-9_:./]/, message: '必须以jdbc开头,且只支持数字、字母、(_:./)', trigger: 'blur' },
304+
],
305+
'jdbcUsername': [
306+
{ required: true, message: 'username为必填项', trigger: 'blur' },
307+
{ type: 'string', pattern: /^[^\u4e00-\u9fa5]+$/, message: '此值不支持中文', trigger: 'blur' },
308+
],
309+
'jdbcPassword': [
310+
{ required: true, message: 'password为必填项', trigger: 'blur' },
311+
{ type: 'string', pattern: /^[^\u4e00-\u9fa5]+$/, message: '此值不支持中文', trigger: 'blur' },
312+
],
301313
'sourceType': [
302314
{ required: true, message: this.$t('message.process.nodeParameter.XZSJLY'), trigger: 'blur' },
303315
{ type: 'string', pattern: /^[^\u4e00-\u9fa5]+$/, message: this.$t('message.process.nodeParameter.CZBNSRZW'), trigger: 'change' },
@@ -612,7 +624,7 @@ export default {
612624
if (this.currentNode.jobContent && this.currentNode.jobContent.jobParams) {
613625
this.currentNode.params.configuration.runtime = JSON.parse(JSON.stringify(this.currentNode.jobContent.jobParams));
614626
}
615-
if ([NODETYPE.EVENTCHECKERF, NODETYPE.EVENTCHECKERW, NODETYPE.DATACHECKER].includes(this.currentNode.type)) {
627+
if ([NODETYPE.EVENTCHECKERF, NODETYPE.EVENTCHECKERW, NODETYPE.DATACHECKER, NODETYPE.JDBC].includes(this.currentNode.type)) {
616628
Object.keys(this.currentNode.params.configuration.runtime).map((key) => {
617629
this.currentNode.params.configuration.runtime[this.transtionKey(key)] = String(this.currentNode.params.configuration.runtime[key]);
618630
delete this.currentNode.params.configuration.runtime[key];
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

web/src/js/module/process/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ export default {
208208
}
209209
}
210210
}
211-
if ([NODETYPE.SPARKSQL, NODETYPE.HQL, NODETYPE.SPARKPY, NODETYPE.SHELL, NODETYPE.SCALA, NODETYPE.PYTHON].indexOf(node.type) !== -1) {
211+
if ([NODETYPE.SPARKSQL, NODETYPE.HQL, NODETYPE.SPARKPY, NODETYPE.SHELL, NODETYPE.SCALA, NODETYPE.PYTHON, NODETYPE.JDBC].indexOf(node.type) !== -1) {
212212
const len = node.resources ? node.resources.length : 0;
213213
if (len && node.jobContent && node.jobContent.script) { // 判断是否有保存过脚本
214214
const resourceId = node.resources[0].resourceId;

web/src/js/module/process/module.vue

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ export default {
596596
}
597597
if (!this.workflowIsExecutor) {
598598
if (type === 'node') {
599-
if ([NODETYPE.SPARKSQL, NODETYPE.HQL, NODETYPE.SPARKPY, NODETYPE.SCALA].includes(node.type)) {
599+
if ([NODETYPE.SPARKSQL, NODETYPE.HQL, NODETYPE.SPARKPY, NODETYPE.SCALA, NODETYPE.JDBC].includes(node.type)) {
600600
arr.push({
601601
text: this.$t('message.process.associate'),
602602
value: 'associate',
@@ -908,6 +908,22 @@ export default {
908908
'executeUser': ''
909909
},
910910
});
911+
} else if (this.clickCurrentNode.type === NODETYPE.JDBC) {
912+
if (this.clickCurrentNode.jobContent) {
913+
this.$set(this.clickCurrentNode.jobContent, 'jobParams', {
914+
'jdbcUrl': '',
915+
'jdbcUsername': '',
916+
'jdbcPassword': ''
917+
});
918+
} else {
919+
this.$set(this.clickCurrentNode, 'jobContent', {
920+
jobParams: {
921+
'jdbcUrl': '',
922+
'jdbcUsername': '',
923+
'jdbcPassword': ''
924+
},
925+
});
926+
}
911927
}
912928
}
913929
// 节点参数位置发生改变,先定义一个新的configuration用来存储数据,后面把jobparams干掉

web/src/js/module/process/shape.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ export default [
7373
image: NODEICON[NODETYPE.PYTHON].icon,
7474
editParam: false,
7575
editBaseInfo: false,
76+
},
77+
{
78+
type: NODETYPE.JDBC,
79+
title: 'jdbc',
80+
image: NODEICON[NODETYPE.JDBC].icon,
81+
editParam: false,
82+
editBaseInfo: false,
7683
}],
7784
},
7885
{

web/src/js/module/setting/setting.vue

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ export default {
8080
}, {
8181
name: 'IDE-pipeline',
8282
title: 'PipeLine',
83+
},
84+
{
85+
name: 'IDE-jdbc',
86+
title: 'Jdbc',
8387
}],
8488
}, {
8589
name: '3',
@@ -89,6 +93,26 @@ export default {
8993
name: 'visualis-spark',
9094
title: 'Spark',
9195
}],
96+
},
97+
{
98+
name: '4',
99+
title: '工作流',
100+
icon: 'md-analytics',
101+
children: [{
102+
name: 'nodeexecution-spark',
103+
title: 'Spark',
104+
}, {
105+
name: 'nodeexecution-hive',
106+
title: 'Hive',
107+
},
108+
{
109+
name: 'nodeexecution-python',
110+
title: 'Python',
111+
},
112+
{
113+
name: 'nodeexecution-jdbc',
114+
title: 'Jdbc',
115+
}],
92116
}],
93117
activeMenu: '',
94118
fullTree: [],
@@ -110,6 +134,7 @@ export default {
110134
this.activeMenu = type;
111135
const IDE = 'IDE';
112136
const VSBI = 'visualis';
137+
const NODEECECUTION = 'nodeexecution';
113138
let appName = '通用设置';
114139
let creator = '通用设置';
115140
if (type.match(IDE)) {
@@ -118,6 +143,9 @@ export default {
118143
} else if (type.match(VSBI)) {
119144
creator = VSBI;
120145
appName = type.slice(VSBI.length + 1, type.length);
146+
} else if (type.match(NODEECECUTION)) {
147+
creator = NODEECECUTION;
148+
appName = type.slice(NODEECECUTION.length + 1, type.length);
121149
}
122150
api.fetch('/configuration/getFullTreesByAppName', {
123151
appName,

web/src/js/service/mixin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default {
3030
{ rule: /\.(out)$/i, lang: 'hql', executable: true, application: 'pipeline', runType: 'pipeline', ext: '.out', scriptType: 'storage', abbr: 'stor', logo: 'fi-storage', isCanBeNew: true, label: 'Storage', isCanBeOpen: true },
3131
{ rule: /\.scala$/i, lang: 'java', executable: true, application: 'spark', runType: 'scala', ext: '.scala', scriptType: 'scala', abbr: 'scala', logo: 'fi-scala', isCanBeNew: true, label: 'Scala', isCanBeOpen: true, flowType: 'scala' },
3232
{ rule: /\.scala$/i, lang: 'java', executable: true, application: 'spark', runType: 'function.mdq', ext: '.scala', scriptType: 'scala', abbr: 'scala', logo: 'fi-scala', isCanBeNew: false, label: 'Scala', isCanBeOpen: true },
33-
{ rule: /\.jdbc$/i, lang: 'hql', executable: true, application: 'jdbc', runType: 'jdbc', ext: '.jdbc', scriptType: 'jdbc', abbr: 'jdbc', logo: 'fi-jdbc', isCanBeNew: true, label: 'JDBC', isCanBeOpen: true },
33+
{ rule: /\.jdbc$/i, lang: 'hql', executable: true, application: 'jdbc', runType: 'jdbc', ext: '.jdbc', scriptType: 'jdbc', abbr: 'jdbc', logo: 'fi-jdbc', isCanBeNew: true, label: 'JDBC', isCanBeOpen: true, flowType: 'jdbc' },
3434
{ rule: /\.python$/i, lang: 'python', executable: true, application: 'python', runType: 'python', ext: '.python', scriptType: 'python', abbr: 'py', logo: 'fi-python', isCanBeNew: true, label: 'Python', isCanBeOpen: true, flowType: 'python' },
3535
{ rule: /\.py$/i, lang: 'python', executable: true, application: 'spark', runType: 'python', ext: '.py', scriptType: 'pythonSpark', abbr: 'py', logo: 'fi-spark-python', isCanBeNew: true, label: 'PythonSpark', isCanBeOpen: true, flowType: 'pyspark' },
3636
{ rule: /\.r$/i, lang: 'r', executable: true, application: 'spark', runType: 'r', ext: '.r', scriptType: 'r', abbr: 'r', logo: 'fi-r', isCanBeNew: true, label: 'R', isCanBeOpen: true },

web/src/js/service/nodeType.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,14 @@ import scala from '../module/process/images/scala.svg';
3232
import exchange from '../module/process/images/newIcon/exchange.svg';
3333
import qualitis from '../module/process/images/newIcon/qualitis.svg';
3434
import python from '../module/process/images/newIcon/python.svg';
35+
import jdbc from '../module/process/images/newIcon/JDBC2.svg';
3536
const NODETYPE = {
3637
SHELL: 'azkaban.shell',
3738
HQL: 'linkis.hive.hql',
3839
SPARKSQL: 'linkis.spark.sql',
3940
SPARKPY: 'linkis.spark.py',
4041
SCALA: 'linkis.spark.scala',
42+
JDBC: 'linkis.jdbc.jdbc',
4143
PYTHON: 'linkis.python.python',
4244
CONNECTOR: 'linkis.control.empty',
4345
DISPLAY: 'linkis.appjoint.visualis.display',
@@ -57,9 +59,14 @@ const ext = {
5759
[NODETYPE.SPARKSQL]: 'sparksql',
5860
[NODETYPE.SPARKPY]: 'pyspark',
5961
[NODETYPE.SCALA]: 'scala',
60-
[NODETYPE.PYTHON]: 'python'
62+
[NODETYPE.PYTHON]: 'python',
63+
[NODETYPE.JDBC]: 'jdbc'
6164
}
6265
const NODEICON = {
66+
[NODETYPE.JDBC]: {
67+
icon: jdbc,
68+
class: {'jdbc': true}
69+
},
6370
[NODETYPE.SHELL]: {
6471
icon: shell,
6572
class: {'shell': true}

0 commit comments

Comments
 (0)