Browse Source

Merge pull request #2831 from break60/dev-1.3.0

Add tips for download workflow
pull/3/MERGE
xingchun-chen 5 years ago committed by GitHub
parent
commit
f25069bf83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 22
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.js
  2. 10
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/downChart.js
  3. 3
      dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
  4. 3
      dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js

22
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.js

@ -14,8 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import Vue from 'vue'
let v = new Vue()
import _ from 'lodash'
import i18n from '@/module/i18n'
import { jsPlumb } from 'jsplumb'
import JSP from './plugIn/jsPlumbHandle'
import DownChart from './plugIn/downChart'
@ -73,6 +75,7 @@ Dag.prototype.create = function () {
* Action event on the right side of the toolbar
*/
Dag.prototype.toolbarEvent = function ({ item, code, is }) {
let self = this
switch (code) {
case 'pointer':
JSP.handleEventPointer(is)
@ -87,8 +90,21 @@ Dag.prototype.toolbarEvent = function ({ item, code, is }) {
JSP.handleEventScreen({ item, is })
break
case 'download':
DownChart.download({
dagThis: this.dag
v.$modal.dialog({
width: 350,
closable: false,
showMask: true,
maskClosable: true,
title: i18n.$t('Download'),
content: i18n.$t('Please confirm whether the workflow has been saved before downloading'),
ok: {
handle (e) {
DownChart.download({
dagThis: self.dag
})
}
},
cancel: {}
})
break
}

10
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/downChart.js vendored

@ -19,7 +19,7 @@ import _ from 'lodash'
import canvg from 'canvg'
import { tasksAll } from './util'
import html2canvas from 'html2canvas'
// import { findComponentDownward } from '@/module/util/'
import { findComponentDownward } from '@/module/util/'
const DownChart = function () {
this.dag = {}
@ -111,10 +111,10 @@ DownChart.prototype.download = function ({ dagThis }) {
}, 100)
// To refresh the dag instance, otherwise you can't re-plot
// setTimeout(() => {
// // Refresh current dag
// findComponentDownward(this.dag.$root, `${this.dag.type}-details`).init()
// }, 500)
setTimeout(() => {
// Refresh current dag
findComponentDownward(this.dag.$root, `${this.dag.type}-details`).init()
}, 500)
})
})
}

3
dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js

@ -593,5 +593,6 @@ export default {
'Successful branch flow and failed branch flow are required': 'conditions node Successful and failed branch flow are required',
'Unauthorized or deleted resources': 'Unauthorized or deleted resources',
'Please delete all non-existent resources': 'Please delete all non-existent resources',
'The Worker group no longer exists, please select the correct Worker group!': 'The Worker group no longer exists, please select the correct Worker group!'
'The Worker group no longer exists, please select the correct Worker group!': 'The Worker group no longer exists, please select the correct Worker group!',
'Please confirm whether the workflow has been saved before downloading': 'Please confirm whether the workflow has been saved before downloading'
}

3
dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js

@ -593,5 +593,6 @@ export default {
'Successful branch flow and failed branch flow are required': 'conditions节点成功和失败分支流转必填',
'Unauthorized or deleted resources': '未授权或已删除资源',
'Please delete all non-existent resources': '请删除所有未授权或已删除资源',
'The Worker group no longer exists, please select the correct Worker group!': '该Worker分组已经不存在请选择正确的Worker分组'
'The Worker group no longer exists, please select the correct Worker group!': '该Worker分组已经不存在请选择正确的Worker分组',
'Please confirm whether the workflow has been saved before downloading': '下载前请确定工作流是否已保存'
}

Loading…
Cancel
Save