Skip to content

Commit

Permalink
Merge pull request #25 from zwx-master/master
Browse files Browse the repository at this point in the history
New python node
  • Loading branch information
demonray authored Dec 13, 2019
2 parents 363bea2 + 9a30c82 commit 88c5ab0
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 6 deletions.
1 change: 1 addition & 0 deletions web/src/js/module/process/images/newIcon/python.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion web/src/js/module/process/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export default {
}
}
}
if ([NODETYPE.SPARKSQL, NODETYPE.HQL, NODETYPE.SPARKPY, NODETYPE.SHELL, NODETYPE.SCALA].indexOf(node.type) !== -1) {
if ([NODETYPE.SPARKSQL, NODETYPE.HQL, NODETYPE.SPARKPY, NODETYPE.SHELL, NODETYPE.SCALA, NODETYPE.PYTHON].indexOf(node.type) !== -1) {
const len = node.resources ? node.resources.length : 0;
if (len && node.jobContent && node.jobContent.script) { // 判断是否有保存过脚本
const resourceId = node.resources[0].resourceId;
Expand Down
7 changes: 7 additions & 0 deletions web/src/js/module/process/shape.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ export default [
image: NODEICON[NODETYPE.SCALA].icon,
editParam: false,
editBaseInfo: false,
},
{
type: NODETYPE.PYTHON,
title: 'python',
image: NODEICON[NODETYPE.PYTHON].icon,
editParam: false,
editBaseInfo: false,
}],
},
{
Expand Down
2 changes: 1 addition & 1 deletion web/src/js/service/mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default {
{ 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' },
{ 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 },
{ 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 },
{ 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 },
{ 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' },
{ 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' },
{ 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 },
{ rule: /\.sh$/i, lang: 'sh', executable: true, application: 'shell', runType: 'shell', ext: '.sh', scriptType: 'shell', abbr: 'shell', logo: 'fi-r', isCanBeNew: false, label: 'Shell', isCanBeOpen: true, flowType: 'shell' },
Expand Down
15 changes: 11 additions & 4 deletions web/src/js/service/nodeType.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import shell from '../module/process/images/shell.svg';
import flow from '../module/process/images/newIcon/flow.svg';
import eventchecker from '../module/process/images/newIcon/eventcheckerf.svg';
import Python from '../module/process/images/pyspark.svg';
import sparkPython from '../module/process/images/pyspark.svg';
import sql from '../module/process/images/newIcon/spark.svg';
import hivesql from '../module/process/images/newIcon/hive.svg';
import veceive from '../module/process/images/newIcon/eventcheckerw.svg';
Expand All @@ -31,12 +31,14 @@ import sendmail from '../module/process/images/newIcon/email.svg';
import scala from '../module/process/images/scala.svg';
import exchange from '../module/process/images/newIcon/exchange.svg';
import qualitis from '../module/process/images/newIcon/qualitis.svg';
import python from '../module/process/images/newIcon/python.svg';
const NODETYPE = {
SHELL: 'azkaban.shell',
HQL: 'linkis.hive.hql',
SPARKSQL: 'linkis.spark.sql',
SPARKPY: 'linkis.spark.py',
SCALA: 'linkis.spark.scala',
PYTHON: 'linkis.python.python',
CONNECTOR: 'linkis.control.empty',
DISPLAY: 'linkis.appjoint.visualis.display',
DASHBOARD: 'linkis.appjoint.visualis.dashboard',
Expand All @@ -54,7 +56,8 @@ const ext = {
[NODETYPE.HQL]: 'hql',
[NODETYPE.SPARKSQL]: 'sparksql',
[NODETYPE.SPARKPY]: 'pyspark',
[NODETYPE.SCALA]: 'scala'
[NODETYPE.SCALA]: 'scala',
[NODETYPE.PYTHON]: 'python'
}
const NODEICON = {
[NODETYPE.SHELL]: {
Expand All @@ -70,13 +73,17 @@ const NODEICON = {
class: {'sql': true}
},
[NODETYPE.SPARKPY]: {
icon: Python,
class: {'Python': true}
icon: sparkPython,
class: {'sparkPython': true}
},
[NODETYPE.SCALA]: {
icon: scala,
class: {'scala': true}
},
[NODETYPE.PYTHON]: {
icon: python,
class: {'python': true}
},
[NODETYPE.CONNECTOR]: {
icon: connect,
class: {'connect': true}
Expand Down

0 comments on commit 88c5ab0

Please sign in to comment.