Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_44739061
DolphinScheduler
提交
689bb5a2
DolphinScheduler
项目概览
weixin_44739061
/
DolphinScheduler
与 Fork 源项目一致
Fork自
apache / DolphinScheduler
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
DolphinScheduler
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
689bb5a2
编写于
5月 07, 2020
作者:
B
break60
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of
https://github.com/apache/incubator-dolphinscheduler
into dev
上级
4d70e3ce
32c5a68a
变更
61
展开全部
隐藏空白更改
内联
并排
Showing
61 changed file
with
1060 addition
and
1057 deletion
+1060
-1057
.github/workflows/ci_frontend.yml
.github/workflows/ci_frontend.yml
+1
-0
.github/workflows/ci_ut.yml
.github/workflows/ci_ut.yml
+2
-1
dolphinscheduler-ui/.eslintrc
dolphinscheduler-ui/.eslintrc
+0
-6
dolphinscheduler-ui/.eslintrc.yml
dolphinscheduler-ui/.eslintrc.yml
+34
-0
dolphinscheduler-ui/package.json
dolphinscheduler-ui/package.json
+8
-0
dolphinscheduler-ui/src/js/conf/home/index.js
dolphinscheduler-ui/src/js/conf/home/index.js
+5
-5
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/config.js
...scheduler-ui/src/js/conf/home/pages/dag/_source/config.js
+30
-32
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.js
...hinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.js
+151
-152
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/commcon.js
...home/pages/dag/_source/formModel/tasks/_source/commcon.js
+7
-7
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/jumpAffirm/index.js
...ui/src/js/conf/home/pages/dag/_source/jumpAffirm/index.js
+3
-3
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/downChart.js
...ui/src/js/conf/home/pages/dag/_source/plugIn/downChart.js
+11
-11
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/dragZoom.js
...-ui/src/js/conf/home/pages/dag/_source/plugIn/dragZoom.js
+1
-2
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js
...rc/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js
+70
-86
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/util.js
...uler-ui/src/js/conf/home/pages/dag/_source/plugIn/util.js
+16
-16
dolphinscheduler-ui/src/js/conf/home/pages/monitor/pages/servers/_source/gaugeOption.js
...f/home/pages/monitor/pages/servers/_source/gaugeOption.js
+13
-13
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/_source/instanceConditions/common.js
...pages/projects/pages/_source/instanceConditions/common.js
+1
-1
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/util.js
...ages/projects/pages/definition/pages/list/_source/util.js
+4
-4
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/tree/_source/tree.js
...ages/projects/pages/definition/pages/tree/_source/tree.js
+11
-12
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/tree/_source/util.js
...ages/projects/pages/definition/pages/tree/_source/util.js
+3
-3
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/chartConfig.js
...nf/home/pages/projects/pages/index/_source/chartConfig.js
+4
-5
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/gantt/_source/gantt.js
...ages/projects/pages/instance/pages/gantt/_source/gantt.js
+16
-17
dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/_source/common.js
...nf/home/pages/resource/pages/file/pages/_source/common.js
+1
-1
dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/details/_source/utils.js
.../pages/resource/pages/file/pages/details/_source/utils.js
+0
-1
dolphinscheduler-ui/src/js/conf/home/router/index.js
dolphinscheduler-ui/src/js/conf/home/router/index.js
+8
-8
dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js
dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js
+36
-36
dolphinscheduler-ui/src/js/conf/home/store/dag/mutations.js
dolphinscheduler-ui/src/js/conf/home/store/dag/mutations.js
+18
-18
dolphinscheduler-ui/src/js/conf/home/store/dag/state.js
dolphinscheduler-ui/src/js/conf/home/store/dag/state.js
+2
-2
dolphinscheduler-ui/src/js/conf/home/store/datasource/actions.js
...scheduler-ui/src/js/conf/home/store/datasource/actions.js
+9
-9
dolphinscheduler-ui/src/js/conf/home/store/monitor/actions.js
...hinscheduler-ui/src/js/conf/home/store/monitor/actions.js
+4
-4
dolphinscheduler-ui/src/js/conf/home/store/projects/actions.js
...inscheduler-ui/src/js/conf/home/store/projects/actions.js
+9
-9
dolphinscheduler-ui/src/js/conf/home/store/resource/actions.js
...inscheduler-ui/src/js/conf/home/store/resource/actions.js
+15
-15
dolphinscheduler-ui/src/js/conf/home/store/security/actions.js
...inscheduler-ui/src/js/conf/home/store/security/actions.js
+38
-38
dolphinscheduler-ui/src/js/conf/home/store/security/state.js
dolphinscheduler-ui/src/js/conf/home/store/security/state.js
+1
-1
dolphinscheduler-ui/src/js/conf/home/store/user/actions.js
dolphinscheduler-ui/src/js/conf/home/store/user/actions.js
+7
-7
dolphinscheduler-ui/src/js/conf/login/index.js
dolphinscheduler-ui/src/js/conf/login/index.js
+2
-2
dolphinscheduler-ui/src/js/module/ana-charts/common.js
dolphinscheduler-ui/src/js/module/ana-charts/common.js
+2
-2
dolphinscheduler-ui/src/js/module/ana-charts/index.js
dolphinscheduler-ui/src/js/module/ana-charts/index.js
+1
-1
dolphinscheduler-ui/src/js/module/ana-charts/packages/bar/index.js
...heduler-ui/src/js/module/ana-charts/packages/bar/index.js
+3
-3
dolphinscheduler-ui/src/js/module/ana-charts/packages/funnel/index.js
...uler-ui/src/js/module/ana-charts/packages/funnel/index.js
+2
-2
dolphinscheduler-ui/src/js/module/ana-charts/packages/line/index.js
...eduler-ui/src/js/module/ana-charts/packages/line/index.js
+2
-2
dolphinscheduler-ui/src/js/module/ana-charts/packages/pie/index.js
...heduler-ui/src/js/module/ana-charts/packages/pie/index.js
+5
-5
dolphinscheduler-ui/src/js/module/ana-charts/packages/radar/index.js
...duler-ui/src/js/module/ana-charts/packages/radar/index.js
+1
-1
dolphinscheduler-ui/src/js/module/ana-charts/packages/scatter/index.js
...ler-ui/src/js/module/ana-charts/packages/scatter/index.js
+1
-1
dolphinscheduler-ui/src/js/module/axios/querystring.js
dolphinscheduler-ui/src/js/module/axios/querystring.js
+32
-32
dolphinscheduler-ui/src/js/module/components/crontab/source/_source/i18n/index.js
...js/module/components/crontab/source/_source/i18n/index.js
+0
-1
dolphinscheduler-ui/src/js/module/components/crontab/source/_source/i18n/locale/en_US.js
...le/components/crontab/source/_source/i18n/locale/en_US.js
+43
-43
dolphinscheduler-ui/src/js/module/components/crontab/source/_source/i18n/locale/zh_CN.js
...le/components/crontab/source/_source/i18n/locale/zh_CN.js
+43
-43
dolphinscheduler-ui/src/js/module/components/crontab/source/util/index.js
...-ui/src/js/module/components/crontab/source/util/index.js
+12
-14
dolphinscheduler-ui/src/js/module/components/secondaryMenu/_source/menu.js
...ui/src/js/module/components/secondaryMenu/_source/menu.js
+2
-2
dolphinscheduler-ui/src/js/module/download/index.js
dolphinscheduler-ui/src/js/module/download/index.js
+4
-4
dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
+174
-174
dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
+174
-174
dolphinscheduler-ui/src/js/module/io/index.js
dolphinscheduler-ui/src/js/module/io/index.js
+5
-6
dolphinscheduler-ui/src/js/module/mixin/disabledState.js
dolphinscheduler-ui/src/js/module/mixin/disabledState.js
+1
-2
dolphinscheduler-ui/src/js/module/mixin/listUrlParamHandle.js
...hinscheduler-ui/src/js/module/mixin/listUrlParamHandle.js
+3
-3
dolphinscheduler-ui/src/js/module/permissions/index.js
dolphinscheduler-ui/src/js/module/permissions/index.js
+2
-2
dolphinscheduler-ui/src/js/module/util/index.js
dolphinscheduler-ui/src/js/module/util/index.js
+1
-3
dolphinscheduler-ui/src/js/module/util/routerUtil.js
dolphinscheduler-ui/src/js/module/util/routerUtil.js
+0
-3
dolphinscheduler-ui/src/js/module/util/util.js
dolphinscheduler-ui/src/js/module/util/util.js
+4
-5
dolphinscheduler-ui/src/lib/external/config.js
dolphinscheduler-ui/src/lib/external/config.js
+1
-1
dolphinscheduler-ui/src/lib/external/email.js
dolphinscheduler-ui/src/lib/external/email.js
+1
-1
未找到文件。
.github/workflows/ci_frontend.yml
浏览文件 @
689bb5a2
...
...
@@ -50,6 +50,7 @@ jobs:
cd dolphinscheduler-ui
npm install node-sass --unsafe-perm
npm install
npm run lint
npm run build
License-check
:
...
...
.github/workflows/ci_ut.yml
浏览文件 @
689bb5a2
...
...
@@ -75,6 +75,7 @@ jobs:
-Dsonar.core.codeCoveragePlugin=jacoco
-Dsonar.projectKey=apache-dolphinscheduler
-Dsonar.login=e4058004bc6be89decf558ac819aa1ecbee57682
-Dsonar.exclusions=dolphinscheduler-ui/src/**/i18n/locale/*.js
env
:
GITHUB_TOKEN
:
${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN
:
${{ secrets.SONAR_TOKEN }}
...
...
@@ -83,4 +84,4 @@ jobs:
mkdir -p ${LOG_DIR}
cd ${DOCKER_DIR}
docker-compose logs db > ${LOG_DIR}/db.txt
continue-on-error
:
true
\ No newline at end of file
continue-on-error
:
true
dolphinscheduler-ui/.eslintrc
已删除
100644 → 0
浏览文件 @
4d70e3ce
globals:
$: true
expect: true
rules:
"no-new": "off"
"no-labels": [2, {"allowLoop": true}]
dolphinscheduler-ui/.eslintrc.yml
0 → 100644
浏览文件 @
689bb5a2
#
# 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.
#
env
:
browser
:
true
es6
:
true
jquery
:
true
extends
:
-
'
plugin:vue/essential'
-
standard
globals
:
Atomics
:
readonly
SharedArrayBuffer
:
readonly
PUBLIC_PATH
:
readonly
parserOptions
:
ecmaVersion
:
2018
sourceType
:
module
plugins
:
-
vue
rules
:
{}
dolphinscheduler-ui/package.json
浏览文件 @
689bb5a2
...
...
@@ -8,6 +8,7 @@
"dev"
:
"cross-env NODE_ENV=development webpack-dev-server --config ./build/webpack.config.dev.js"
,
"clean"
:
"rimraf dist"
,
"start"
:
"npm run dev"
,
"lint"
:
"eslint ./src --fix"
,
"build:release"
:
"npm run clean && cross-env NODE_ENV=production PUBLIC_PATH=/dolphinscheduler/ui webpack --config ./build/webpack.config.release.js"
},
"dependencies"
:
{
...
...
@@ -50,6 +51,13 @@
"css-loader"
:
"^0.28.8"
,
"cssnano"
:
"4.1.10"
,
"env-parse"
:
"^1.0.5"
,
"eslint"
:
"^6.8.0"
,
"eslint-config-standard"
:
"^14.1.1"
,
"eslint-plugin-import"
:
"^2.20.2"
,
"eslint-plugin-node"
:
"^11.1.0"
,
"eslint-plugin-promise"
:
"^4.2.1"
,
"eslint-plugin-standard"
:
"^4.0.1"
,
"eslint-plugin-vue"
:
"^6.2.2"
,
"file-loader"
:
"^5.0.2"
,
"globby"
:
"^8.0.1"
,
"html-loader"
:
"^0.5.5"
,
...
...
dolphinscheduler-ui/src/js/conf/home/index.js
浏览文件 @
689bb5a2
...
...
@@ -31,15 +31,15 @@ import Permissions from '@/module/permissions'
import
'
ans-ui/lib/ans-ui.min.css
'
import
ans
from
'
ans-ui/lib/ans-ui.min
'
import
en_US
from
'
ans-ui/lib/locale/en
'
// eslint-disable-line
import
'
normalize.css/normalize.css
'
import
'
normalize.css/normalize.css
'
import
'
sass/conf/home/index.scss
'
import
'
bootstrap/dist/css/bootstrap.min.css
'
import
'
bootstrap/dist/css/bootstrap.min.css
'
import
'
bootstrap/dist/js/bootstrap.min.js
'
import
'
bootstrap/dist/js/bootstrap.min.js
'
import
'
canvg/dist/browser/canvg.min.js
'
// Component internationalization
le
t
useOpt
=
i18n
.
globalScope
.
LOCALE
===
'
en_US
'
?
{
locale
:
en_US
}
:
{}
cons
t
useOpt
=
i18n
.
globalScope
.
LOCALE
===
'
en_US
'
?
{
locale
:
en_US
}
:
{}
// Vue.use(ans)
Vue
.
use
(
ans
,
useOpt
)
...
...
@@ -74,7 +74,7 @@ Permissions.request().then(res => {
methods
:
{
initApp
()
{
$
(
'
.global-loading
'
).
hide
()
le
t
bootstrapTooltip
=
$
.
fn
.
tooltip
.
noConflict
()
cons
t
bootstrapTooltip
=
$
.
fn
.
tooltip
.
noConflict
()
$
.
fn
.
tooltip
=
bootstrapTooltip
$
(
'
body
'
).
tooltip
({
selector
:
'
[data-toggle="tooltip"]
'
,
...
...
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/config.js
浏览文件 @
689bb5a2
...
...
@@ -16,7 +16,6 @@
*/
import
i18n
from
'
@/module/i18n
'
import
Permissions
from
'
@/module/permissions
'
/**
* Operation bar config
...
...
@@ -26,7 +25,7 @@ import Permissions from '@/module/permissions'
* @desc tooltip
*/
const
toolOper
=
(
dagThis
)
=>
{
let
disabled
=
!!
dagThis
.
$store
.
state
.
dag
.
isDetails
// Permissions.getAuth() === false ? false : !dagThis.$store.state.dag.isDetails
const
disabled
=
!!
dagThis
.
$store
.
state
.
dag
.
isDetails
// Permissions.getAuth() === false ? false : !dagThis.$store.state.dag.isDetails
return
[
{
code
:
'
pointer
'
,
...
...
@@ -67,7 +66,7 @@ const toolOper = (dagThis) => {
* @desc tooltip
* @code Backend definition identifier
*/
le
t
publishStatus
=
[
cons
t
publishStatus
=
[
{
id
:
0
,
desc
:
`
${
i18n
.
$t
(
'
Unpublished
'
)}
`
,
...
...
@@ -90,7 +89,7 @@ let publishStatus = [
* @desc tooltip
* @code identifier
*/
le
t
runningType
=
[
cons
t
runningType
=
[
{
desc
:
`
${
i18n
.
$t
(
'
Start Process
'
)}
`
,
code
:
'
START_PROCESS
'
...
...
@@ -146,85 +145,85 @@ let runningType = [
* @icoUnicode iconfont
* @isSpin is loading (Need to execute the code block to write if judgment)
*/
le
t
tasksState
=
{
'
SUBMITTED_SUCCESS
'
:
{
cons
t
tasksState
=
{
SUBMITTED_SUCCESS
:
{
id
:
0
,
desc
:
`
${
i18n
.
$t
(
'
Submitted successfully
'
)}
`
,
color
:
'
#A9A9A9
'
,
icoUnicode
:
'
ans-icon-dot-circle
'
,
isSpin
:
false
},
'
RUNNING_EXEUTION
'
:
{
RUNNING_EXEUTION
:
{
id
:
1
,
desc
:
`
${
i18n
.
$t
(
'
Executing
'
)}
`
,
color
:
'
#0097e0
'
,
icoUnicode
:
'
ans-icon-gear
'
,
isSpin
:
true
},
'
READY_PAUSE
'
:
{
READY_PAUSE
:
{
id
:
2
,
desc
:
`
${
i18n
.
$t
(
'
Ready to pause
'
)}
`
,
color
:
'
#07b1a3
'
,
icoUnicode
:
'
ans-icon-pause-solid
'
,
isSpin
:
false
},
'
PAUSE
'
:
{
PAUSE
:
{
id
:
3
,
desc
:
`
${
i18n
.
$t
(
'
Pause
'
)}
`
,
color
:
'
#057c72
'
,
icoUnicode
:
'
ans-icon-pause
'
,
isSpin
:
false
},
'
READY_STOP
'
:
{
READY_STOP
:
{
id
:
4
,
desc
:
`
${
i18n
.
$t
(
'
Ready to stop
'
)}
`
,
color
:
'
#FE0402
'
,
icoUnicode
:
'
ans-icon-coin
'
,
isSpin
:
false
},
'
STOP
'
:
{
STOP
:
{
id
:
5
,
desc
:
`
${
i18n
.
$t
(
'
Stop
'
)}
`
,
color
:
'
#e90101
'
,
icoUnicode
:
'
ans-icon-stop
'
,
isSpin
:
false
},
'
FAILURE
'
:
{
FAILURE
:
{
id
:
6
,
desc
:
`
${
i18n
.
$t
(
'
failed
'
)}
`
,
color
:
'
#000000
'
,
icoUnicode
:
'
ans-icon-fail-empty
'
,
isSpin
:
false
},
'
SUCCESS
'
:
{
SUCCESS
:
{
id
:
7
,
desc
:
`
${
i18n
.
$t
(
'
success
'
)}
`
,
color
:
'
#33cc00
'
,
icoUnicode
:
'
ans-icon-success-empty
'
,
isSpin
:
false
},
'
NEED_FAULT_TOLERANCE
'
:
{
NEED_FAULT_TOLERANCE
:
{
id
:
8
,
desc
:
`
${
i18n
.
$t
(
'
Need fault tolerance
'
)}
`
,
color
:
'
#FF8C00
'
,
icoUnicode
:
'
ans-icon-pen
'
,
isSpin
:
false
},
'
KILL
'
:
{
KILL
:
{
id
:
9
,
desc
:
`
${
i18n
.
$t
(
'
kill
'
)}
`
,
color
:
'
#a70202
'
,
icoUnicode
:
'
ans-icon-minus-circle-empty
'
,
isSpin
:
false
},
'
WAITTING_THREAD
'
:
{
WAITTING_THREAD
:
{
id
:
10
,
desc
:
`
${
i18n
.
$t
(
'
Waiting for thread
'
)}
`
,
color
:
'
#912eed
'
,
icoUnicode
:
'
ans-icon-sand-clock
'
,
isSpin
:
false
},
'
WAITTING_DEPEND
'
:
{
WAITTING_DEPEND
:
{
id
:
11
,
desc
:
`
${
i18n
.
$t
(
'
Waiting for dependence
'
)}
`
,
color
:
'
#5101be
'
,
...
...
@@ -239,62 +238,61 @@ let tasksState = {
* @desc tooltip
* @color color (tree and gantt)
*/
le
t
tasksType
=
{
'
SHELL
'
:
{
cons
t
tasksType
=
{
SHELL
:
{
desc
:
'
SHELL
'
,
color
:
'
#646464
'
},
'
SUB_PROCESS
'
:
{
SUB_PROCESS
:
{
desc
:
'
SUB_PROCESS
'
,
color
:
'
#0097e0
'
},
'
PROCEDURE
'
:
{
PROCEDURE
:
{
desc
:
'
PROCEDURE
'
,
color
:
'
#525CCD
'
},
'
SQL
'
:
{
SQL
:
{
desc
:
'
SQL
'
,
color
:
'
#7A98A1
'
},
'
SPARK
'
:
{
SPARK
:
{
desc
:
'
SPARK
'
,
color
:
'
#E46F13
'
},
'
FLINK
'
:
{
FLINK
:
{
desc
:
'
FLINK
'
,
color
:
'
#E46F13
'
},
'
MR
'
:
{
MR
:
{
desc
:
'
MapReduce
'
,
color
:
'
#A0A5CC
'
},
'
PYTHON
'
:
{
PYTHON
:
{
desc
:
'
PYTHON
'
,
color
:
'
#FED52D
'
},
'
DEPENDENT
'
:
{
DEPENDENT
:
{
desc
:
'
DEPENDENT
'
,
color
:
'
#2FBFD8
'
},
'
HTTP
'
:
{
HTTP
:
{
desc
:
'
HTTP
'
,
color
:
'
#E46F13
'
},
'
DATAX
'
:
{
DATAX
:
{
desc
:
'
DataX
'
,
color
:
'
#1fc747
'
},
'
SQOOP
'
:
{
SQOOP
:
{
desc
:
'
SQOOP
'
,
color
:
'
#E46F13
'
},
'
CONDITIONS
'
:
{
CONDITIONS
:
{
desc
:
'
CONDITIONS
'
,
color
:
'
#E46F13
'
}
}
export
{
toolOper
,
publishStatus
,
...
...
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.js
浏览文件 @
689bb5a2
...
...
@@ -24,7 +24,7 @@ import store from '@/conf/home/store'
/**
* Prototype method
*/
le
t
Dag
=
function
()
{
cons
t
Dag
=
function
()
{
this
.
dag
=
{}
this
.
instance
=
{}
}
...
...
@@ -49,7 +49,7 @@ Dag.prototype.setConfig = function (o) {
* create dag
*/
Dag
.
prototype
.
create
=
function
()
{
le
t
self
=
this
cons
t
self
=
this
jsPlumb
.
ready
(()
=>
{
JSP
.
init
({
dag
:
this
.
dag
,
...
...
@@ -98,36 +98,35 @@ Dag.prototype.toolbarEvent = function ({ item, code, is }) {
* Echo data display
*/
Dag
.
prototype
.
backfill
=
function
(
arg
)
{
if
(
arg
)
{
if
(
arg
)
{
let
locationsValue
=
store
.
state
.
dag
.
locations
le
t
locationsValue1
=
store
.
state
.
dag
.
locations
le
t
locationsValue2
=
store
.
state
.
dag
.
locations
le
t
arr
=
[]
for
(
le
t
i
in
locationsValue1
)
{
let
objs
=
new
Object
();
cons
t
locationsValue1
=
store
.
state
.
dag
.
locations
cons
t
locationsValue2
=
store
.
state
.
dag
.
locations
cons
t
arr
=
[]
for
(
cons
t
i
in
locationsValue1
)
{
const
objs
=
{}
objs
.
id
=
i
arr
.
push
(
Object
.
assign
(
objs
,
locationsValue1
[
i
]));
//
Attributes
arr
.
push
(
Object
.
assign
(
objs
,
locationsValue1
[
i
]))
//
Attributes
}
le
t
tmp
=
[]
for
(
le
t
i
in
locationsValue2
)
{
if
(
locationsValue2
[
i
].
targetarr
!=
''
&&
locationsValue2
[
i
].
targetarr
.
split
(
'
,
'
).
length
>
1
)
{
cons
t
tmp
=
[]
for
(
cons
t
i
in
locationsValue2
)
{
if
(
locationsValue2
[
i
].
targetarr
!==
''
&&
locationsValue2
[
i
].
targetarr
.
split
(
'
,
'
).
length
>
1
)
{
tmp
.
push
(
locationsValue2
[
i
])
}
}
function
copy
(
array
)
{
le
t
newArray
=
[]
for
(
le
t
item
of
array
)
{
newArray
.
push
(
item
)
;
const
copy
=
function
(
array
)
{
cons
t
newArray
=
[]
for
(
cons
t
item
of
array
)
{
newArray
.
push
(
item
)
}
return
newArray
;
return
newArray
}
let
newArr
=
copy
(
arr
)
function
getNewArr
()
{
for
(
let
i
=
0
;
i
<
newArr
.
length
;
i
++
)
{
if
(
newArr
[
i
].
targetarr
!=
''
&&
newArr
[
i
].
targetarr
.
split
(
'
,
'
).
length
>
1
)
{
const
newArr
=
copy
(
arr
)
const
getNewArr
=
function
()
{
for
(
let
i
=
0
;
i
<
newArr
.
length
;
i
++
)
{
if
(
newArr
[
i
].
targetarr
!==
''
&&
newArr
[
i
].
targetarr
.
split
(
'
,
'
).
length
>
1
)
{
newArr
[
i
].
targetarr
=
newArr
[
i
].
targetarr
.
split
(
'
,
'
).
shift
()
}
}
...
...
@@ -141,154 +140,154 @@ Dag.prototype.backfill = function (arg) {
* @param {String} idStr id key name
* @param {String} childrenStr children key name
*/
function
fommat
({
arrayList
,
pidStr
=
'
targetarr
'
,
idStr
=
'
id
'
,
childrenStr
=
'
children
'
})
{
let
listOjb
=
{};
// Used to store objects of the form {key: obj}
let
treeList
=
[];
// An array to store the final tree structure data
// Transform the data into {key: obj} format, which is convenient for the following data processing
for
(
let
i
=
0
;
i
<
arrayList
.
length
;
i
++
)
{
listOjb
[
arrayList
[
i
][
idStr
]]
=
arrayList
[
i
]
}
// Format data based on pid
for
(
let
j
=
0
;
j
<
arrayList
.
length
;
j
++
)
{
// Determine if the parent exists
// let haveParent = arrayList[j].targetarr.split(',').length>1?listOjb[arrayList[j].targetarr.split(',')[0]]:listOjb[arrayList[j][pidStr]]
let
haveParent
=
listOjb
[
arrayList
[
j
][
pidStr
]]
if
(
haveParent
)
{
// If there is no parent children field, create a children field
!
haveParent
[
childrenStr
]
&&
(
haveParent
[
childrenStr
]
=
[])
// Insert child in parent
haveParent
[
childrenStr
].
push
(
arrayList
[
j
])
}
else
{
// If there is no parent, insert directly into the outermost layer
treeList
.
push
(
arrayList
[
j
])
}
}
return
treeList
const
fommat
=
function
({
arrayList
,
pidStr
=
'
targetarr
'
,
idStr
=
'
id
'
,
childrenStr
=
'
children
'
})
{
const
listOjb
=
{}
// Used to store objects of the form {key: obj}
const
treeList
=
[]
// An array to store the final tree structure data
// Transform the data into {key: obj} format, which is convenient for the following data processing
for
(
let
i
=
0
;
i
<
arrayList
.
length
;
i
++
)
{
listOjb
[
arrayList
[
i
][
idStr
]]
=
arrayList
[
i
]
}
let
datas
=
fommat
({
arrayList
:
newArr
,
pidStr
:
'
targetarr
'
})
// Count the number of leaf nodes
function
getLeafCountTree
(
json
)
{
if
(
!
json
.
children
)
{
json
.
colspan
=
1
;
return
1
;
// Format data based on pid
for
(
let
j
=
0
;
j
<
arrayList
.
length
;
j
++
)
{
// Determine if the parent exists
// let haveParent = arrayList[j].targetarr.split(',').length>1?listOjb[arrayList[j].targetarr.split(',')[0]]:listOjb[arrayList[j][pidStr]]
const
haveParent
=
listOjb
[
arrayList
[
j
][
pidStr
]]
if
(
haveParent
)
{
// If there is no parent children field, create a children field
!
haveParent
[
childrenStr
]
&&
(
haveParent
[
childrenStr
]
=
[])
// Insert child in parent
haveParent
[
childrenStr
].
push
(
arrayList
[
j
])
}
else
{
let
leafCount
=
0
;
for
(
let
i
=
0
;
i
<
json
.
children
.
length
;
i
++
){
leafCount
=
leafCount
+
getLeafCountTree
(
json
.
children
[
i
]);
}
json
.
colspan
=
leafCount
;
return
leafCount
;
// If there is no parent, insert directly into the outermost layer
treeList
.
push
(
arrayList
[
j
])
}
}
// Number of tree node levels
let
countTree
=
getLeafCountTree
(
datas
[
0
])
function
getMaxFloor
(
treeData
)
{
let
max
=
0
function
each
(
data
,
floor
)
{
data
.
forEach
(
e
=>
{
e
.
floor
=
floor
e
.
x
=
floor
*
170
if
(
floor
>
max
)
{
max
=
floor
}
if
(
e
.
children
)
{
each
(
e
.
children
,
floor
+
1
)
}
})
}
each
(
treeData
,
1
)
return
max
return
treeList
}
const
datas
=
fommat
({
arrayList
:
newArr
,
pidStr
:
'
targetarr
'
})
// Count the number of leaf nodes
const
getLeafCountTree
=
function
(
json
)
{
if
(
!
json
.
children
)
{
json
.
colspan
=
1
return
1
}
else
{
let
leafCount
=
0
for
(
let
i
=
0
;
i
<
json
.
children
.
length
;
i
++
)
{
leafCount
=
leafCount
+
getLeafCountTree
(
json
.
children
[
i
])
}
getMaxFloor
(
datas
)
// The last child of each node
let
lastchildren
=
[];
forxh
(
datas
);
function
forxh
(
list
)
{
for
(
let
i
=
0
;
i
<
list
.
length
;
i
++
)
{
let
chlist
=
list
[
i
];
if
(
chlist
.
children
)
{
forxh
(
chlist
.
children
);
}
else
{
lastchildren
.
push
(
chlist
);
}
json
.
colspan
=
leafCount
return
leafCount
}
}
// Number of tree node levels
const
countTree
=
getLeafCountTree
(
datas
[
0
])
const
getMaxFloor
=
function
(
treeData
)
{
let
max
=
0
function
each
(
data
,
floor
)
{
data
.
forEach
(
e
=>
{
e
.
floor
=
floor
e
.
x
=
floor
*
170
if
(
floor
>
max
)
{
max
=
floor
}
}
// Get all parent nodes above the leaf node
function
treeFindPath
(
tree
,
func
,
path
,
n
)
{
if
(
!
tree
)
return
[]
for
(
const
data
of
tree
)
{
path
.
push
(
data
.
name
)
if
(
func
(
data
))
return
path
if
(
data
.
children
)
{
const
findChildren
=
treeFindPath
(
data
.
children
,
func
,
path
,
n
)
if
(
findChildren
.
length
)
return
findChildren
}
path
.
pop
()
if
(
e
.
children
)
{
each
(
e
.
children
,
floor
+
1
)
}
return
[]
}
function
toLine
(
data
){
return
data
.
reduce
((
arrData
,
{
id
,
name
,
targetarr
,
x
,
y
,
children
=
[]})
=>
arrData
.
concat
([{
id
,
name
,
targetarr
,
x
,
y
}],
toLine
(
children
)),
[])
})
}
each
(
treeData
,
1
)
return
max
}
getMaxFloor
(
datas
)
// The last child of each node
let
lastchildren
=
[]
const
forxh
=
function
(
list
)
{
for
(
let
i
=
0
;
i
<
list
.
length
;
i
++
)
{
const
chlist
=
list
[
i
]
if
(
chlist
.
children
)
{
forxh
(
chlist
.
children
)
}
else
{
lastchildren
.
push
(
chlist
)
}
let
listarr
=
toLine
(
datas
);
let
listarrs
=
toLine
(
datas
)
let
dataObject
=
{}
for
(
let
i
=
0
;
i
<
listarrs
.
length
;
i
++
)
{
delete
(
listarrs
[
i
].
id
)
}
}
forxh
(
datas
)
// Get all parent nodes above the leaf node
const
treeFindPath
=
function
(
tree
,
func
,
path
,
n
)
{
if
(
!
tree
)
return
[]
for
(
const
data
of
tree
)
{
path
.
push
(
data
.
name
)
if
(
func
(
data
))
return
path
if
(
data
.
children
)
{
const
findChildren
=
treeFindPath
(
data
.
children
,
func
,
path
,
n
)
if
(
findChildren
.
length
)
return
findChildren
}
path
.
pop
()
}
return
[]
}
const
toLine
=
function
(
data
)
{
return
data
.
reduce
((
arrData
,
{
id
,
name
,
targetarr
,
x
,
y
,
children
=
[]
})
=>
arrData
.
concat
([{
id
,
name
,
targetarr
,
x
,
y
}],
toLine
(
children
)),
[])
}
const
listarr
=
toLine
(
datas
)
const
listarrs
=
toLine
(
datas
)
const
dataObject
=
{}
for
(
let
i
=
0
;
i
<
listarrs
.
length
;
i
++
)
{
delete
(
listarrs
[
i
].
id
)
}
for
(
let
a
=
0
;
a
<
listarr
.
length
;
a
++
)
{
dataObject
[
listarr
[
a
].
id
]
=
listarrs
[
a
]
}
// Comparison function
function
createComparisonFunction
(
propertyName
)
{
return
function
(
object1
,
object2
)
{
let
value1
=
object1
[
propertyName
];
let
value2
=
object2
[
propertyName
];
for
(
let
a
=
0
;
a
<
listarr
.
length
;
a
++
)
{
dataObject
[
listarr
[
a
].
id
]
=
listarrs
[
a
]
}
// Comparison function
const
createComparisonFunction
=
function
(
propertyName
)
{
return
function
(
object1
,
object2
)
{
const
value1
=
object1
[
propertyName
]
const
value2
=
object2
[
propertyName
]
if
(
value1
<
value2
)
{
return
-
1
;
}
else
if
(
value1
>
value2
)
{
return
1
;
}
else
{
return
0
;
}
};
if
(
value1
<
value2
)
{
return
-
1
}
else
if
(
value1
>
value2
)
{
return
1
}
else
{
return
0
}
}
}
lastchildren
=
lastchildren
.
sort
(
createComparisonFunction
(
'
x
'
))
lastchildren
=
lastchildren
.
sort
(
createComparisonFunction
(
'
x
'
))
// Coordinate value of each leaf node
for
(
let
a
=
0
;
a
<
lastchildren
.
length
;
a
++
)
{
dataObject
[
lastchildren
[
a
].
id
].
y
=
(
a
+
1
)
*
120
}
for
(
let
i
=
0
;
i
<
lastchildren
.
length
;
i
++
)
{
let
node
=
treeFindPath
(
datas
,
data
=>
data
.
targetarr
===
lastchildren
[
i
].
targetarr
,[],
i
+
1
)
for
(
let
j
=
0
;
j
<
node
.
length
;
j
++
)
{
for
(
let
k
=
0
;
k
<
listarrs
.
length
;
k
++
)
{
if
(
node
[
j
]
==
listarrs
[
k
].
name
)
{
listarrs
[
k
].
y
=
(
i
+
1
)
*
120
}
}
}
}
for
(
let
i
=
0
;
i
<
tmp
.
length
;
i
++
)
{
for
(
let
objs
in
dataObject
)
{
if
(
tmp
[
i
].
name
==
dataObject
[
objs
].
name
)
{
dataObject
[
objs
].
targetarr
=
tmp
[
i
].
targetarr
}
// Coordinate value of each leaf node
for
(
let
a
=
0
;
a
<
lastchildren
.
length
;
a
++
)
{
dataObject
[
lastchildren
[
a
].
id
].
y
=
(
a
+
1
)
*
120
}
for
(
let
i
=
0
;
i
<
lastchildren
.
length
;
i
++
)
{
const
node
=
treeFindPath
(
datas
,
data
=>
data
.
targetarr
===
lastchildren
[
i
].
targetarr
,
[],
i
+
1
)
for
(
let
j
=
0
;
j
<
node
.
length
;
j
++
)
{
for
(
let
k
=
0
;
k
<
listarrs
.
length
;
k
++
)
{
if
(
node
[
j
]
===
listarrs
[
k
].
name
)
{
listarrs
[
k
].
y
=
(
i
+
1
)
*
120
}
}
for
(
let
a
=
0
;
a
<
lastchildren
.
length
;
a
++
)
{
dataObject
[
lastchildren
[
a
].
id
].
y
=
(
a
+
1
)
*
120
}
if
(
countTree
>
1
)
{
dataObject
[
Object
.
keys
(
locationsValue1
)[
0
]].
y
=
(
countTree
/
2
)
*
120
+
50
}
}
for
(
let
i
=
0
;
i
<
tmp
.
length
;
i
++
)
{
for
(
const
objs
in
dataObject
)
{
if
(
tmp
[
i
].
name
===
dataObject
[
objs
].
name
)
{
dataObject
[
objs
].
targetarr
=
tmp
[
i
].
targetarr
}
}
}
for
(
let
a
=
0
;
a
<
lastchildren
.
length
;
a
++
)
{
dataObject
[
lastchildren
[
a
].
id
].
y
=
(
a
+
1
)
*
120
}
if
(
countTree
>
1
)
{
dataObject
[
Object
.
keys
(
locationsValue1
)[
0
]].
y
=
(
countTree
/
2
)
*
120
+
50
}
locationsValue
=
dataObject
le
t
self
=
this
cons
t
self
=
this
jsPlumb
.
ready
(()
=>
{
JSP
.
init
({
dag
:
this
.
dag
,
...
...
@@ -310,7 +309,7 @@ Dag.prototype.backfill = function (arg) {
})
})
}
else
{
le
t
self
=
this
cons
t
self
=
this
jsPlumb
.
ready
(()
=>
{
JSP
.
init
({
dag
:
this
.
dag
,
...
...
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/commcon.js
浏览文件 @
689bb5a2
...
...
@@ -43,7 +43,7 @@ const cycleList = [
* cycle value
*/
const
dateValueList
=
{
'
hour
'
:
[
hour
:
[
{
value
:
'
last1Hour
'
,
label
:
`
${
i18n
.
$t
(
'
Last1Hour
'
)}
`
...
...
@@ -57,7 +57,7 @@ const dateValueList = {
label
:
`
${
i18n
.
$t
(
'
Last3Hours
'
)}
`
}
],
'
day
'
:
[
day
:
[
{
value
:
'
today
'
,
label
:
`
${
i18n
.
$t
(
'
today
'
)}
`
...
...
@@ -79,7 +79,7 @@ const dateValueList = {
label
:
`
${
i18n
.
$t
(
'
Last7Days
'
)}
`
}
],
'
week
'
:
[
week
:
[
{
value
:
'
thisWeek
'
,
label
:
`
${
i18n
.
$t
(
'
ThisWeek
'
)}
`
...
...
@@ -117,7 +117,7 @@ const dateValueList = {
label
:
`
${
i18n
.
$t
(
'
LastSunday
'
)}
`
}
],
'
month
'
:
[
month
:
[
{
value
:
'
thisMonth
'
,
label
:
`
${
i18n
.
$t
(
'
ThisMonth
'
)}
`
...
...
@@ -221,15 +221,15 @@ const sqlTypeList = [
const
positionList
=
[
{
id
:
'
PARAMETER
'
,
code
:
"
Parameter
"
code
:
'
Parameter
'
},
{
id
:
'
BODY
'
,
code
:
"
Body
"
code
:
'
Body
'
},
{
id
:
'
HEADERS
'
,
code
:
"
Headers
"
code
:
'
Headers
'
}
]
const
nodeStatusList
=
[
...
...
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/jumpAffirm/index.js
浏览文件 @
689bb5a2
...
...
@@ -21,7 +21,7 @@ import store from '@/conf/home/store'
import
router
from
'
@/conf/home/router
'
import
{
uuid
,
findComponentDownward
}
from
'
@/module/util/
'
le
t
Affirm
=
{}
cons
t
Affirm
=
{}
let
$root
=
{}
let
$routerType
=
''
let
$isPop
=
true
...
...
@@ -59,7 +59,7 @@ Affirm.paramVerification = (name) => {
if
(
!
$isPop
)
{
return
true
}
le
t
dagStore
=
store
.
state
.
dag
cons
t
dagStore
=
store
.
state
.
dag
let
flag
=
false
if
(
$routerType
===
'
definition-create
'
)
{
// No nodes jump out directly
...
...
@@ -100,7 +100,7 @@ Affirm.isPop = (fn) => {
Vue
.
$modal
.
destroy
()
})
},
close
()
{
close
()
{
fn
()
Vue
.
$modal
.
destroy
()
}
...
...
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/downChart.js
浏览文件 @
689bb5a2
...
...
@@ -21,7 +21,7 @@ import { tasksAll } from './util'
import
html2canvas
from
'
html2canvas
'
import
{
findComponentDownward
}
from
'
@/module/util/
'
le
t
DownChart
=
function
()
{
cons
t
DownChart
=
function
()
{
this
.
dag
=
{}
}
...
...
@@ -31,10 +31,10 @@ let DownChart = function () {
DownChart
.
prototype
.
maxVal
=
function
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
// All nodes
le
t
tasksAllList
=
tasksAll
()
le
t
dom
=
$
(
'
.dag-container
'
)
le
t
y
=
parseInt
(
_
.
maxBy
(
tasksAllList
,
'
y
'
).
y
+
60
)
le
t
x
=
parseInt
(
_
.
maxBy
(
tasksAllList
,
'
x
'
).
x
+
100
)
cons
t
tasksAllList
=
tasksAll
()
cons
t
dom
=
$
(
'
.dag-container
'
)
cons
t
y
=
parseInt
(
_
.
maxBy
(
tasksAllList
,
'
y
'
).
y
+
60
)
cons
t
x
=
parseInt
(
_
.
maxBy
(
tasksAllList
,
'
x
'
).
x
+
100
)
resolve
({
width
:
(
x
>
600
?
x
:
dom
.
width
())
+
100
,
...
...
@@ -60,9 +60,9 @@ DownChart.prototype.download = function ({ dagThis }) {
// svg handle
const
nodesToRecover
=
[]
const
nodesToRemove
=
[]
le
t
parentNode
=
node
.
parentNode
le
t
svg
=
node
.
outerHTML
.
trim
()
le
t
canvas
=
document
.
createElement
(
'
canvas
'
)
cons
t
parentNode
=
node
.
parentNode
cons
t
svg
=
node
.
outerHTML
.
trim
()
cons
t
canvas
=
document
.
createElement
(
'
canvas
'
)
canvg
(
canvas
,
svg
)
if
(
node
.
style
.
position
)
{
canvas
.
style
.
position
+=
node
.
style
.
position
...
...
@@ -102,10 +102,10 @@ DownChart.prototype.download = function ({ dagThis }) {
heigth
:
height
,
useCORS
:
true
// Enable cross-domain configuration
}).
then
((
canvas
)
=>
{
le
t
name
=
`
${
this
.
dag
.
name
}
.png`
le
t
url
=
canvas
.
toDataURL
(
'
image/png
'
,
1
)
cons
t
name
=
`
${
this
.
dag
.
name
}
.png`
cons
t
url
=
canvas
.
toDataURL
(
'
image/png
'
,
1
)
setTimeout
(()
=>
{
le
t
triggerDownload
=
$
(
'
<a>
'
).
attr
(
'
href
'
,
url
).
attr
(
'
download
'
,
name
).
appendTo
(
'
body
'
)
cons
t
triggerDownload
=
$
(
'
<a>
'
).
attr
(
'
href
'
,
url
).
attr
(
'
download
'
,
name
).
appendTo
(
'
body
'
)
triggerDownload
[
0
].
click
()
triggerDownload
.
remove
()
},
100
)
...
...
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/dragZoom.js
浏览文件 @
689bb5a2
...
...
@@ -23,7 +23,7 @@ const DragZoom = function () {
}
DragZoom
.
prototype
.
init
=
function
()
{
le
t
$canvas
=
$
(
'
#canvas
'
)
cons
t
$canvas
=
$
(
'
#canvas
'
)
this
.
element
=
d3
.
select
(
'
#canvas
'
)
this
.
zoom
=
d3
.
behavior
.
zoom
()
.
scaleExtent
([
0.5
,
2
])
...
...
@@ -35,5 +35,4 @@ DragZoom.prototype.init = function () {
this
.
element
.
call
(
this
.
zoom
).
on
(
'
dblclick.zoom
'
,
null
)
}
export
default
new
DragZoom
()
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js
浏览文件 @
689bb5a2
...
...
@@ -24,7 +24,6 @@ import { jsPlumb } from 'jsplumb'
import
DragZoom
from
'
./dragZoom
'
import
store
from
'
@/conf/home/store
'
import
router
from
'
@/conf/home/router
'
import
Permissions
from
'
@/module/permissions
'
import
{
uuid
,
findComponentDownward
}
from
'
@/module/util/
'
import
{
...
...
@@ -32,10 +31,11 @@ import {
rtTasksTpl
,
setSvgColor
,
saveTargetarr
,
rtTargetarrArr
}
from
'
./util
'
rtTargetarrArr
}
from
'
./util
'
import
mStart
from
'
@/conf/home/pages/projects/pages/definition/pages/list/_source/start
'
le
t
JSP
=
function
()
{
cons
t
JSP
=
function
()
{
this
.
dag
=
{}
this
.
selectedElement
=
{}
...
...
@@ -75,7 +75,7 @@ JSP.prototype.init = function ({ dag, instance, options }) {
this
.
setConfig
({
isDrag
:
!
store
.
state
.
dag
.
isDetails
,
isAttachment
:
false
,
isNewNodes
:
!
store
.
state
.
dag
.
isDetails
,
//
Permissions.getAuth() === false ? false : !store.state.dag.isDetails,
isNewNodes
:
!
store
.
state
.
dag
.
isDetails
,
//
Permissions.getAuth() === false ? false : !store.state.dag.isDetails,
isDblclick
:
true
,
isContextmenu
:
true
,
isClick
:
false
...
...
@@ -105,7 +105,7 @@ JSP.prototype.setConfig = function (o) {
* Node binding event
*/
JSP
.
prototype
.
tasksEvent
=
function
(
selfId
)
{
le
t
tasks
=
$
(
`#
${
selfId
}
`
)
cons
t
tasks
=
$
(
`#
${
selfId
}
`
)
// Bind right event
tasks
.
on
(
'
contextmenu
'
,
e
=>
{
this
.
tasksContextmenu
(
e
)
...
...
@@ -129,7 +129,7 @@ JSP.prototype.tasksEvent = function (selfId) {
JSP
.
prototype
.
draggable
=
function
()
{
if
(
this
.
config
.
isNewNodes
)
{
let
selfId
le
t
self
=
this
cons
t
self
=
this
$
(
'
.toolbar-btn .roundedRect
'
).
draggable
({
scope
:
'
plant
'
,
helper
:
'
clone
'
,
...
...
@@ -146,7 +146,7 @@ JSP.prototype.draggable = function () {
drop
:
function
(
ev
,
ui
)
{
let
id
=
'
tasks-
'
+
Math
.
ceil
(
Math
.
random
()
*
100000
)
// eslint-disable-line
// Get mouse coordinates
le
t
left
=
parseInt
(
ui
.
offset
.
left
-
$
(
this
).
offset
().
left
)
cons
t
left
=
parseInt
(
ui
.
offset
.
left
-
$
(
this
).
offset
().
left
)
let
top
=
parseInt
(
ui
.
offset
.
top
-
$
(
this
).
offset
().
top
)
-
10
if
(
top
<
25
)
{
top
=
25
...
...
@@ -162,7 +162,7 @@ JSP.prototype.draggable = function () {
}))
// Get the generated node
le
t
thisDom
=
jsPlumb
.
getSelector
(
'
.statemachine-demo .w
'
)
cons
t
thisDom
=
jsPlumb
.
getSelector
(
'
.statemachine-demo .w
'
)
// Generating a connection node
self
.
JspInstance
.
batch
(()
=>
{
...
...
@@ -193,13 +193,13 @@ JSP.prototype.jsonHandle = function ({ largeJson, locations }) {
$
(
'
#canvas
'
).
append
(
rtTasksTpl
({
id
:
v
.
id
,
name
:
v
.
name
,
x
:
locations
[
v
.
id
]
[
'
x
'
]
,
y
:
locations
[
v
.
id
]
[
'
y
'
]
,
targetarr
:
locations
[
v
.
id
]
[
'
targetarr
'
]
,
x
:
locations
[
v
.
id
]
.
x
,
y
:
locations
[
v
.
id
]
.
y
,
targetarr
:
locations
[
v
.
id
]
.
targetarr
,
isAttachment
:
this
.
config
.
isAttachment
,
taskType
:
v
.
type
,
runFlag
:
v
.
runFlag
,
nodenumber
:
locations
[
v
.
id
]
[
'
nodenumber
'
],
nodenumber
:
locations
[
v
.
id
]
.
nodenumber
}))
// contextmenu event
...
...
@@ -263,29 +263,29 @@ JSP.prototype.initNode = function (el) {
*/
JSP
.
prototype
.
tasksContextmenu
=
function
(
event
)
{
if
(
this
.
config
.
isContextmenu
)
{
le
t
routerName
=
router
.
history
.
current
.
name
cons
t
routerName
=
router
.
history
.
current
.
name
// state
le
t
isOne
=
routerName
===
'
projects-definition-details
'
&&
this
.
dag
.
releaseState
!==
'
NOT_RELEASE
'
cons
t
isOne
=
routerName
===
'
projects-definition-details
'
&&
this
.
dag
.
releaseState
!==
'
NOT_RELEASE
'
// hide
le
t
isTwo
=
store
.
state
.
dag
.
isDetails
cons
t
isTwo
=
store
.
state
.
dag
.
isDetails
le
t
html
=
[
cons
t
html
=
[
`<a href="javascript:" id="startRunning" class="
${
isOne
?
''
:
'
disbled
'
}
"><em class="ans-icon-play"></em><span>
${
i18n
.
$t
(
'
Start
'
)}
</span></a>`
,
`<a href="javascript:" id="editNodes" class="
${
isTwo
?
'
disbled
'
:
''
}
"><em class="ans-icon-edit"></em><span>
${
i18n
.
$t
(
'
Edit
'
)}
</span></a>`
,
`<a href="javascript:" id="copyNodes" class="
${
isTwo
?
'
disbled
'
:
''
}
"><em class="ans-icon-copy"></em><span>
${
i18n
.
$t
(
'
Copy
'
)}
</span></a>`
,
`<a href="javascript:" id="removeNodes" class="
${
isTwo
?
'
disbled
'
:
''
}
"><em class="ans-icon-trash"></em><span>
${
i18n
.
$t
(
'
Delete
'
)}
</span></a>`
]
le
t
operationHtml
=
()
=>
{
cons
t
operationHtml
=
()
=>
{
return
html
.
splice
(
'
,
'
)
}
le
t
e
=
event
le
t
$id
=
e
.
currentTarget
.
id
le
t
$contextmenu
=
$
(
'
#contextmenu
'
)
le
t
$name
=
$
(
`#
${
$id
}
`
).
find
(
'
.name-p
'
).
text
()
le
t
$left
=
e
.
pageX
+
document
.
body
.
scrollLeft
-
5
le
t
$top
=
e
.
pageY
+
document
.
body
.
scrollTop
-
5
cons
t
e
=
event
cons
t
$id
=
e
.
currentTarget
.
id
cons
t
$contextmenu
=
$
(
'
#contextmenu
'
)
cons
t
$name
=
$
(
`#
${
$id
}
`
).
find
(
'
.name-p
'
).
text
()
cons
t
$left
=
e
.
pageX
+
document
.
body
.
scrollLeft
-
5
cons
t
$top
=
e
.
pageY
+
document
.
body
.
scrollTop
-
5
$contextmenu
.
css
({
left
:
$left
,
top
:
$top
,
...
...
@@ -297,10 +297,10 @@ JSP.prototype.tasksContextmenu = function (event) {
if
(
isOne
)
{
// start run
$
(
'
#startRunning
'
).
on
(
'
click
'
,
()
=>
{
le
t
name
=
store
.
state
.
dag
.
name
le
t
id
=
router
.
history
.
current
.
params
.
id
cons
t
name
=
store
.
state
.
dag
.
name
cons
t
id
=
router
.
history
.
current
.
params
.
id
store
.
dispatch
(
'
dag/getStartCheck
'
,
{
processDefinitionId
:
id
}).
then
(
res
=>
{
le
t
modal
=
Vue
.
$modal
.
dialog
({
cons
t
modal
=
Vue
.
$modal
.
dialog
({
closable
:
false
,
showMask
:
true
,
escClose
:
true
,
...
...
@@ -332,9 +332,9 @@ JSP.prototype.tasksContextmenu = function (event) {
})
})
}
if
(
!
isTwo
)
{
if
(
!
isTwo
)
{
// edit node
$
(
`#editNodes`
).
click
(
ev
=>
{
$
(
'
#editNodes
'
).
click
(
ev
=>
{
findComponentDownward
(
this
.
dag
.
$root
,
'
dag-chart
'
).
_createNodes
({
id
:
$id
,
type
:
$
(
`#
${
$id
}
`
).
attr
(
'
data-tasks-type
'
)
...
...
@@ -359,7 +359,7 @@ JSP.prototype.tasksContextmenu = function (event) {
JSP
.
prototype
.
tasksDblclick
=
function
(
e
)
{
// Untie event
if
(
this
.
config
.
isDblclick
)
{
le
t
id
=
$
(
e
.
currentTarget
.
offsetParent
).
attr
(
'
id
'
)
cons
t
id
=
$
(
e
.
currentTarget
.
offsetParent
).
attr
(
'
id
'
)
findComponentDownward
(
this
.
dag
.
$root
,
'
dag-chart
'
).
_createNodes
({
id
:
id
,
...
...
@@ -373,10 +373,10 @@ JSP.prototype.tasksDblclick = function (e) {
*/
JSP
.
prototype
.
tasksClick
=
function
(
e
)
{
let
$id
le
t
self
=
this
let
$body
=
$
(
`body`
)
cons
t
self
=
this
const
$body
=
$
(
'
body
'
)
if
(
this
.
config
.
isClick
)
{
le
t
$connect
=
this
.
selectedElement
.
connect
cons
t
$connect
=
this
.
selectedElement
.
connect
$
(
'
.w
'
).
removeClass
(
'
jtk-tasks-active
'
)
$
(
e
.
currentTarget
).
addClass
(
'
jtk-tasks-active
'
)
if
(
$connect
)
{
...
...
@@ -406,7 +406,7 @@ JSP.prototype.tasksClick = function (e) {
* paste
*/
JSP
.
prototype
.
removePaste
=
function
()
{
let
$body
=
$
(
`body`
)
const
$body
=
$
(
'
body
'
)
// Unbind copy and paste events
$body
.
unbind
(
'
copy
'
).
unbind
(
'
paste
'
)
// Remove selected node parameters
...
...
@@ -421,7 +421,7 @@ JSP.prototype.removePaste = function () {
JSP
.
prototype
.
connectClick
=
function
(
e
)
{
// Set svg color
setSvgColor
(
e
,
'
#0097e0
'
)
le
t
$id
=
this
.
selectedElement
.
id
cons
t
$id
=
this
.
selectedElement
.
id
if
(
$id
)
{
$
(
`#
${
$id
}
`
).
removeClass
(
'
jtk-tasks-active
'
)
this
.
selectedElement
.
id
=
null
...
...
@@ -434,24 +434,10 @@ JSP.prototype.connectClick = function (e) {
* @param {Pointer}
*/
JSP
.
prototype
.
handleEventPointer
=
function
(
is
)
{
let
wDom
=
$
(
'
.w
'
)
this
.
setConfig
({
isClick
:
is
,
isAttachment
:
false
})
// wDom.removeClass('jtk-ep')
// if (!is) {
// wDom.removeClass('jtk-tasks-active')
// this.selectedElement = {}
// _.map($('#canvas svg'), v => {
// if ($(v).attr('class')) {
// _.map($(v).find('path'), v1 => {
// $(v1).attr('fill', '#555')
// $(v1).attr('stroke', '#555')
// })
// }
// })
// }
}
/**
...
...
@@ -459,7 +445,7 @@ JSP.prototype.handleEventPointer = function (is) {
* @param {Line}
*/
JSP
.
prototype
.
handleEventLine
=
function
(
is
)
{
le
t
wDom
=
$
(
'
.w
'
)
cons
t
wDom
=
$
(
'
.w
'
)
this
.
setConfig
({
isAttachment
:
is
})
...
...
@@ -471,8 +457,8 @@ JSP.prototype.handleEventLine = function (is) {
* @param {Remove}
*/
JSP
.
prototype
.
handleEventRemove
=
function
()
{
le
t
$id
=
this
.
selectedElement
.
id
||
null
le
t
$connect
=
this
.
selectedElement
.
connect
||
null
cons
t
$id
=
this
.
selectedElement
.
id
||
null
cons
t
$connect
=
this
.
selectedElement
.
connect
||
null
if
(
$id
)
{
this
.
removeNodes
(
this
.
selectedElement
.
id
)
}
else
{
...
...
@@ -489,9 +475,9 @@ JSP.prototype.handleEventRemove = function () {
JSP
.
prototype
.
removeNodes
=
function
(
$id
)
{
// Delete node processing(data-targetarr)
_
.
map
(
tasksAll
(),
v
=>
{
le
t
targetarr
=
v
.
targetarr
.
split
(
'
,
'
)
cons
t
targetarr
=
v
.
targetarr
.
split
(
'
,
'
)
if
(
targetarr
.
length
)
{
le
t
newArr
=
_
.
filter
(
targetarr
,
v1
=>
v1
!==
$id
)
cons
t
newArr
=
_
.
filter
(
targetarr
,
v1
=>
v1
!==
$id
)
$
(
`#
${
v
.
id
}
`
).
attr
(
'
data-targetarr
'
,
newArr
.
toString
())
}
})
...
...
@@ -502,7 +488,7 @@ JSP.prototype.removeNodes = function ($id) {
$
(
`#
${
$id
}
`
).
remove
()
// callback onRemoveNodes event
this
.
options
&&
this
.
options
.
onRemoveNodes
&&
this
.
options
.
onRemoveNodes
(
$id
)
this
.
options
&&
this
.
options
.
onRemoveNodes
&&
this
.
options
.
onRemoveNodes
(
$id
)
}
/**
...
...
@@ -513,15 +499,15 @@ JSP.prototype.removeConnect = function ($connect) {
return
}
// Remove connections and remove node and node dependencies
le
t
targetId
=
$connect
.
targetId
le
t
sourceId
=
$connect
.
sourceId
cons
t
targetId
=
$connect
.
targetId
cons
t
sourceId
=
$connect
.
sourceId
let
targetarr
=
rtTargetarrArr
(
targetId
)
if
(
targetarr
.
length
)
{
targetarr
=
_
.
filter
(
targetarr
,
v
=>
v
!==
sourceId
)
$
(
`#
${
targetId
}
`
).
attr
(
'
data-targetarr
'
,
targetarr
.
toString
())
}
if
(
$
(
`#
${
sourceId
}
`
).
attr
(
'
data-tasks-type
'
)
==
'
CONDITIONS
'
)
{
$
(
`#
${
sourceId
}
`
).
attr
(
'
data-nodenumber
'
,
Number
(
$
(
`#
${
sourceId
}
`
).
attr
(
'
data-nodenumber
'
))
-
1
)
if
(
$
(
`#
${
sourceId
}
`
).
attr
(
'
data-tasks-type
'
)
===
'
CONDITIONS
'
)
{
$
(
`#
${
sourceId
}
`
).
attr
(
'
data-nodenumber
'
,
Number
(
$
(
`#
${
sourceId
}
`
).
attr
(
'
data-nodenumber
'
))
-
1
)
}
this
.
JspInstance
.
deleteConnection
(
$connect
)
...
...
@@ -533,24 +519,24 @@ JSP.prototype.removeConnect = function ($connect) {
*/
JSP
.
prototype
.
copyNodes
=
function
(
$id
)
{
let
newNodeInfo
=
_
.
cloneDeep
(
_
.
find
(
store
.
state
.
dag
.
tasks
,
v
=>
v
.
id
===
$id
))
le
t
newNodePors
=
store
.
state
.
dag
.
locations
[
$id
]
cons
t
newNodePors
=
store
.
state
.
dag
.
locations
[
$id
]
// Unstored nodes do not allow replication
if
(
!
newNodePors
)
{
return
}
// Generate random id
le
t
newUuId
=
`
${
uuid
()
+
uuid
()}
`
le
t
id
=
newNodeInfo
.
id
.
length
>
8
?
newNodeInfo
.
id
.
substr
(
0
,
7
)
:
newNodeInfo
.
id
le
t
name
=
newNodeInfo
.
name
.
length
>
8
?
newNodeInfo
.
name
.
substr
(
0
,
7
)
:
newNodeInfo
.
name
cons
t
newUuId
=
`
${
uuid
()
+
uuid
()}
`
cons
t
id
=
newNodeInfo
.
id
.
length
>
8
?
newNodeInfo
.
id
.
substr
(
0
,
7
)
:
newNodeInfo
.
id
cons
t
name
=
newNodeInfo
.
name
.
length
>
8
?
newNodeInfo
.
name
.
substr
(
0
,
7
)
:
newNodeInfo
.
name
// new id
le
t
newId
=
`
${
id
||
''
}
-
${
newUuId
}
`
cons
t
newId
=
`
${
id
||
''
}
-
${
newUuId
}
`
// new name
le
t
newName
=
`
${
name
||
''
}
-
${
newUuId
}
`
cons
t
newName
=
`
${
name
||
''
}
-
${
newUuId
}
`
// coordinate x
le
t
newX
=
newNodePors
.
x
+
100
cons
t
newX
=
newNodePors
.
x
+
100
// coordinate y
le
t
newY
=
newNodePors
.
y
+
40
cons
t
newY
=
newNodePors
.
y
+
40
// Generate template node
$
(
'
#canvas
'
).
append
(
rtTasksTpl
({
...
...
@@ -563,7 +549,7 @@ JSP.prototype.copyNodes = function ($id) {
}))
// Get the generated node
le
t
thisDom
=
jsPlumb
.
getSelector
(
'
.statemachine-demo .w
'
)
cons
t
thisDom
=
jsPlumb
.
getSelector
(
'
.statemachine-demo .w
'
)
// Copy node information
newNodeInfo
=
Object
.
assign
(
newNodeInfo
,
{
...
...
@@ -604,7 +590,7 @@ JSP.prototype.handleEventScreen = function ({ item, is }) {
item
.
icon
=
'
ans-icon-max
'
screenOpen
=
false
}
le
t
$mainLayoutModel
=
$
(
'
.main-layout-model
'
)
cons
t
$mainLayoutModel
=
$
(
'
.main-layout-model
'
)
if
(
screenOpen
)
{
$mainLayoutModel
.
addClass
(
'
dag-screen
'
)
}
else
{
...
...
@@ -619,21 +605,21 @@ JSP.prototype.handleEventScreen = function ({ item, is }) {
*/
JSP
.
prototype
.
saveStore
=
function
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
le
t
connects
=
[]
le
t
locations
=
{}
le
t
tasks
=
[]
cons
t
connects
=
[]
cons
t
locations
=
{}
cons
t
tasks
=
[]
le
t
is
=
(
id
)
=>
{
cons
t
is
=
(
id
)
=>
{
return
!!
_
.
filter
(
tasksAll
(),
v
=>
v
.
id
===
id
).
length
}
// task
_
.
map
(
_
.
cloneDeep
(
store
.
state
.
dag
.
tasks
),
v
=>
{
if
(
is
(
v
.
id
))
{
le
t
preTasks
=
[]
le
t
id
=
$
(
`#
${
v
.
id
}
`
)
le
t
tar
=
id
.
attr
(
'
data-targetarr
'
)
le
t
idDep
=
tar
?
id
.
attr
(
'
data-targetarr
'
).
split
(
'
,
'
)
:
[]
cons
t
preTasks
=
[]
cons
t
id
=
$
(
`#
${
v
.
id
}
`
)
cons
t
tar
=
id
.
attr
(
'
data-targetarr
'
)
cons
t
idDep
=
tar
?
id
.
attr
(
'
data-targetarr
'
).
split
(
'
,
'
)
:
[]
if
(
idDep
.
length
)
{
_
.
map
(
idDep
,
v1
=>
{
preTasks
.
push
(
$
(
`#
${
v1
}
`
).
find
(
'
.name-p
'
).
text
())
...
...
@@ -655,12 +641,11 @@ JSP.prototype.saveStore = function () {
_
.
map
(
this
.
JspInstance
.
getConnections
(),
v
=>
{
connects
.
push
({
'
endPointSourceId
'
:
v
.
sourceId
,
'
endPointTargetId
'
:
v
.
targetId
endPointSourceId
:
v
.
sourceId
,
endPointTargetId
:
v
.
targetId
})
})
_
.
map
(
tasksAll
(),
v
=>
{
locations
[
v
.
id
]
=
{
name
:
v
.
name
,
...
...
@@ -671,7 +656,6 @@ JSP.prototype.saveStore = function () {
}
})
// Storage node
store
.
commit
(
'
dag/setTasks
'
,
tasks
)
// Store coordinate information
...
...
@@ -692,14 +676,14 @@ JSP.prototype.saveStore = function () {
JSP
.
prototype
.
handleEvent
=
function
()
{
this
.
JspInstance
.
bind
(
'
beforeDrop
'
,
function
(
info
)
{
let
sourceId
=
info
[
'
sourceId
'
]
// 出
let
targetId
=
info
[
'
targetId
'
]
// 入
const
sourceId
=
info
.
sourceId
// 出
const
targetId
=
info
.
targetId
// 入
/**
* Recursive search for nodes
*/
let
recursiveVal
const
recursiveTargetarr
=
(
arr
,
targetId
)
=>
{
for
(
le
t
i
in
arr
)
{
for
(
cons
t
i
in
arr
)
{
if
(
arr
[
i
]
===
targetId
)
{
recursiveVal
=
targetId
}
else
{
...
...
@@ -719,10 +703,10 @@ JSP.prototype.handleEvent = function () {
return
false
}
if
(
$
(
`#
${
sourceId
}
`
).
attr
(
'
data-tasks-type
'
)
==
'
CONDITIONS
'
&&
$
(
`#
${
sourceId
}
`
).
attr
(
'
data-nodenumber
'
)
==
2
)
{
if
(
$
(
`#
${
sourceId
}
`
).
attr
(
'
data-tasks-type
'
)
===
'
CONDITIONS
'
&&
$
(
`#
${
sourceId
}
`
).
attr
(
'
data-nodenumber
'
)
===
2
)
{
return
false
}
else
{
$
(
`#
${
sourceId
}
`
).
attr
(
'
data-nodenumber
'
,
Number
(
$
(
`#
${
sourceId
}
`
).
attr
(
'
data-nodenumber
'
))
+
1
)
$
(
`#
${
sourceId
}
`
).
attr
(
'
data-nodenumber
'
,
Number
(
$
(
`#
${
sourceId
}
`
).
attr
(
'
data-nodenumber
'
))
+
1
)
}
// Storage node dependency information
...
...
@@ -744,7 +728,7 @@ JSP.prototype.jspBackfill = function ({ connects, locations, largeJson }) {
locations
:
locations
})
le
t
wNodes
=
jsPlumb
.
getSelector
(
'
.statemachine-demo .w
'
)
cons
t
wNodes
=
jsPlumb
.
getSelector
(
'
.statemachine-demo .w
'
)
// Backfill line
this
.
JspInstance
.
batch
(()
=>
{
...
...
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/util.js
浏览文件 @
689bb5a2
...
...
@@ -23,7 +23,7 @@ import store from '@/conf/home/store'
* Node, to array
*/
const
rtTargetarrArr
=
(
id
)
=>
{
le
t
ids
=
$
(
`#
${
id
}
`
).
attr
(
'
data-targetarr
'
)
cons
t
ids
=
$
(
`#
${
id
}
`
).
attr
(
'
data-targetarr
'
)
return
ids
?
ids
.
split
(
'
,
'
)
:
[]
}
...
...
@@ -31,8 +31,8 @@ const rtTargetarrArr = (id) => {
* Store node id to targetarr
*/
const
saveTargetarr
=
(
valId
,
domId
)
=>
{
le
t
$target
=
$
(
`#
${
domId
}
`
)
le
t
targetStr
=
$target
.
attr
(
'
data-targetarr
'
)
?
$target
.
attr
(
'
data-targetarr
'
)
+
`,
${
valId
}
`
:
`
${
valId
}
`
cons
t
$target
=
$
(
`#
${
domId
}
`
)
cons
t
targetStr
=
$target
.
attr
(
'
data-targetarr
'
)
?
$target
.
attr
(
'
data-targetarr
'
)
+
`,
${
valId
}
`
:
`
${
valId
}
`
$target
.
attr
(
'
data-targetarr
'
,
targetStr
)
}
...
...
@@ -44,20 +44,20 @@ const rtBantpl = () => {
* return node html
*/
const
rtTasksTpl
=
({
id
,
name
,
x
,
y
,
targetarr
,
isAttachment
,
taskType
,
runFlag
,
nodenumber
})
=>
{
let
tpl
=
``
let
tpl
=
''
tpl
+=
`<div class="w jtk-draggable jtk-droppable jtk-endpoint-anchor jtk-connected
${
isAttachment
?
'
jtk-ep
'
:
''
}
" data-targetarr="
${
targetarr
||
''
}
" data-nodenumber="
${
nodenumber
||
0
}
" data-tasks-type="
${
taskType
}
" id="
${
id
}
" style="left:
${
x
}
px; top:
${
y
}
px;">`
tpl
+=
`<div>`
tpl
+=
`<div class="state-p"></div>`
tpl
+=
'
<div>
'
tpl
+=
'
<div class="state-p"></div>
'
tpl
+=
`<div class="icos icos-
${
taskType
}
"></div>`
tpl
+=
`<span class="name-p">
${
name
}
</span>`
tpl
+=
`</div>`
tpl
+=
`<div class="ep"></div>`
tpl
+=
`<div class="ban-p">`
tpl
+=
'
</div>
'
tpl
+=
'
<div class="ep"></div>
'
tpl
+=
'
<div class="ban-p">
'
if
(
runFlag
===
'
FORBIDDEN
'
)
{
tpl
+=
rtBantpl
()
}
tpl
+=
`</div>`
tpl
+=
`</div>`
tpl
+=
'
</div>
'
tpl
+=
'
</div>
'
return
tpl
}
...
...
@@ -66,9 +66,9 @@ const rtTasksTpl = ({ id, name, x, y, targetarr, isAttachment, taskType, runFlag
* Get all tasks nodes
*/
const
tasksAll
=
()
=>
{
le
t
a
=
[]
cons
t
a
=
[]
$
(
'
#canvas .w
'
).
each
(
function
(
idx
,
elem
)
{
le
t
e
=
$
(
elem
)
cons
t
e
=
$
(
elem
)
a
.
push
({
id
:
e
.
attr
(
'
id
'
),
name
:
e
.
find
(
'
.name-p
'
).
text
(),
...
...
@@ -117,10 +117,10 @@ const setSvgColor = (e, color) => {
* Get all node ids
*/
const
allNodesId
=
()
=>
{
le
t
idArr
=
[]
cons
t
idArr
=
[]
$
(
'
.w
'
).
each
((
i
,
o
)
=>
{
le
t
$obj
=
$
(
o
)
le
t
$span
=
$obj
.
find
(
'
.name-p
'
).
text
()
cons
t
$obj
=
$
(
o
)
cons
t
$span
=
$obj
.
find
(
'
.name-p
'
).
text
()
if
(
$span
)
{
idArr
.
push
({
id
:
$obj
.
attr
(
'
id
'
),
...
...
dolphinscheduler-ui/src/js/conf/home/pages/monitor/pages/servers/_source/gaugeOption.js
浏览文件 @
689bb5a2
...
...
@@ -30,21 +30,21 @@ export default function (value) {
color
:
[
[
0.5
,
new
echarts
.
graphic
.
LinearGradient
(
0
,
0
,
1
,
0
,
[{
// eslint-disable-line
offset
:
1
,
color
:
'
#1CAD52
'
// 50% Color in place
color
:
'
#1CAD52
'
// 50% Color in place
},
{
offset
:
0.8
,
color
:
'
#1CAD52
'
// 40% Color in place
}],
false
)
],
// 100% Color in place
color
:
'
#1CAD52
'
// 40% Color in place
}],
false
)],
// 100% Color in place
[
0.7
,
new
echarts
.
graphic
.
LinearGradient
(
0
,
0
,
1
,
0
,
[{
// eslint-disable-line
offset
:
1
,
color
:
'
#FFC539
'
// 70% Color in place
color
:
'
#FFC539
'
// 70% Color in place
},
{
offset
:
0.8
,
color
:
'
#FEEC49
'
// 66% Color in place
color
:
'
#FEEC49
'
// 66% Color in place
},
{
offset
:
0
,
color
:
'
#C7DD6B
'
// 50% Color in place
}],
false
)
],
color
:
'
#C7DD6B
'
// 50% Color in place
}],
false
)],
[
0.9
,
new
echarts
.
graphic
.
LinearGradient
(
0
,
0
,
0
,
1
,
[{
// eslint-disable-line
offset
:
1
,
color
:
'
#E75F25
'
// 90% Color in place
...
...
@@ -54,14 +54,14 @@ export default function (value) {
},
{
offset
:
0
,
color
:
'
#FFC539
'
// 70% Color in place
}],
false
)
],
}],
false
)],
[
1
,
new
echarts
.
graphic
.
LinearGradient
(
0
,
0
,
0
,
1
,
[
{
// eslint-disable-line
offset
:
0.2
,
color
:
'
#E75F25
'
// 92% Color in place
},
{
offset
:
0
,
color
:
'
#D9452C
'
// 90% Color in place
}],
false
)
]
}],
false
)]
],
width
:
10
}
...
...
@@ -92,10 +92,10 @@ export default function (value) {
show
:
true
,
lineStyle
:
{
// Property linestyle controls line style
color
:
[
// Dial Color
[
0.5
,
'
#20AE51
'
],
// 0-50%Color in place
[
0.7
,
'
#FFED44
'
],
// 51%-70%Color in place
[
0.9
,
'
#FF9618
'
],
// 70%-90%Color in place
[
1
,
'
#DA462C
'
]
// 90%-100%Color in place
[
0.5
,
'
#20AE51
'
],
// 0-50%Color in place
[
0.7
,
'
#FFED44
'
],
// 51%-70%Color in place
[
0.9
,
'
#FF9618
'
],
// 70%-90%Color in place
[
1
,
'
#DA462C
'
]
// 90%-100%Color in place
],
width
:
30
// Dial width
}
...
...
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/_source/instanceConditions/common.js
浏览文件 @
689bb5a2
...
...
@@ -20,7 +20,7 @@ import i18n from '@/module/i18n'
/**
* State code table
*/
le
t
stateType
=
[
cons
t
stateType
=
[
{
code
:
''
,
label
:
`
${
i18n
.
$t
(
'
none
'
)}
`
...
...
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/util.js
浏览文件 @
689bb5a2
...
...
@@ -17,7 +17,7 @@
import
i18n
from
'
@/module/i18n
'
le
t
warningTypeList
=
[
cons
t
warningTypeList
=
[
{
id
:
'
NONE
'
,
code
:
`
${
i18n
.
$t
(
'
none_1
'
)}
`
...
...
@@ -42,9 +42,9 @@ const isEmial = (val) => {
}
const
fuzzyQuery
=
(
list
,
keyWord
)
=>
{
le
t
len
=
list
.
length
le
t
arr
=
[]
le
t
reg
=
new
RegExp
(
keyWord
)
cons
t
len
=
list
.
length
cons
t
arr
=
[]
cons
t
reg
=
new
RegExp
(
keyWord
)
for
(
let
i
=
0
;
i
<
len
;
i
++
)
{
if
(
list
[
i
].
match
(
reg
))
{
arr
.
push
(
list
[
i
])
...
...
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/tree/_source/tree.js
浏览文件 @
689bb5a2
...
...
@@ -21,7 +21,7 @@ import { tasksType, tasksState } from '@/conf/home/pages/dag/_source/config'
let
self
=
this
le
t
Tree
=
function
()
{
cons
t
Tree
=
function
()
{
self
=
this
this
.
selfTree
=
{}
this
.
tree
=
function
()
{}
...
...
@@ -57,7 +57,7 @@ Tree.prototype.init = function ({ data, limit, selfTree }) {
this
.
duration
=
400
this
.
i
=
0
this
.
tree
=
d3
.
layout
.
tree
().
nodeSize
([
0
,
46
])
le
t
tasks
=
this
.
tree
.
nodes
(
data
)
cons
t
tasks
=
this
.
tree
.
nodes
(
data
)
this
.
diagonal
=
d3
.
svg
.
diagonal
()
...
...
@@ -142,9 +142,9 @@ Tree.prototype.treeToggles = function (clicked_d) { // eslint-disable-line
*/
Tree
.
prototype
.
treeUpdate
=
function
(
source
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
le
t
tasks
=
this
.
tree
.
nodes
(
this
.
root
)
le
t
height
=
Math
.
max
(
500
,
tasks
.
length
*
this
.
config
.
barHeight
+
this
.
config
.
margin
.
top
+
this
.
config
.
margin
.
bottom
)
le
t
width
=
(
this
.
config
.
nodesMax
*
70
)
+
(
this
.
squareNum
*
(
this
.
config
.
squareSize
+
this
.
config
.
squarePading
))
+
this
.
config
.
margin
.
left
+
this
.
config
.
margin
.
right
+
50
cons
t
tasks
=
this
.
tree
.
nodes
(
this
.
root
)
cons
t
height
=
Math
.
max
(
500
,
tasks
.
length
*
this
.
config
.
barHeight
+
this
.
config
.
margin
.
top
+
this
.
config
.
margin
.
bottom
)
cons
t
width
=
(
this
.
config
.
nodesMax
*
70
)
+
(
this
.
squareNum
*
(
this
.
config
.
squareSize
+
this
.
config
.
squarePading
))
+
this
.
config
.
margin
.
left
+
this
.
config
.
margin
.
right
+
50
d3
.
select
(
'
svg
'
)
.
transition
()
...
...
@@ -156,12 +156,12 @@ Tree.prototype.treeUpdate = function (source) {
n
.
x
=
i
*
this
.
config
.
barHeight
})
le
t
task
=
this
.
svg
.
selectAll
(
'
g.node
'
)
cons
t
task
=
this
.
svg
.
selectAll
(
'
g.node
'
)
.
data
(
tasks
,
(
d
)
=>
{
return
d
.
id
||
(
d
.
id
=
++
this
.
i
)
})
le
t
nodeEnter
=
task
.
enter
()
cons
t
nodeEnter
=
task
.
enter
()
.
append
(
'
g
'
)
.
attr
(
'
class
'
,
this
.
nodesClass
)
.
attr
(
'
transform
'
,
()
=>
'
translate(
'
+
source
.
y0
+
'
,
'
+
source
.
x0
+
'
)
'
)
...
...
@@ -201,7 +201,7 @@ Tree.prototype.treeUpdate = function (source) {
}
})
.
attr
(
'
class
'
,
'
state
'
)
.
style
(
'
fill
'
,
d
=>
d
.
state
&&
tasksState
[
d
.
state
].
color
||
'
#ffffff
'
)
.
style
(
'
fill
'
,
d
=>
(
d
.
state
&&
tasksState
[
d
.
state
].
color
)
||
'
#ffffff
'
)
.
attr
(
'
data-toggle
'
,
'
tooltip
'
)
.
attr
(
'
rx
'
,
d
=>
d
.
type
?
0
:
12
)
.
attr
(
'
ry
'
,
d
=>
d
.
type
?
0
:
12
)
...
...
@@ -231,7 +231,6 @@ Tree.prototype.treeUpdate = function (source) {
.
attr
(
'
transform
'
,
d
=>
'
translate(
'
+
d
.
y
+
'
,
'
+
d
.
x
+
'
)
'
)
.
style
(
'
opacity
'
,
1
)
// Convert the exit node to the new location of the parent node。
task
.
exit
().
transition
()
.
duration
(
this
.
duration
)
...
...
@@ -240,14 +239,14 @@ Tree.prototype.treeUpdate = function (source) {
.
remove
()
// Update link
le
t
link
=
this
.
svg
.
selectAll
(
'
path.link
'
)
cons
t
link
=
this
.
svg
.
selectAll
(
'
path.link
'
)
.
data
(
this
.
tree
.
links
(
tasks
),
d
=>
d
.
target
.
id
)
// Enter any new links in the previous location of the parent node。
link
.
enter
().
insert
(
'
path
'
,
'
g
'
)
.
attr
(
'
class
'
,
'
link
'
)
.
attr
(
'
d
'
,
(
d
)
=>
{
le
t
o
=
{
x
:
source
.
x0
,
y
:
source
.
y0
}
cons
t
o
=
{
x
:
source
.
x0
,
y
:
source
.
y0
}
return
this
.
diagonal
({
source
:
o
,
target
:
o
})
})
.
transition
()
...
...
@@ -263,7 +262,7 @@ Tree.prototype.treeUpdate = function (source) {
link
.
exit
().
transition
()
.
duration
(
this
.
duration
)
.
attr
(
'
d
'
,
(
d
)
=>
{
le
t
o
=
{
x
:
source
.
x
,
y
:
source
.
y
}
cons
t
o
=
{
x
:
source
.
x
,
y
:
source
.
y
}
return
this
.
diagonal
({
source
:
o
,
target
:
o
})
})
.
remove
()
...
...
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/tree/_source/util.js
浏览文件 @
689bb5a2
...
...
@@ -22,7 +22,7 @@ import { tasksState } from '@/conf/home/pages/dag/_source/config'
* Node prompt dom
*/
const
rtInstancesTooltip
=
(
data
)
=>
{
let
str
=
`<div style="text-align: left;word-break:break-all">`
let
str
=
'
<div style="text-align: left;word-break:break-all">
'
str
+=
`id :
${
data
.
id
}
</br>`
str
+=
`host :
${
data
.
host
}
</br>`
str
+=
`name :
${
data
.
name
}
</br>`
...
...
@@ -33,7 +33,7 @@ const rtInstancesTooltip = (data) => {
str
+=
`startTime :
${
data
.
startTime
?
formatDate
(
data
.
startTime
)
:
'
-
'
}
</br>`
str
+=
`endTime :
${
data
.
endTime
?
formatDate
(
data
.
endTime
)
:
'
-
'
}
</br>`
str
+=
`duration :
${
data
.
duration
}
</br>`
str
+=
`</div>`
str
+=
'
</div>
'
return
str
}
...
...
@@ -42,7 +42,7 @@ const rtInstancesTooltip = (data) => {
* Easy to calculate the width dynamically
*/
const
rtCountMethod
=
list
=>
{
le
t
arr
=
[]
cons
t
arr
=
[]
function
count
(
list
,
t
)
{
let
toggle
=
false
list
.
forEach
(
v
=>
{
...
...
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/chartConfig.js
浏览文件 @
689bb5a2
...
...
@@ -18,7 +18,7 @@
import
_
from
'
lodash
'
import
{
tasksState
}
from
'
@/conf/home/pages/dag/_source/config
'
le
t
pie
=
{
cons
t
pie
=
{
series
:
[
{
type
:
'
pie
'
,
...
...
@@ -37,7 +37,7 @@ let pie = {
]
}
le
t
bar
=
{
cons
t
bar
=
{
title
:
{
text
:
''
},
...
...
@@ -56,7 +56,7 @@ let bar = {
},
tooltip
:
{
formatter
(
v
)
{
le
t
val
=
v
[
0
].
name
.
split
(
'
,
'
)
cons
t
val
=
v
[
0
].
name
.
split
(
'
,
'
)
return
`
${
val
[
0
]}
(
${
v
[
0
].
value
}
)`
}
},
...
...
@@ -66,7 +66,7 @@ let bar = {
}]
}
le
t
simple
=
{
cons
t
simple
=
{
xAxis
:
{
splitLine
:
{
show
:
false
...
...
@@ -93,7 +93,6 @@ let simple = {
},
color
:
[
'
#D5050B
'
,
'
#0398E1
'
]
}
export
{
pie
,
bar
,
simple
}
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/gantt/_source/gantt.js
浏览文件 @
689bb5a2
...
...
@@ -19,13 +19,13 @@ import * as d3 from 'd3'
import
{
formatDate
}
from
'
@/module/filter/filter
'
import
{
tasksState
}
from
'
@/conf/home/pages/dag/_source/config
'
le
t
Gantt
=
function
()
{
cons
t
Gantt
=
function
()
{
this
.
el
=
''
this
.
tasks
=
[]
this
.
width
=
null
this
.
height
=
null
this
.
taskNames
=
[]
this
.
tickFormat
=
`%H:%M:%S`
this
.
tickFormat
=
'
%H:%M:%S
'
this
.
margin
=
{
top
:
10
,
right
:
40
,
...
...
@@ -41,20 +41,20 @@ Gantt.prototype.init = function ({ el, tasks }) {
this
.
tasks
=
tasks
this
.
taskNames
=
_
.
map
(
_
.
cloneDeep
(
tasks
),
v
=>
v
.
taskName
)
this
.
taskNames
=
this
.
taskNames
.
reduce
(
function
(
prev
,
cur
)
{
prev
.
indexOf
(
cur
)
===
-
1
&&
prev
.
push
(
cur
)
;
return
prev
;
},[])
prev
.
indexOf
(
cur
)
===
-
1
&&
prev
.
push
(
cur
)
return
prev
},
[])
this
.
height
=
parseInt
(
this
.
taskNames
.
length
*
30
)
this
.
width
=
$
(
this
.
el
).
width
()
-
this
.
margin
.
right
-
this
.
margin
.
left
-
5
this
.
x
=
d3
.
time
.
scale
()
.
domain
([
this
.
startTimeXAxis
,
this
.
endTimeXAxis
])
.
range
([
0
,
this
.
width
])
.
domain
([
this
.
startTimeXAxis
,
this
.
endTimeXAxis
])
.
range
([
0
,
this
.
width
])
.
clamp
(
true
)
this
.
y
=
d3
.
scale
.
ordinal
()
.
domain
(
this
.
taskNames
)
.
rangeRoundBands
([
0
,
this
.
height
-
this
.
margin
.
top
-
this
.
margin
.
bottom
],
0.1
)
.
rangeRoundBands
([
0
,
this
.
height
-
this
.
margin
.
top
-
this
.
margin
.
bottom
],
0.1
)
this
.
xAxis
=
d3
.
svg
.
axis
()
.
scale
(
this
.
x
)
...
...
@@ -97,13 +97,13 @@ Gantt.prototype.compXAxisTimes = function () {
*/
Gantt
.
prototype
.
initializeXAxis
=
function
()
{
this
.
x
=
d3
.
time
.
scale
()
.
domain
([
this
.
startTimeXAxis
,
this
.
endTimeXAxis
])
.
range
([
0
,
this
.
width
])
.
domain
([
this
.
startTimeXAxis
,
this
.
endTimeXAxis
])
.
range
([
0
,
this
.
width
])
.
clamp
(
true
)
this
.
y
=
d3
.
scale
.
ordinal
()
.
domain
(
this
.
taskNames
)
.
rangeRoundBands
([
0
,
this
.
height
-
this
.
margin
.
top
-
this
.
margin
.
bottom
],
0.1
)
.
rangeRoundBands
([
0
,
this
.
height
-
this
.
margin
.
top
-
this
.
margin
.
bottom
],
0.1
)
this
.
xAxis
=
d3
.
svg
.
axis
()
.
scale
(
this
.
x
)
...
...
@@ -151,9 +151,9 @@ Gantt.prototype.drawChart = function () {
.
attr
(
'
transform
'
,
'
translate(0,
'
+
(
this
.
height
-
this
.
margin
.
top
-
this
.
margin
.
bottom
)
+
'
)
'
)
.
transition
()
.
call
(
this
.
xAxis
)
.
selectAll
(
"
text
"
)
.
attr
(
"
transform
"
,
`rotate(-
${
this
.
width
/
(
$
(
'
.tick
'
).
length
-
1
)
>
50
?
0
:
Math
.
acos
(
this
.
width
/
(
$
(
'
.tick
'
).
length
-
1
)
/
50
)
*
57
}
)`
)
.
style
(
"
text-anchor
"
,
`
${
this
.
width
/
(
$
(
'
.tick
'
).
length
-
1
)
>
50
?
'
middle
'
:
'
end
'
}
`
)
.
selectAll
(
'
text
'
)
.
attr
(
'
transform
'
,
`rotate(-
${
this
.
width
/
(
$
(
'
.tick
'
).
length
-
1
)
>
50
?
0
:
Math
.
acos
(
this
.
width
/
(
$
(
'
.tick
'
).
length
-
1
)
/
50
)
*
57
}
)`
)
.
style
(
'
text-anchor
'
,
`
${
this
.
width
/
(
$
(
'
.tick
'
).
length
-
1
)
>
50
?
'
middle
'
:
'
end
'
}
`
)
svg
.
append
(
'
g
'
)
.
attr
(
'
class
'
,
'
y axis
'
)
...
...
@@ -169,15 +169,14 @@ Gantt.prototype.drawChart = function () {
* Tip prompt
*/
Gantt
.
prototype
.
tip
=
function
(
d
)
{
let
str
=
`<div style="text-align: left;word-break:break-all">`
let
str
=
'
<div style="text-align: left;word-break:break-all">
'
str
+=
`taskName :
${
d
.
taskName
}
</br>`
str
+=
`status :
${
tasksState
[
d
.
status
].
desc
}
(
${
d
.
status
}
)</br>`
str
+=
`startTime :
${
formatDate
(
d
.
isoStart
)}
</br>`
str
+=
`endTime :
${
formatDate
(
d
.
isoEnd
)}
</br>`
str
+=
`duration :
${
d
.
duration
}
</br>`
str
+=
`</div>`
str
+=
'
</div>
'
return
str
}
export
default
new
Gantt
()
dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/_source/common.js
浏览文件 @
689bb5a2
...
...
@@ -18,6 +18,6 @@
/**
* Create file type
*/
le
t
filtTypeArr
=
[
'
txt
'
,
'
log
'
,
'
sh
'
,
'
conf
'
,
'
cfg
'
,
'
py
'
,
'
java
'
,
'
sql
'
,
'
xml
'
,
'
hql
'
,
'
properties
'
]
cons
t
filtTypeArr
=
[
'
txt
'
,
'
log
'
,
'
sh
'
,
'
conf
'
,
'
cfg
'
,
'
py
'
,
'
java
'
,
'
sql
'
,
'
xml
'
,
'
hql
'
,
'
properties
'
]
export
{
filtTypeArr
}
dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/details/_source/utils.js
浏览文件 @
689bb5a2
...
...
@@ -32,7 +32,6 @@ const handlerSuffix = {
'
.properties
'
:
'
textile
'
}
export
{
handlerSuffix
}
dolphinscheduler-ui/src/js/conf/home/router/index.js
浏览文件 @
689bb5a2
...
...
@@ -426,7 +426,7 @@ const router = new Router({
name
:
'
monitor
'
,
component
:
resolve
=>
require
([
'
../pages/monitor/index
'
],
resolve
),
meta
:
{
title
:
`monitor`
title
:
'
monitor
'
},
redirect
:
{
name
:
'
servers-master
'
...
...
@@ -453,7 +453,7 @@ const router = new Router({
name
:
'
servers-alert
'
,
component
:
resolve
=>
require
([
'
../pages/monitor/pages/servers/alert
'
],
resolve
),
meta
:
{
title
:
`Alert`
title
:
'
Alert
'
}
},
{
...
...
@@ -461,7 +461,7 @@ const router = new Router({
name
:
'
servers-rpcserver
'
,
component
:
resolve
=>
require
([
'
../pages/monitor/pages/servers/rpcserver
'
],
resolve
),
meta
:
{
title
:
`Rpcserver`
title
:
'
Rpcserver
'
}
},
{
...
...
@@ -469,7 +469,7 @@ const router = new Router({
name
:
'
servers-zookeeper
'
,
component
:
resolve
=>
require
([
'
../pages/monitor/pages/servers/zookeeper
'
],
resolve
),
meta
:
{
title
:
`Zookeeper`
title
:
'
Zookeeper
'
}
},
{
...
...
@@ -477,7 +477,7 @@ const router = new Router({
name
:
'
servers-apiserver
'
,
component
:
resolve
=>
require
([
'
../pages/monitor/pages/servers/apiserver
'
],
resolve
),
meta
:
{
title
:
`Apiserver`
title
:
'
Apiserver
'
}
},
{
...
...
@@ -485,7 +485,7 @@ const router = new Router({
name
:
'
servers-db
'
,
component
:
resolve
=>
require
([
'
../pages/monitor/pages/servers/db
'
],
resolve
),
meta
:
{
title
:
`DB`
title
:
'
DB
'
}
},
{
...
...
@@ -493,7 +493,7 @@ const router = new Router({
name
:
'
statistics
'
,
component
:
resolve
=>
require
([
'
../pages/monitor/pages/servers/statistics
'
],
resolve
),
meta
:
{
title
:
`statistics`
title
:
'
statistics
'
}
}
]
...
...
@@ -502,7 +502,7 @@ const router = new Router({
})
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
le
t
$body
=
$
(
'
body
'
)
cons
t
$body
=
$
(
'
body
'
)
$body
.
find
(
'
.tooltip.fade.top.in
'
).
remove
()
if
(
to
.
meta
.
title
)
{
document
.
title
=
`
${
to
.
meta
.
title
}
- DolphinScheduler`
...
...
dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js
浏览文件 @
689bb5a2
...
...
@@ -28,7 +28,7 @@ export default {
io
.
get
(
`projects/
${
state
.
projectName
}
/instance/task-list-by-process-id`
,
{
processInstanceId
:
payload
},
res
=>
{
le
t
arr
=
_
.
map
(
res
.
data
.
taskList
,
v
=>
{
cons
t
arr
=
_
.
map
(
res
.
data
.
taskList
,
v
=>
{
return
_
.
cloneDeep
(
_
.
assign
(
tasksState
[
v
.
state
],
{
name
:
v
.
name
,
stateId
:
v
.
id
,
...
...
@@ -108,7 +108,7 @@ export default {
// locations
state
.
locations
=
JSON
.
parse
(
res
.
data
.
locations
)
// Process definition
le
t
processDefinitionJson
=
JSON
.
parse
(
res
.
data
.
processDefinitionJson
)
cons
t
processDefinitionJson
=
JSON
.
parse
(
res
.
data
.
processDefinitionJson
)
// tasks info
state
.
tasks
=
processDefinitionJson
.
tasks
// tasks cache
...
...
@@ -129,7 +129,7 @@ export default {
})
},
/**
/**
* Get process definition DAG diagram details
*/
copyProcess
({
state
},
payload
)
{
...
...
@@ -161,7 +161,7 @@ export default {
// locations
state
.
locations
=
JSON
.
parse
(
res
.
data
.
locations
)
// process instance
le
t
processInstanceJson
=
JSON
.
parse
(
res
.
data
.
processInstanceJson
)
cons
t
processInstanceJson
=
JSON
.
parse
(
res
.
data
.
processInstanceJson
)
// tasks info
state
.
tasks
=
processInstanceJson
.
tasks
// tasks cache
...
...
@@ -176,7 +176,7 @@ export default {
state
.
tenantId
=
processInstanceJson
.
tenantId
//startup parameters
//
startup parameters
state
.
startup
=
_
.
assign
(
state
.
startup
,
_
.
pick
(
res
.
data
,
[
'
commandType
'
,
'
failureStrategy
'
,
'
processInstancePriority
'
,
'
workerGroup
'
,
'
warningType
'
,
'
warningGroupId
'
,
'
receivers
'
,
'
receiversCc
'
]))
state
.
startup
.
commandParam
=
JSON
.
parse
(
res
.
data
.
commandParam
)
...
...
@@ -191,7 +191,7 @@ export default {
*/
saveDAGchart
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
le
t
data
=
{
cons
t
data
=
{
globalParams
:
state
.
globalParams
,
tasks
:
state
.
tasks
,
tenantId
:
state
.
tenantId
,
...
...
@@ -215,7 +215,7 @@ export default {
*/
updateDefinition
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
le
t
data
=
{
cons
t
data
=
{
globalParams
:
state
.
globalParams
,
tasks
:
state
.
tasks
,
tenantId
:
state
.
tenantId
,
...
...
@@ -240,7 +240,7 @@ export default {
*/
updateInstance
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
le
t
data
=
{
cons
t
data
=
{
globalParams
:
state
.
globalParams
,
tasks
:
state
.
tasks
,
tenantId
:
state
.
tenantId
,
...
...
@@ -294,16 +294,16 @@ export default {
getProjectList
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
state
.
projectListS
.
length
)
{
resolve
()
return
}
io
.
get
(
`projects/query-project-list`
,
payload
,
res
=>
{
state
.
projectListS
=
res
.
data
resolve
(
res
.
data
)
}).
catch
(
res
=>
{
reject
(
res
)
resolve
()
return
}
io
.
get
(
'
projects/query-project-list
'
,
payload
,
res
=>
{
state
.
projectListS
=
res
.
data
resolve
(
res
.
data
)
}).
catch
(
res
=>
{
reject
(
res
)
})
})
})
},
/**
* Get a list of process definitions by project id
...
...
@@ -312,17 +312,17 @@ export default {
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`projects/
${
state
.
projectName
}
/process/queryProcessDefinitionAllByProjectId`
,
payload
,
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
res
=>
{
reject
(
res
)
}).
catch
(
res
=>
{
reject
(
res
)
})
})
})
},
/**
* get datasource
*/
getDatasourceList
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`datasources/list`
,
{
io
.
get
(
'
datasources/list
'
,
{
type
:
payload
},
res
=>
{
resolve
(
res
)
...
...
@@ -340,7 +340,7 @@ export default {
resolve
()
return
}
io
.
get
(
`resources/list`
,
{
io
.
get
(
'
resources/list
'
,
{
type
:
'
FILE
'
},
res
=>
{
state
.
resourcesListS
=
res
.
data
...
...
@@ -359,7 +359,7 @@ export default {
resolve
()
return
}
io
.
get
(
`resources/list/jar`
,
{
io
.
get
(
'
resources/list/jar
'
,
{
type
:
'
FILE
'
},
res
=>
{
state
.
resourcesListJar
=
res
.
data
...
...
@@ -387,7 +387,7 @@ export default {
*/
getNotifyGroupList
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`alert-group/list`
,
res
=>
{
io
.
get
(
'
alert-group/list
'
,
res
=>
{
state
.
notifyGroupListS
=
_
.
map
(
res
.
data
,
v
=>
{
return
{
id
:
v
.
id
,
...
...
@@ -469,7 +469,7 @@ export default {
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`projects/
${
state
.
projectName
}
/schedule/preview`
,
payload
,
res
=>
{
resolve
(
res
.
data
)
//alert(res.data)
//
alert(res.data)
}).
catch
(
e
=>
{
reject
(
e
)
})
...
...
@@ -579,11 +579,11 @@ export default {
if
(
!
data
)
{
return
}
le
t
blob
=
new
Blob
([
data
])
le
t
fileName
=
`
${
fileNameS
}
.json`
cons
t
blob
=
new
Blob
([
data
])
cons
t
fileName
=
`
${
fileNameS
}
.json`
if
(
'
download
'
in
document
.
createElement
(
'
a
'
))
{
// 不是IE浏览器
le
t
url
=
window
.
URL
.
createObjectURL
(
blob
)
le
t
link
=
document
.
createElement
(
'
a
'
)
cons
t
url
=
window
.
URL
.
createObjectURL
(
blob
)
cons
t
link
=
document
.
createElement
(
'
a
'
)
link
.
style
.
display
=
'
none
'
link
.
href
=
url
link
.
setAttribute
(
'
download
'
,
fileName
)
...
...
@@ -596,7 +596,7 @@ export default {
}
}
io
.
get
(
`projects/
${
state
.
projectName
}
/process/export`
,{
processDefinitionIds
:
payload
.
processDefinitionIds
},
res
=>
{
io
.
get
(
`projects/
${
state
.
projectName
}
/process/export`
,
{
processDefinitionIds
:
payload
.
processDefinitionIds
},
res
=>
{
downloadBlob
(
res
,
payload
.
fileName
)
},
e
=>
{
...
...
@@ -622,7 +622,7 @@ export default {
*/
getUdfList
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`resources/udf-func/list`
,
payload
,
res
=>
{
io
.
get
(
'
resources/udf-func/list
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -646,7 +646,7 @@ export default {
*/
getTaskRecordList
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`projects/task-record/list-paging`
,
payload
,
res
=>
{
io
.
get
(
'
projects/task-record/list-paging
'
,
payload
,
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -658,7 +658,7 @@ export default {
*/
getHistoryTaskRecordList
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`projects/task-record/history-list-paging`
,
payload
,
res
=>
{
io
.
get
(
'
projects/task-record/history-list-paging
'
,
payload
,
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -725,7 +725,7 @@ export default {
/**
* remove timing
*/
deleteTiming
({
state
},
payload
)
{
deleteTiming
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`projects/
${
state
.
projectName
}
/schedule/delete`
,
payload
,
res
=>
{
resolve
(
res
)
...
...
@@ -736,11 +736,11 @@ export default {
},
getResourceId
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`resources/queryResource`
,
payload
,
res
=>
{
io
.
get
(
'
resources/queryResource
'
,
payload
,
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
e
=>
{
reject
(
e
)
})
})
}
,
}
}
dolphinscheduler-ui/src/js/conf/home/store/dag/mutations.js
浏览文件 @
689bb5a2
...
...
@@ -100,27 +100,27 @@ export default {
*/
resetParams
(
state
,
payload
)
{
$
(
'
#canvas
'
).
html
(
''
)
state
.
globalParams
=
payload
&&
payload
.
globalParams
||
[]
state
.
tasks
=
payload
&&
payload
.
tasks
||
[]
state
.
name
=
payload
&&
payload
.
name
||
''
state
.
description
=
payload
&&
payload
.
description
||
''
state
.
timeout
=
payload
&&
payload
.
timeout
||
0
state
.
tenantId
=
payload
&&
payload
.
tenantId
||
-
1
state
.
processListS
=
payload
&&
payload
.
processListS
||
[]
state
.
resourcesListS
=
payload
&&
payload
.
resourcesListS
||
[]
state
.
resourcesListJar
=
payload
&&
payload
.
resourcesListJar
||
[]
state
.
projectListS
=
payload
&&
payload
.
projectListS
||
[]
state
.
isDetails
=
payload
&&
payload
.
isDetails
||
false
state
.
runFlag
=
payload
&&
payload
.
runFlag
||
''
state
.
locations
=
payload
&&
payload
.
locations
||
{}
state
.
connects
=
payload
&&
payload
.
connects
||
[]
state
.
globalParams
=
(
payload
&&
payload
.
globalParams
)
||
[]
state
.
tasks
=
(
payload
&&
payload
.
tasks
)
||
[]
state
.
name
=
(
payload
&&
payload
.
name
)
||
''
state
.
description
=
(
payload
&&
payload
.
description
)
||
''
state
.
timeout
=
(
payload
&&
payload
.
timeout
)
||
0
state
.
tenantId
=
(
payload
&&
payload
.
tenantId
)
||
-
1
state
.
processListS
=
(
payload
&&
payload
.
processListS
)
||
[]
state
.
resourcesListS
=
(
payload
&&
payload
.
resourcesListS
)
||
[]
state
.
resourcesListJar
=
(
payload
&&
payload
.
resourcesListJar
)
||
[]
state
.
projectListS
=
(
payload
&&
payload
.
projectListS
)
||
[]
state
.
isDetails
=
(
payload
&&
payload
.
isDetails
)
||
false
state
.
runFlag
=
(
payload
&&
payload
.
runFlag
)
||
''
state
.
locations
=
(
payload
&&
payload
.
locations
)
||
{}
state
.
connects
=
(
payload
&&
payload
.
connects
)
||
[]
},
/**
* add task
* object {}
*/
addTasks
(
state
,
payload
)
{
le
t
i
=
_
.
findIndex
(
state
.
tasks
,
v
=>
v
.
id
===
payload
.
id
)
cons
t
i
=
_
.
findIndex
(
state
.
tasks
,
v
=>
v
.
id
===
payload
.
id
)
if
(
i
!==
-
1
)
{
state
.
tasks
[
i
]
=
Object
.
assign
(
state
.
tasks
[
i
],
{},
payload
)
}
else
{
...
...
@@ -129,9 +129,9 @@ export default {
if
(
state
.
cacheTasks
[
payload
.
id
])
{
state
.
cacheTasks
[
payload
.
id
]
=
Object
.
assign
(
state
.
cacheTasks
[
payload
.
id
],
{},
payload
)
}
else
{
state
.
cacheTasks
[
payload
.
id
]
=
payload
;
state
.
cacheTasks
[
payload
.
id
]
=
payload
}
le
t
dom
=
$
(
`#
${
payload
.
id
}
`
)
cons
t
dom
=
$
(
`#
${
payload
.
id
}
`
)
state
.
locations
[
payload
.
id
]
=
_
.
assign
(
state
.
locations
[
payload
.
id
],
{
name
:
dom
.
find
(
'
.name-p
'
).
text
(),
targetarr
:
dom
.
attr
(
'
data-targetarr
'
),
...
...
@@ -149,7 +149,7 @@ export default {
if
(
state
.
cacheTasks
[
payload
.
id
])
{
state
.
cacheTasks
[
payload
.
id
]
=
Object
.
assign
(
state
.
cacheTasks
[
payload
.
id
],
{},
payload
)
}
else
{
state
.
cacheTasks
[
payload
.
id
]
=
payload
;
state
.
cacheTasks
[
payload
.
id
]
=
payload
}
}
}
dolphinscheduler-ui/src/js/conf/home/store/dag/state.js
浏览文件 @
689bb5a2
...
...
@@ -18,7 +18,7 @@
import
localStore
from
'
@/module/util/localStorage
'
// Get the name of the item currently clicked
le
t
projectName
=
localStore
.
getItem
(
'
projectName
'
)
cons
t
projectName
=
localStore
.
getItem
(
'
projectName
'
)
export
default
{
// name
...
...
@@ -34,7 +34,7 @@ export default {
// Timeout alarm
timeout
:
0
,
// tenant id
tenantId
:
-
1
,
tenantId
:
-
1
,
// Node location information
locations
:
{},
// Node-to-node connection
...
...
dolphinscheduler-ui/src/js/conf/home/store/datasource/actions.js
浏览文件 @
689bb5a2
...
...
@@ -27,7 +27,7 @@ export default {
*/
createDatasources
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`datasources/create`
,
payload
,
res
=>
{
io
.
post
(
'
datasources/create
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -40,7 +40,7 @@ export default {
*/
connectDatasources
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`datasources/connect`
,
payload
,
res
=>
{
io
.
post
(
'
datasources/connect
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -53,7 +53,7 @@ export default {
*/
getDatasourcesList
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`datasources/list`
,
payload
,
res
=>
{
io
.
get
(
'
datasources/list
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -68,7 +68,7 @@ export default {
*/
getDatasourcesListP
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`datasources/list-paging`
,
payload
,
res
=>
{
io
.
get
(
'
datasources/list-paging
'
,
payload
,
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -80,7 +80,7 @@ export default {
*/
deleteDatasource
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`datasources/delete`
,
payload
,
res
=>
{
io
.
get
(
'
datasources/delete
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -92,7 +92,7 @@ export default {
*/
updateDatasource
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`datasources/update`
,
payload
,
res
=>
{
io
.
post
(
'
datasources/update
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -101,7 +101,7 @@ export default {
},
getEditDatasource
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`datasources/update-ui`
,
payload
,
res
=>
{
io
.
post
(
'
datasources/update-ui
'
,
payload
,
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -110,7 +110,7 @@ export default {
},
verifyName
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`datasources/verify-name`
,
payload
,
res
=>
{
io
.
get
(
'
datasources/verify-name
'
,
payload
,
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -119,7 +119,7 @@ export default {
},
getKerberosStartupState
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`datasources/kerberos-startup-state`
,
payload
,
res
=>
{
io
.
get
(
'
datasources/kerberos-startup-state
'
,
payload
,
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
dolphinscheduler-ui/src/js/conf/home/store/monitor/actions.js
浏览文件 @
689bb5a2
...
...
@@ -20,7 +20,7 @@ import io from '@/module/io'
export
default
{
getMasterData
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`monitor/master/list`
,
payload
,
res
=>
{
io
.
get
(
'
monitor/master/list
'
,
payload
,
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -29,7 +29,7 @@ export default {
},
getWorkerData
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`monitor/worker/list`
,
payload
,
res
=>
{
io
.
get
(
'
monitor/worker/list
'
,
payload
,
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -38,7 +38,7 @@ export default {
},
getDatabaseData
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`monitor/database`
,
payload
,
res
=>
{
io
.
get
(
'
monitor/database
'
,
payload
,
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -47,7 +47,7 @@ export default {
},
getZookeeperData
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`monitor/zookeeper/list`
,
payload
,
res
=>
{
io
.
get
(
'
monitor/zookeeper/list
'
,
payload
,
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
dolphinscheduler-ui/src/js/conf/home/store/projects/actions.js
浏览文件 @
689bb5a2
...
...
@@ -23,7 +23,7 @@ export default {
*/
getProjectsList
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`projects/list-paging`
,
payload
,
res
=>
{
io
.
get
(
'
projects/list-paging
'
,
payload
,
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -35,7 +35,7 @@ export default {
*/
createProjects
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`projects/create`
,
payload
,
res
=>
{
io
.
post
(
'
projects/create
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -47,7 +47,7 @@ export default {
*/
deleteProjects
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`projects/delete`
,
payload
,
res
=>
{
io
.
get
(
'
projects/delete
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -59,7 +59,7 @@ export default {
*/
updateProjects
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`projects/update`
,
payload
,
res
=>
{
io
.
post
(
'
projects/update
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -71,7 +71,7 @@ export default {
*/
getTaskCtatusCount
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`projects/analysis/task-state-count`
,
payload
,
res
=>
{
io
.
get
(
'
projects/analysis/task-state-count
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -83,7 +83,7 @@ export default {
*/
getCommandStateCount
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`projects/analysis/command-state-count`
,
payload
,
res
=>
{
io
.
get
(
'
projects/analysis/command-state-count
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -95,7 +95,7 @@ export default {
*/
getQueueCount
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`projects/analysis/queue-count`
,
payload
,
res
=>
{
io
.
get
(
'
projects/analysis/queue-count
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -107,7 +107,7 @@ export default {
*/
getProcessStateCount
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`projects/analysis/process-state-count`
,
payload
,
res
=>
{
io
.
get
(
'
projects/analysis/process-state-count
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -119,7 +119,7 @@ export default {
*/
getDefineUserCount
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`projects/analysis/define-user-count`
,
payload
,
res
=>
{
io
.
get
(
'
projects/analysis/define-user-count
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
dolphinscheduler-ui/src/js/conf/home/store/resource/actions.js
浏览文件 @
689bb5a2
...
...
@@ -23,7 +23,7 @@ export default {
*/
getResourcesListP
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`resources/list-paging`
,
payload
,
res
=>
{
io
.
get
(
'
resources/list-paging
'
,
payload
,
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -32,7 +32,7 @@ export default {
},
getResourceId
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`resources/queryResource`
,
payload
,
res
=>
{
io
.
get
(
'
resources/queryResource
'
,
payload
,
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -41,7 +41,7 @@ export default {
},
getResourcesList
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`resources/list`
,
payload
,
res
=>
{
io
.
get
(
'
resources/list
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
res
=>
{
reject
(
res
)
...
...
@@ -53,7 +53,7 @@ export default {
*/
deleteResource
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`resources/delete`
,
payload
,
res
=>
{
io
.
get
(
'
resources/delete
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -65,7 +65,7 @@ export default {
*/
resourceVerifyName
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`resources/verify-name`
,
payload
,
res
=>
{
io
.
get
(
'
resources/verify-name
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -77,7 +77,7 @@ export default {
*/
getViewResources
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`resources/view`
,
payload
,
res
=>
{
io
.
get
(
'
resources/view
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -89,7 +89,7 @@ export default {
*/
createUdfFunc
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`resources/udf-func/create`
,
payload
,
res
=>
{
io
.
post
(
'
resources/udf-func/create
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -101,7 +101,7 @@ export default {
*/
updateUdfFunc
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`resources/udf-func/update`
,
payload
,
res
=>
{
io
.
post
(
'
resources/udf-func/update
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -113,7 +113,7 @@ export default {
*/
verifyUdfFuncName
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`resources/udf-func/verify-name`
,
payload
,
res
=>
{
io
.
get
(
'
resources/udf-func/verify-name
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -126,7 +126,7 @@ export default {
*/
deleteUdf
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`resources/udf-func/delete`
,
payload
,
res
=>
{
io
.
get
(
'
resources/udf-func/delete
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -138,7 +138,7 @@ export default {
*/
getUdfFuncListP
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`resources/udf-func/list-paging`
,
payload
,
res
=>
{
io
.
get
(
'
resources/udf-func/list-paging
'
,
payload
,
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -150,7 +150,7 @@ export default {
*/
updateContent
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`resources/update-content`
,
payload
,
res
=>
{
io
.
post
(
'
resources/update-content
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -162,7 +162,7 @@ export default {
*/
createResourceFile
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`resources/online-create`
,
payload
,
res
=>
{
io
.
post
(
'
resources/online-create
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -174,7 +174,7 @@ export default {
*/
createResourceFolder
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`resources/directory/create`
,
payload
,
res
=>
{
io
.
post
(
'
resources/directory/create
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -186,7 +186,7 @@ export default {
*/
resourceRename
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`resources/update`
,
payload
,
res
=>
{
io
.
post
(
'
resources/update
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
dolphinscheduler-ui/src/js/conf/home/store/security/actions.js
浏览文件 @
689bb5a2
...
...
@@ -25,7 +25,7 @@ export default {
* @param tenant/verifyTenantCode
*/
verifyName
({
state
},
payload
)
{
le
t
o
=
{
cons
t
o
=
{
user
:
{
param
:
{
userName
:
payload
.
userName
...
...
@@ -47,7 +47,7 @@ export default {
}
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
o
[
payload
.
type
]
[
'
api
'
],
o
[
payload
.
type
][
'
param
'
]
,
res
=>
{
io
.
get
(
o
[
payload
.
type
]
.
api
,
o
[
payload
.
type
].
param
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -64,7 +64,7 @@ export default {
*/
createUser
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`users/create`
,
payload
,
res
=>
{
io
.
post
(
'
users/create
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -77,7 +77,7 @@ export default {
*/
verifyUserName
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`users/verify-user-name`
,
payload
,
res
=>
{
io
.
post
(
'
users/verify-user-name
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -92,7 +92,7 @@ export default {
*/
getUsersListP
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`users/list-paging`
,
payload
,
res
=>
{
io
.
get
(
'
users/list-paging
'
,
payload
,
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -104,7 +104,7 @@ export default {
*/
getUsersList
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`users/list`
,
payload
,
res
=>
{
io
.
get
(
'
users/list
'
,
payload
,
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -116,7 +116,7 @@ export default {
*/
getUsersAll
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`users/list-all`
,
payload
,
res
=>
{
io
.
get
(
'
users/list-all
'
,
payload
,
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -134,7 +134,7 @@ export default {
*/
updateUser
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`users/update`
,
payload
,
res
=>
{
io
.
post
(
'
users/update
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -147,7 +147,7 @@ export default {
*/
deleteUser
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`users/delete`
,
payload
,
res
=>
{
io
.
post
(
'
users/delete
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -158,12 +158,12 @@ export default {
* Obtain authorized and unauthorized items
*/
getAuthList
({
state
},
payload
)
{
le
t
o
=
{
cons
t
o
=
{
type
:
payload
.
type
,
category
:
payload
.
category
}
le
t
param
=
{}
cons
t
param
=
{}
// Manage user
if
(
o
.
type
===
'
user
'
)
{
param
.
alertgroupId
=
payload
.
id
...
...
@@ -197,12 +197,12 @@ export default {
},
getResourceList
({
state
},
payload
)
{
le
t
o
=
{
cons
t
o
=
{
type
:
payload
.
type
,
category
:
payload
.
category
}
le
t
param
=
{}
cons
t
param
=
{}
// Manage user
if
(
o
.
type
===
'
user
'
)
{
param
.
alertgroupId
=
payload
.
id
...
...
@@ -254,7 +254,7 @@ export default {
*/
getUsersDetails
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`users/select-by-id`
,
payload
,
res
=>
{
io
.
post
(
'
users/select-by-id
'
,
payload
,
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -266,7 +266,7 @@ export default {
*/
getTenantListP
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`tenant/list-paging`
,
payload
,
res
=>
{
io
.
get
(
'
tenant/list-paging
'
,
payload
,
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -278,8 +278,8 @@ export default {
*/
getTenantList
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`tenant/list`
,
payload
,
res
=>
{
let
list
=
res
.
data
io
.
get
(
'
tenant/list
'
,
payload
,
res
=>
{
const
list
=
res
.
data
list
.
unshift
({
id
:
-
1
,
tenantName
:
'
Default
'
...
...
@@ -296,7 +296,7 @@ export default {
*/
getQueueList
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`queue/list`
,
payload
,
res
=>
{
io
.
get
(
'
queue/list
'
,
payload
,
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -308,7 +308,7 @@ export default {
*/
createQueue
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`tenant/create`
,
payload
,
res
=>
{
io
.
post
(
'
tenant/create
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -320,7 +320,7 @@ export default {
*/
updateQueue
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`tenant/update`
,
payload
,
res
=>
{
io
.
post
(
'
tenant/update
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -332,7 +332,7 @@ export default {
*/
deleteQueue
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`tenant/delete`
,
payload
,
res
=>
{
io
.
post
(
'
tenant/delete
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -344,7 +344,7 @@ export default {
*/
getAlertgroupP
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`alert-group/list-paging`
,
payload
,
res
=>
{
io
.
get
(
'
alert-group/list-paging
'
,
payload
,
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -356,7 +356,7 @@ export default {
*/
getAlertgroup
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`alert-group/list`
,
payload
,
res
=>
{
io
.
get
(
'
alert-group/list
'
,
payload
,
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -368,7 +368,7 @@ export default {
*/
createAlertgrou
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`alert-group/create`
,
payload
,
res
=>
{
io
.
post
(
'
alert-group/create
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -380,7 +380,7 @@ export default {
*/
updateAlertgrou
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`alert-group/update`
,
payload
,
res
=>
{
io
.
post
(
'
alert-group/update
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -392,7 +392,7 @@ export default {
*/
deleteAlertgrou
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`alert-group/delete`
,
payload
,
res
=>
{
io
.
post
(
'
alert-group/delete
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -404,7 +404,7 @@ export default {
*/
getProcessMasterList
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`process/master/list`
,
payload
,
res
=>
{
io
.
get
(
'
process/master/list
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -416,7 +416,7 @@ export default {
*/
getProcessWorkerList
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`process/worker/list`
,
payload
,
res
=>
{
io
.
get
(
'
process/worker/list
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -428,7 +428,7 @@ export default {
*/
getQueueListP
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`queue/list-paging`
,
payload
,
res
=>
{
io
.
get
(
'
queue/list-paging
'
,
payload
,
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -440,7 +440,7 @@ export default {
*/
createQueueQ
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`queue/create`
,
payload
,
res
=>
{
io
.
post
(
'
queue/create
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -452,7 +452,7 @@ export default {
*/
updateQueueQ
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`queue/update`
,
payload
,
res
=>
{
io
.
post
(
'
queue/update
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -464,7 +464,7 @@ export default {
*/
verifyQueueQ
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`queue/verify-queue`
,
payload
,
res
=>
{
io
.
post
(
'
queue/verify-queue
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -476,7 +476,7 @@ export default {
*/
getWorkerGroups
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`worker-group/list-paging`
,
payload
,
res
=>
{
io
.
get
(
'
worker-group/list-paging
'
,
payload
,
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -488,10 +488,10 @@ export default {
*/
getWorkerGroupsAll
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`worker-group/all-groups`
,
payload
,
res
=>
{
io
.
get
(
'
worker-group/all-groups
'
,
payload
,
res
=>
{
let
list
=
res
.
data
if
(
list
.
length
>
0
)
{
list
=
list
.
map
(
item
=>
{
if
(
list
.
length
>
0
)
{
list
=
list
.
map
(
item
=>
{
return
{
id
:
item
,
name
:
item
...
...
@@ -512,7 +512,7 @@ export default {
},
saveWorkerGroups
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`worker-group/save`
,
payload
,
res
=>
{
io
.
post
(
'
worker-group/save
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -521,7 +521,7 @@ export default {
},
deleteWorkerGroups
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`worker-group/delete-by-id`
,
payload
,
res
=>
{
io
.
get
(
'
worker-group/delete-by-id
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
dolphinscheduler-ui/src/js/conf/home/store/security/state.js
浏览文件 @
689bb5a2
...
...
@@ -16,5 +16,5 @@
*/
export
default
{
workerGroupsListAll
:
[],
tenantAllList
:
[]
tenantAllList
:
[]
}
dolphinscheduler-ui/src/js/conf/home/store/user/actions.js
浏览文件 @
689bb5a2
...
...
@@ -23,7 +23,7 @@ export default {
*/
getUserInfo
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`users/get-user-info`
,
payload
,
res
=>
{
io
.
get
(
'
users/get-user-info
'
,
payload
,
res
=>
{
state
.
userInfo
=
res
.
data
resolve
(
res
.
data
)
}).
catch
(
e
=>
{
...
...
@@ -35,7 +35,7 @@ export default {
* sign out
*/
signOut
()
{
io
.
post
(
`signOut`
,
res
=>
{
io
.
post
(
'
signOut
'
,
res
=>
{
setTimeout
(()
=>
{
window
.
location
.
href
=
`
${
PUBLIC_PATH
}
/view/login/index.html`
},
100
)
...
...
@@ -52,7 +52,7 @@ export default {
*/
getTokenListP
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`access-token/list-paging`
,
payload
,
res
=>
{
io
.
get
(
'
access-token/list-paging
'
,
payload
,
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -68,7 +68,7 @@ export default {
*/
createToken
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`access-token/create`
,
payload
,
res
=>
{
io
.
post
(
'
access-token/create
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -84,7 +84,7 @@ export default {
*/
updateToken
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`access-token/update`
,
payload
,
res
=>
{
io
.
post
(
'
access-token/update
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -99,7 +99,7 @@ export default {
*/
generateToken
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`access-token/generate`
,
payload
,
res
=>
{
io
.
post
(
'
access-token/generate
'
,
payload
,
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
@@ -113,7 +113,7 @@ export default {
*/
deleteToken
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
post
(
`access-token/delete`
,
payload
,
res
=>
{
io
.
post
(
'
access-token/delete
'
,
payload
,
res
=>
{
resolve
(
res
)
}).
catch
(
e
=>
{
reject
(
e
)
...
...
dolphinscheduler-ui/src/js/conf/login/index.js
浏览文件 @
689bb5a2
...
...
@@ -25,7 +25,7 @@ import 'ans-ui/lib/ans-ui.min.css'
import
ans
from
'
ans-ui/lib/ans-ui.min
'
import
'
sass/conf/login/index.scss
'
import
'
bootstrap/dist/js/bootstrap.min.js
'
import
'
bootstrap/dist/js/bootstrap.min.js
'
Vue
.
use
(
ans
)
...
...
@@ -41,7 +41,7 @@ new Vue({
},
methods
:
{
initApp
()
{
le
t
bootstrapTooltip
=
$
.
fn
.
tooltip
.
noConflict
()
cons
t
bootstrapTooltip
=
$
.
fn
.
tooltip
.
noConflict
()
$
.
fn
.
tooltip
=
bootstrapTooltip
$
(
'
body
'
).
tooltip
({
selector
:
'
[data-toggle="tooltip"]
'
,
...
...
dolphinscheduler-ui/src/js/module/ana-charts/common.js
浏览文件 @
689bb5a2
...
...
@@ -52,7 +52,7 @@ function getChartContainers (el) {
throw
new
Error
(
'
No corresponding DOM object found!
'
)
}
let
list
if
(
HTMLElement
.
prototype
.
isPrototypeOf
(
el
))
{
if
(
Object
.
prototype
.
isPrototypeOf
.
call
(
HTMLElement
.
prototype
,
el
))
{
list
=
new
Array
(
el
)
}
else
{
list
=
Array
.
from
(
el
)
...
...
@@ -70,7 +70,7 @@ function getChartContainers (el) {
*/
export
const
checkKeyInModel
=
(
model
,
...
params
)
=>
{
for
(
const
key
of
params
)
{
if
(
!
model
.
hasOwnProperty
(
key
))
{
if
(
!
Object
.
prototype
.
hasOwnProperty
.
call
(
model
,
key
))
{
throw
new
Error
(
'
Data format error! The specified property was not found:
'
+
key
)
}
}
...
...
dolphinscheduler-ui/src/js/module/ana-charts/index.js
浏览文件 @
689bb5a2
...
...
@@ -55,7 +55,7 @@ const Chart = {
// Corresponding methods for injection of different components
for
(
const
key
in
components
)
{
if
(
components
.
hasOwnProperty
(
key
))
{
if
(
Object
.
prototype
.
hasOwnProperty
.
call
(
components
,
key
))
{
Chart
[
key
.
toLowerCase
()]
=
(
el
,
data
,
options
)
=>
{
return
init
(
components
[
key
],
el
,
data
,
options
)
}
...
...
dolphinscheduler-ui/src/js/module/ana-charts/packages/bar/index.js
浏览文件 @
689bb5a2
...
...
@@ -242,7 +242,7 @@ export default class Bar extends Base {
}
=
this
.
settings
const
valueAxis
=
{
type
:
'
value
'
}
let
yAxisModel
=
reverseAxis
?
xAxis
:
valueAxis
le
t
xAxisModel
=
reverseAxis
?
valueAxis
:
xAxis
cons
t
xAxisModel
=
reverseAxis
?
valueAxis
:
xAxis
// Use custom Y-axis overlay
if
(
yAxis
)
{
yAxisModel
=
yAxis
...
...
@@ -267,7 +267,7 @@ export default class Bar extends Base {
// time axis
if
(
timelineOptions
)
{
le
t
opts
=
{
cons
t
opts
=
{
baseOption
:
{
timeline
:
timelineOptions
.
timeline
,
tooltip
:
{
...
...
@@ -296,7 +296,7 @@ export default class Bar extends Base {
// When the simple chart title is empty, the chart is vertically centered
const
top
=
!
title
&&
this
.
simple
?
'
3%
'
:
60
le
t
opts
=
{
cons
t
opts
=
{
title
:
{
text
:
title
},
...
...
dolphinscheduler-ui/src/js/module/ana-charts/packages/funnel/index.js
浏览文件 @
689bb5a2
...
...
@@ -118,10 +118,10 @@ export default class Funnel extends Base {
* Drawing charts
*/
apply
()
{
le
t
{
title
,
series
,
legendData
}
=
this
.
options
cons
t
{
title
,
series
,
legendData
}
=
this
.
options
// Injection configuration to series
le
t
{
insertSeries
}
=
this
.
settings
cons
t
{
insertSeries
}
=
this
.
settings
let
_series
=
series
if
(
insertSeries
&&
insertSeries
.
length
&&
series
.
length
)
{
_series
=
this
.
injectDataIntoSeries
(
insertSeries
,
_series
)
...
...
dolphinscheduler-ui/src/js/module/ana-charts/packages/line/index.js
浏览文件 @
689bb5a2
...
...
@@ -162,7 +162,7 @@ export default class Line extends Base {
}
=
this
.
settings
const
valueAxis
=
{
type
:
'
value
'
}
let
yAxisModel
=
reverseAxis
?
xAxis
:
valueAxis
le
t
xAxisModel
=
reverseAxis
?
valueAxis
:
xAxis
cons
t
xAxisModel
=
reverseAxis
?
valueAxis
:
xAxis
// Use custom Y-axis overlay
if
(
yAxis
)
{
yAxisModel
=
yAxis
...
...
@@ -175,7 +175,7 @@ export default class Line extends Base {
_series
=
this
.
injectDataIntoSeries
(
insertSeries
,
_series
)
}
le
t
opts
=
{
cons
t
opts
=
{
title
:
{
text
:
title
},
...
...
dolphinscheduler-ui/src/js/module/ana-charts/packages/pie/index.js
浏览文件 @
689bb5a2
...
...
@@ -60,8 +60,8 @@ export default class Pie extends Base {
checkKeyInModel
(
data
[
0
],
textKey
,
dataKey
)
const
legendData
=
[]
le
t
radius
=
ring
?
[
'
50%
'
,
'
70%
'
]
:
'
60%
'
le
t
center
=
title
?
[
'
50%
'
,
'
60%
'
]
:
[
'
50%
'
,
'
50%
'
]
cons
t
radius
=
ring
?
[
'
50%
'
,
'
70%
'
]
:
'
60%
'
cons
t
center
=
title
?
[
'
50%
'
,
'
60%
'
]
:
[
'
50%
'
,
'
50%
'
]
const
series
=
[{
radius
:
radius
,
center
:
center
,
...
...
@@ -88,16 +88,16 @@ export default class Pie extends Base {
* Drawing charts
*/
apply
()
{
le
t
{
title
,
series
,
legendData
}
=
this
.
options
cons
t
{
title
,
series
,
legendData
}
=
this
.
options
// Injection configuration to series
le
t
{
insertSeries
}
=
this
.
settings
cons
t
{
insertSeries
}
=
this
.
settings
let
_series
=
series
if
(
insertSeries
&&
insertSeries
.
length
&&
series
.
length
)
{
_series
=
this
.
injectDataIntoSeries
(
insertSeries
,
_series
)
}
le
t
opts
=
{
cons
t
opts
=
{
title
:
{
text
:
title
,
x
:
'
center
'
...
...
dolphinscheduler-ui/src/js/module/ana-charts/packages/radar/index.js
浏览文件 @
689bb5a2
...
...
@@ -87,7 +87,7 @@ export default class Radar extends Base {
targetSeries
.
_raw
.
push
(
data
[
i
])
// index
le
t
targetIndicator
=
indicator
.
find
(
i
=>
i
.
name
===
textItem
)
cons
t
targetIndicator
=
indicator
.
find
(
i
=>
i
.
name
===
textItem
)
if
(
!
targetIndicator
)
{
indicator
.
push
({
name
:
textItem
})
}
...
...
dolphinscheduler-ui/src/js/module/ana-charts/packages/scatter/index.js
浏览文件 @
689bb5a2
...
...
@@ -120,7 +120,7 @@ export default class Scatter extends Base {
apply
()
{
const
{
title
,
series
,
legendData
=
[]
}
=
this
.
options
le
t
{
cons
t
{
// Custom X axis
xAxis
,
// Custom Y axis
...
...
dolphinscheduler-ui/src/js/module/axios/querystring.js
浏览文件 @
689bb5a2
...
...
@@ -16,45 +16,45 @@
*/
/* istanbul ignore next */
var
param
=
function
(
a
)
{
var
s
=
[]
,
rbracket
=
/
\[\]
$/
,
isArray
=
function
(
obj
)
{
return
Object
.
prototype
.
toString
.
call
(
obj
)
===
'
[object Array]
'
},
add
=
function
(
k
,
v
)
{
v
=
typeof
v
===
'
function
'
?
v
()
:
v
===
null
?
''
:
v
===
undefined
?
''
:
v
s
[
s
.
length
]
=
encodeURIComponent
(
k
)
+
'
=
'
+
encodeURIComponent
(
v
)
},
buildParams
=
function
(
prefix
,
obj
)
{
var
i
,
len
,
key
var
s
=
[]
var
rbracket
=
/
\[\]
$/
var
isArray
=
function
(
obj
)
{
return
Object
.
prototype
.
toString
.
call
(
obj
)
===
'
[object Array]
'
}
var
add
=
function
(
k
,
v
)
{
v
=
typeof
v
===
'
function
'
?
v
()
:
v
===
null
?
''
:
v
===
undefined
?
''
:
v
s
[
s
.
length
]
=
encodeURIComponent
(
k
)
+
'
=
'
+
encodeURIComponent
(
v
)
}
var
buildParams
=
function
(
prefix
,
obj
)
{
var
i
,
len
,
key
if
(
prefix
)
{
if
(
isArray
(
obj
))
{
for
(
i
=
0
,
len
=
obj
.
length
;
i
<
len
;
i
++
)
{
if
(
rbracket
.
test
(
prefix
))
{
add
(
prefix
,
obj
[
i
])
}
else
{
buildParams
(
prefix
+
'
[
'
+
(
typeof
obj
[
i
]
===
'
object
'
?
i
:
''
)
+
'
]
'
,
obj
[
i
])
}
}
}
else
if
(
obj
&&
String
(
obj
)
===
'
[object Object]
'
)
{
for
(
key
in
obj
)
{
buildParams
(
prefix
+
'
[
'
+
key
+
'
]
'
,
obj
[
key
])
}
}
else
{
add
(
prefix
,
obj
)
}
}
else
if
(
isArray
(
obj
))
{
if
(
prefix
)
{
if
(
isArray
(
obj
))
{
for
(
i
=
0
,
len
=
obj
.
length
;
i
<
len
;
i
++
)
{
add
(
obj
[
i
].
name
,
obj
[
i
].
value
)
if
(
rbracket
.
test
(
prefix
))
{
add
(
prefix
,
obj
[
i
])
}
else
{
buildParams
(
prefix
+
'
[
'
+
(
typeof
obj
[
i
]
===
'
object
'
?
i
:
''
)
+
'
]
'
,
obj
[
i
])
}
}
}
else
{
}
else
if
(
obj
&&
String
(
obj
)
===
'
[object Object]
'
)
{
for
(
key
in
obj
)
{
buildParams
(
key
,
obj
[
key
])
buildParams
(
prefix
+
'
[
'
+
key
+
'
]
'
,
obj
[
key
])
}
}
else
{
add
(
prefix
,
obj
)
}
}
else
if
(
isArray
(
obj
))
{
for
(
i
=
0
,
len
=
obj
.
length
;
i
<
len
;
i
++
)
{
add
(
obj
[
i
].
name
,
obj
[
i
].
value
)
}
}
else
{
for
(
key
in
obj
)
{
buildParams
(
key
,
obj
[
key
])
}
return
s
}
return
s
}
return
buildParams
(
''
,
a
).
join
(
'
&
'
).
replace
(
/%20/g
,
'
+
'
)
}
...
...
dolphinscheduler-ui/src/js/module/components/crontab/source/_source/i18n/index.js
浏览文件 @
689bb5a2
...
...
@@ -25,4 +25,3 @@ export default {
}
}
}
dolphinscheduler-ui/src/js/module/components/crontab/source/_source/i18n/locale/en_US.js
浏览文件 @
689bb5a2
...
...
@@ -15,62 +15,62 @@
* limitations under the License.
*/
export
default
{
'
秒
'
:
'
second
'
,
'
分
'
:
'
minute
'
,
'
时
'
:
'
hour
'
,
'
天
'
:
'
day
'
,
'
月
'
:
'
month
'
,
'
年
'
:
'
year
'
,
'
星期一
'
:
'
Monday
'
,
'
星期二
'
:
'
Tuesday
'
,
'
星期三
'
:
'
Wednesday
'
,
'
星期四
'
:
'
Thursday
'
,
'
星期五
'
:
'
Friday
'
,
'
星期六
'
:
'
Saturday
'
,
'
星期天
'
:
'
Sunday
'
,
'
每一秒钟
'
:
'
Every second
'
,
'
每隔
'
:
'
Every
'
,
秒
:
'
second
'
,
分
:
'
minute
'
,
时
:
'
hour
'
,
天
:
'
day
'
,
月
:
'
month
'
,
年
:
'
year
'
,
星期一
:
'
Monday
'
,
星期二
:
'
Tuesday
'
,
星期三
:
'
Wednesday
'
,
星期四
:
'
Thursday
'
,
星期五
:
'
Friday
'
,
星期六
:
'
Saturday
'
,
星期天
:
'
Sunday
'
,
每一秒钟
:
'
Every second
'
,
每隔
:
'
Every
'
,
'
秒执行 从
'
:
'
second carried out
'
,
'
秒开始
'
:
'
Start
'
,
秒开始
:
'
Start
'
,
'
具体秒数(可多选)
'
:
'
Specific second(multiple)
'
,
'
请选择具体秒数
'
:
'
Please enter a specific second
'
,
'
周期从
'
:
'
Cycle from
'
,
'
到
'
:
'
to
'
,
'
每一分钟
'
:
'
Every minute
'
,
请选择具体秒数
:
'
Please enter a specific second
'
,
周期从
:
'
Cycle from
'
,
到
:
'
to
'
,
每一分钟
:
'
Every minute
'
,
'
分执行 从
'
:
'
minute carried out
'
,
'
分开始
'
:
'
Start
'
,
分开始
:
'
Start
'
,
'
具体分钟数(可多选)
'
:
'
Specific minute(multiple)
'
,
'
请选择具体分钟数
'
:
'
Please enter a specific minute
'
,
'
每一小时
'
:
'
Every hour
'
,
请选择具体分钟数
:
'
Please enter a specific minute
'
,
每一小时
:
'
Every hour
'
,
'
小时执行 从
'
:
'
hour carried out
'
,
'
小时开始
'
:
'
Start
'
,
小时开始
:
'
Start
'
,
'
具体小时数(可多选)
'
:
'
Specific hour(multiple)
'
,
'
请选择具体小时数
'
:
'
Please enter a hour
'
,
'
每一天
'
:
'
Every day
'
,
请选择具体小时数
:
'
Please enter a hour
'
,
每一天
:
'
Every day
'
,
'
周执行 从
'
:
'
week carried out
'
,
'
开始
'
:
'
Start
'
,
开始
:
'
Start
'
,
'
天执行 从
'
:
'
day carried out
'
,
'
天开始
'
:
'
Start
'
,
天开始
:
'
Start
'
,
'
具体星期几(可多选)
'
:
'
Specific day of the week(multiple)
'
,
'
请选择具体周几
'
:
'
Please enter a week
'
,
请选择具体周几
:
'
Please enter a week
'
,
'
具体天数(可多选)
'
:
'
Specific days(multiple)
'
,
'
请选择具体天数
'
:
'
Please enter a days
'
,
'
在这个月的最后一天
'
:
'
On the last day of the month
'
,
'
在这个月的最后一个工作日
'
:
'
On the last working day of the month
'
,
'
在这个月的最后一个
'
:
'
At the last of this month
'
,
'
在本月底前
'
:
'
Before the end of this month
'
,
请选择具体天数
:
'
Please enter a days
'
,
在这个月的最后一天
:
'
On the last day of the month
'
,
在这个月的最后一个工作日
:
'
On the last working day of the month
'
,
在这个月的最后一个
:
'
At the last of this month
'
,
在本月底前
:
'
Before the end of this month
'
,
'
最近的工作日(周一至周五)至本月
'
:
'
The most recent business day (Monday to Friday) to this month
'
,
'
在这个月的第
'
:
'
In this months
'
,
'
每一月
'
:
'
Every month
'
,
在这个月的第
:
'
In this months
'
,
每一月
:
'
Every month
'
,
'
月执行 从
'
:
'
month carried out
'
,
'
月开始
'
:
'
Start
'
,
月开始
:
'
Start
'
,
'
具体月数(可多选)
'
:
'
Specific months(multiple)
'
,
'
请选择具体月数
'
:
'
Please enter a months
'
,
'
每一年
'
:
'
Every year
'
,
请选择具体月数
:
'
Please enter a months
'
,
每一年
:
'
Every year
'
,
'
年执行 从
'
:
'
year carried out
'
,
'
年开始
'
:
'
Start
'
,
年开始
:
'
Start
'
,
'
具体年数(可多选)
'
:
'
Specific year(multiple)
'
,
'
请选择具体年数
'
:
'
Please enter a year
'
,
'
小时
'
:
'
hour
'
,
'
日
'
:
'
day
'
请选择具体年数
:
'
Please enter a year
'
,
小时
:
'
hour
'
,
日
:
'
day
'
}
dolphinscheduler-ui/src/js/module/components/crontab/source/_source/i18n/locale/zh_CN.js
浏览文件 @
689bb5a2
...
...
@@ -15,62 +15,62 @@
* limitations under the License.
*/
export
default
{
'
秒
'
:
'
秒
'
,
'
分
'
:
'
分
'
,
'
时
'
:
'
时
'
,
'
天
'
:
'
天
'
,
'
月
'
:
'
月
'
,
'
年
'
:
'
年
'
,
'
星期一
'
:
'
星期一
'
,
'
星期二
'
:
'
星期二
'
,
'
星期三
'
:
'
星期三
'
,
'
星期四
'
:
'
星期四
'
,
'
星期五
'
:
'
星期五
'
,
'
星期六
'
:
'
星期六
'
,
'
星期天
'
:
'
星期天
'
,
'
每一秒钟
'
:
'
每一秒钟
'
,
'
每隔
'
:
'
每隔
'
,
秒
:
'
秒
'
,
分
:
'
分
'
,
时
:
'
时
'
,
天
:
'
天
'
,
月
:
'
月
'
,
年
:
'
年
'
,
星期一
:
'
星期一
'
,
星期二
:
'
星期二
'
,
星期三
:
'
星期三
'
,
星期四
:
'
星期四
'
,
星期五
:
'
星期五
'
,
星期六
:
'
星期六
'
,
星期天
:
'
星期天
'
,
每一秒钟
:
'
每一秒钟
'
,
每隔
:
'
每隔
'
,
'
秒执行 从
'
:
'
秒执行 从
'
,
'
秒开始
'
:
'
秒开始
'
,
秒开始
:
'
秒开始
'
,
'
具体秒数(可多选)
'
:
'
具体秒数(可多选)
'
,
'
请选择具体秒数
'
:
'
请选择具体秒数
'
,
'
周期从
'
:
'
周期从
'
,
'
到
'
:
'
到
'
,
'
每一分钟
'
:
'
每一分钟
'
,
请选择具体秒数
:
'
请选择具体秒数
'
,
周期从
:
'
周期从
'
,
到
:
'
到
'
,
每一分钟
:
'
每一分钟
'
,
'
分执行 从
'
:
'
分执行 从
'
,
'
分开始
'
:
'
分开始
'
,
分开始
:
'
分开始
'
,
'
具体分钟数(可多选)
'
:
'
具体分钟数(可多选)
'
,
'
请选择具体分钟数
'
:
'
请选择具体分钟数
'
,
'
每一小时
'
:
'
每一小时
'
,
请选择具体分钟数
:
'
请选择具体分钟数
'
,
每一小时
:
'
每一小时
'
,
'
小时执行 从
'
:
'
小时执行 从
'
,
'
小时开始
'
:
'
小时开始
'
,
小时开始
:
'
小时开始
'
,
'
具体小时数(可多选)
'
:
'
具体小时数(可多选)
'
,
'
请选择具体小时数
'
:
'
请选择具体小时数
'
,
'
每一天
'
:
'
每一天
'
,
请选择具体小时数
:
'
请选择具体小时数
'
,
每一天
:
'
每一天
'
,
'
周执行 从
'
:
'
周执行 从
'
,
'
开始
'
:
'
开始
'
,
开始
:
'
开始
'
,
'
天执行 从
'
:
'
天执行 从
'
,
'
天开始
'
:
'
天开始
'
,
天开始
:
'
天开始
'
,
'
具体星期几(可多选)
'
:
'
具体星期几(可多选)
'
,
'
请选择具体周几
'
:
'
请选择具体周几
'
,
请选择具体周几
:
'
请选择具体周几
'
,
'
具体天数(可多选)
'
:
'
具体天数(可多选)
'
,
'
请选择具体天数
'
:
'
请选择具体天数
'
,
'
在这个月的最后一天
'
:
'
在这个月的最后一天
'
,
'
在这个月的最后一个工作日
'
:
'
在这个月的最后一个工作日
'
,
'
在这个月的最后一个
'
:
'
在这个月的最后一个
'
,
'
在本月底前
'
:
'
在本月底前
'
,
请选择具体天数
:
'
请选择具体天数
'
,
在这个月的最后一天
:
'
在这个月的最后一天
'
,
在这个月的最后一个工作日
:
'
在这个月的最后一个工作日
'
,
在这个月的最后一个
:
'
在这个月的最后一个
'
,
在本月底前
:
'
在本月底前
'
,
'
最近的工作日(周一至周五)至本月
'
:
'
最近的工作日(周一至周五)至本月
'
,
'
在这个月的第
'
:
'
在这个月的第
'
,
'
每一月
'
:
'
每一月
'
,
在这个月的第
:
'
在这个月的第
'
,
每一月
:
'
每一月
'
,
'
月执行 从
'
:
'
月执行 从
'
,
'
月开始
'
:
'
月开始
'
,
月开始
:
'
月开始
'
,
'
具体月数(可多选)
'
:
'
具体月数(可多选)
'
,
'
请选择具体月数
'
:
'
请选择具体月数
'
,
'
每一年
'
:
'
每一年
'
,
请选择具体月数
:
'
请选择具体月数
'
,
每一年
:
'
每一年
'
,
'
年执行 从
'
:
'
年执行 从
'
,
'
年开始
'
:
'
年开始
'
,
年开始
:
'
年开始
'
,
'
具体年数(可多选)
'
:
'
具体年数(可多选)
'
,
'
请选择具体年数
'
:
'
请选择具体年数
'
,
'
小时
'
:
'
小时
'
,
'
日
'
:
'
日
'
请选择具体年数
:
'
请选择具体年数
'
,
小时
:
'
小时
'
,
日
:
'
日
'
}
dolphinscheduler-ui/src/js/module/components/crontab/source/util/index.js
浏览文件 @
689bb5a2
...
...
@@ -23,37 +23,37 @@ import _ from 'lodash'
* @param end End value
*/
const
range
=
(
start
,
end
)
=>
{
le
t
length
=
end
-
start
+
1
cons
t
length
=
end
-
start
+
1
let
step
=
start
-
1
return
Array
.
apply
(
null
,
{
length
:
length
}).
map
(
function
(
v
,
i
)
{
step
++
;
return
step
})
}
le
t
selectList
=
{
'
60
'
:
_
.
map
(
range
(
0
,
59
),
v
=>
{
cons
t
selectList
=
{
60
:
_
.
map
(
range
(
0
,
59
),
v
=>
{
return
{
value
:
v
+
''
,
label
:
v
+
''
}
}),
'
24
'
:
_
.
map
(
range
(
0
,
23
),
v
=>
{
24
:
_
.
map
(
range
(
0
,
23
),
v
=>
{
return
{
value
:
v
+
''
,
label
:
v
+
''
}
}),
'
12
'
:
_
.
map
(
range
(
0
,
12
),
v
=>
{
12
:
_
.
map
(
range
(
0
,
12
),
v
=>
{
return
{
value
:
v
+
''
,
label
:
v
+
''
}
}),
'
year
'
:
_
.
map
(
range
(
2018
,
2030
),
v
=>
{
year
:
_
.
map
(
range
(
2018
,
2030
),
v
=>
{
return
{
value
:
v
+
''
,
label
:
v
+
''
}
}),
'
week
'
:
[
week
:
[
{
value
:
1
,
label
:
'
星期天
'
...
...
@@ -83,7 +83,7 @@ let selectList = {
label
:
'
星期六
'
}
],
'
specificWeek
'
:
[
specificWeek
:
[
{
value
:
'
SUN
'
,
label
:
'
SUN
'
...
...
@@ -113,13 +113,13 @@ let selectList = {
label
:
'
SAT
'
}
],
'
day
'
:
_
.
map
(
range
(
1
,
31
),
v
=>
{
day
:
_
.
map
(
range
(
1
,
31
),
v
=>
{
return
{
value
:
v
+
''
,
label
:
v
+
''
}
}),
'
lastWeeks
'
:
[
lastWeeks
:
[
{
value
:
'
1L
'
,
label
:
'
星期天
'
...
...
@@ -161,8 +161,8 @@ const isStr = (str, v) => {
const
isWeek
=
(
str
)
=>
{
let
flag
=
false
le
t
data
=
str
.
split
(
'
,
'
)
le
t
isSpecificWeek
=
(
key
)
=>
{
cons
t
data
=
str
.
split
(
'
,
'
)
cons
t
isSpecificWeek
=
(
key
)
=>
{
return
_
.
findIndex
(
selectList
.
specificWeek
,
v
=>
v
.
value
===
key
)
!==
-
1
}
_
.
map
(
data
,
v
=>
{
...
...
@@ -173,7 +173,6 @@ const isWeek = (str) => {
return
flag
}
/**
* template
*
...
...
@@ -206,7 +205,6 @@ const template = (string, ...args) => {
})
}
export
{
selectList
,
isStr
,
...
...
dolphinscheduler-ui/src/js/module/components/secondaryMenu/_source/menu.js
浏览文件 @
689bb5a2
...
...
@@ -19,7 +19,7 @@ import i18n from '@/module/i18n'
import
config
from
'
~/external/config
'
import
Permissions
from
'
@/module/permissions
'
le
t
menu
=
{
cons
t
menu
=
{
projects
:
[
{
name
:
`
${
i18n
.
$t
(
'
Project Home
'
)}
`
,
...
...
@@ -225,7 +225,7 @@ let menu = {
icon
:
'
ans-icon-menu
'
,
children
:
[
{
name
:
"
Statistics
"
,
name
:
'
Statistics
'
,
path
:
'
statistics
'
,
id
:
0
,
disabled
:
true
...
...
dolphinscheduler-ui/src/js/module/download/index.js
浏览文件 @
689bb5a2
...
...
@@ -19,8 +19,8 @@ import i18n from '@/module/i18n'
/**
* download file
*/
le
t
downloadFile
=
(
$url
,
$obj
)
=>
{
le
t
param
=
{
cons
t
downloadFile
=
(
$url
,
$obj
)
=>
{
cons
t
param
=
{
url
:
$url
,
obj
:
$obj
}
...
...
@@ -30,9 +30,9 @@ let downloadFile = ($url, $obj) => {
return
}
le
t
generatorInput
=
function
(
obj
)
{
cons
t
generatorInput
=
function
(
obj
)
{
let
result
=
''
le
t
keyArr
=
Object
.
keys
(
obj
)
cons
t
keyArr
=
Object
.
keys
(
obj
)
keyArr
.
forEach
(
function
(
key
)
{
result
+=
"
<input type='hidden' name = '
"
+
key
+
"
' value='
"
+
obj
[
key
]
+
"
'>
"
})
...
...
dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
浏览文件 @
689bb5a2
此差异已折叠。
点击以展开。
dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
浏览文件 @
689bb5a2
此差异已折叠。
点击以展开。
dolphinscheduler-ui/src/js/module/io/index.js
浏览文件 @
689bb5a2
...
...
@@ -18,7 +18,6 @@
import
io
from
'
@/module/axios/index
'
import
cookies
from
'
js-cookie
'
const
apiPrefix
=
'
/dolphinscheduler
'
const
reSlashPrefix
=
/^
\/
+/
...
...
@@ -73,13 +72,13 @@ io.interceptors.response.use(
// Global request interceptor registion
io
.
interceptors
.
request
.
use
(
config
=>
{
le
t
sIdCookie
=
cookies
.
get
(
'
sessionId
'
)
let
sessionId
=
sessionStorage
.
getItem
(
"
sessionId
"
)
let
requstUrl
=
config
.
url
.
substring
(
config
.
url
.
lastIndexOf
(
"
/
"
)
+
1
)
if
(
sIdCookie
!==
null
&&
requstUrl
!==
'
login
'
&&
sIdCookie
!=
sessionId
)
{
cons
t
sIdCookie
=
cookies
.
get
(
'
sessionId
'
)
const
sessionId
=
sessionStorage
.
getItem
(
'
sessionId
'
)
const
requstUrl
=
config
.
url
.
substring
(
config
.
url
.
lastIndexOf
(
'
/
'
)
+
1
)
if
(
sIdCookie
!==
null
&&
requstUrl
!==
'
login
'
&&
sIdCookie
!==
sessionId
)
{
window
.
location
.
href
=
`
${
PUBLIC_PATH
}
/view/login/index.html`
}
else
{
le
t
{
method
}
=
config
cons
t
{
method
}
=
config
if
(
method
===
'
get
'
)
{
config
.
params
=
Object
.
assign
({},
config
.
params
,
{
_t
:
Math
.
random
()
...
...
dolphinscheduler-ui/src/js/module/mixin/disabledState.js
浏览文件 @
689bb5a2
...
...
@@ -17,7 +17,6 @@
import
store
from
'
@/conf/home/store
'
import
router
from
'
@/conf/home/router
'
import
Permissions
from
'
@/module/permissions
'
export
default
{
data
()
{
...
...
@@ -28,7 +27,7 @@ export default {
}
},
created
()
{
this
.
isDetails
=
this
.
store
.
state
.
dag
.
isDetails
// Permissions.getAuth() ? this.store.state.dag.isDetails : true
this
.
isDetails
=
this
.
store
.
state
.
dag
.
isDetails
// Permissions.getAuth() ? this.store.state.dag.isDetails : true
},
computed
:
{
_isDetails
()
{
...
...
dolphinscheduler-ui/src/js/module/mixin/listUrlParamHandle.js
浏览文件 @
689bb5a2
...
...
@@ -23,7 +23,7 @@ import { setUrlParams } from '@/module/util/routerUtil'
export
default
{
watch
:
{
// watch pageNo
'
searchParams
'
:
{
searchParams
:
{
deep
:
true
,
handler
()
{
setUrlParams
(
this
.
searchParams
)
...
...
@@ -48,8 +48,8 @@ export default {
_debounceGET
:
_
.
debounce
(
function
(
flag
)
{
this
.
_getList
(
flag
)
},
100
,
{
'
leading
'
:
false
,
'
trailing
'
:
true
leading
:
false
,
trailing
:
true
})
}
}
dolphinscheduler-ui/src/js/module/permissions/index.js
浏览文件 @
689bb5a2
...
...
@@ -19,7 +19,7 @@ import _ from 'lodash'
import
Vue
from
'
vue
'
import
store
from
'
@/conf/home/store
'
le
t
Permissions
=
function
()
{
cons
t
Permissions
=
function
()
{
this
.
isAuth
=
true
}
...
...
@@ -44,7 +44,7 @@ Permissions.prototype = {
if
(
$
(
el
).
prop
(
'
tagName
'
)
===
'
BUTTON
'
)
{
$
(
el
).
attr
(
'
disabled
'
,
true
)
}
else
{
setTimeout
(
function
(){
el
.
parentNode
.
removeChild
(
el
)},
100
)
setTimeout
(
function
()
{
el
.
parentNode
.
removeChild
(
el
)
},
100
)
}
}
}
...
...
dolphinscheduler-ui/src/js/module/util/index.js
浏览文件 @
689bb5a2
...
...
@@ -51,7 +51,7 @@ export function findComponentDownward (context, componentName) {
* uuid('v-ani-%{s}-translate') // -> v-ani-xxx
*/
export
function
uuid
(
prefix
)
{
le
t
id
=
Math
.
floor
(
Math
.
random
()
*
10000
).
toString
(
36
)
cons
t
id
=
Math
.
floor
(
Math
.
random
()
*
10000
).
toString
(
36
)
return
prefix
?
(
~
prefix
.
indexOf
(
'
%{s}
'
)
?
(
prefix
.
replace
(
/%
\{
s
\}
/g
,
id
)
...
...
@@ -59,7 +59,6 @@ export function uuid (prefix) {
)
:
id
}
/**
* template
*
...
...
@@ -92,4 +91,3 @@ export function template (string, ...args) {
}
})
}
dolphinscheduler-ui/src/js/module/util/routerUtil.js
浏览文件 @
689bb5a2
...
...
@@ -15,9 +15,6 @@
* limitations under the License.
*/
import
merge
from
'
webpack-merge
'
import
router
from
'
@/conf/home/router
'
export
function
setUrlParams
(
o
)
{
// router.push({
// query: merge(router.history.current.query, o)
...
...
dolphinscheduler-ui/src/js/module/util/util.js
浏览文件 @
689bb5a2
...
...
@@ -20,9 +20,9 @@
*/
const
bytesToSize
=
(
bytes
)
=>
{
if
(
bytes
===
0
)
return
'
0 B
'
let
k
=
1024
,
// or 1024
sizes
=
[
'
B
'
,
'
KB
'
,
'
MB
'
,
'
GB
'
,
'
TB
'
,
'
PB
'
,
'
EB
'
,
'
ZB
'
,
'
YB
'
],
i
=
Math
.
floor
(
Math
.
log
(
bytes
)
/
Math
.
log
(
k
))
const
k
=
1024
// or 1024
const
sizes
=
[
'
B
'
,
'
KB
'
,
'
MB
'
,
'
GB
'
,
'
TB
'
,
'
PB
'
,
'
EB
'
,
'
ZB
'
,
'
YB
'
]
const
i
=
Math
.
floor
(
Math
.
log
(
bytes
)
/
Math
.
log
(
k
))
return
parseInt
((
bytes
/
Math
.
pow
(
k
,
i
)).
toPrecision
(
3
))
+
'
'
+
sizes
[
i
]
}
...
...
@@ -33,7 +33,7 @@ const bytesToSize = (bytes) => {
const
isJson
=
(
str
)
=>
{
if
(
typeof
str
===
'
string
'
)
{
try
{
le
t
obj
=
JSON
.
parse
(
str
)
cons
t
obj
=
JSON
.
parse
(
str
)
if
(
typeof
obj
===
'
object
'
&&
obj
)
{
return
true
}
else
{
...
...
@@ -69,7 +69,6 @@ const syntaxHighlight = (json) => {
})
}
export
{
bytesToSize
,
isJson
,
...
...
dolphinscheduler-ui/src/lib/external/config.js
浏览文件 @
689bb5a2
...
...
@@ -19,5 +19,5 @@
*/
export
default
{
// task record switch
recordSwitch
:
false
recordSwitch
:
false
}
dolphinscheduler-ui/src/lib/external/email.js
浏览文件 @
689bb5a2
...
...
@@ -14,4 +14,4 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export
default
[
"
test@analysys.com.cn
"
]
export
default
[
'
test@analysys.com.cn
'
]
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录