@@ -63,6 +71,8 @@
import mResources from './_source/resources'
import mLocalParams from './_source/localParams'
import disabledState from '@/module/mixin/disabledState'
+ import Treeselect from '@riophae/vue-treeselect'
+ import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import codemirror from '@/conf/home/pages/resource/pages/file/pages/_source/codemirror'
let editor
@@ -78,7 +88,14 @@
// resource(list)
resourceList: [],
// Cache ResourceList
- cacheResourceList: []
+ cacheResourceList: [],
+ // define options
+ options: [],
+ normalizer(node) {
+ return {
+ label: node.name
+ }
+ },
}
},
mixins: [disabledState],
@@ -143,17 +160,19 @@
return false
}
- if (!this.$refs.refResources._verifResources()) {
- return false
- }
-
// localParams Subcomponent verification
if (!this.$refs.refLocalParams._verifProp()) {
return false
}
+ // Process resourcelist
+ let dataProcessing= _.map(this.resourceList, v => {
+ return {
+ id: v
+ }
+ })
// storage
this.$emit('on-params', {
- resourceList: this.resourceList,
+ resourceList: dataProcessing,
localParams: this.localParams,
rawScript: editor.getValue()
})
@@ -163,8 +182,6 @@
* Processing code highlighting
*/
_handlerEditor () {
- this._destroyEditor()
-
// editor
editor = codemirror('code-shell-mirror', {
mode: 'shell',
@@ -179,51 +196,41 @@
}
}
- this.changes = () => {
- this._cacheParams()
- }
-
// Monitor keyboard
editor.on('keypress', this.keypress)
-
- editor.on('changes', this.changes)
-
editor.setValue(this.rawScript)
return editor
},
- _cacheParams () {
- this.$emit('on-cache-params', {
- resourceList: this.cacheResourceList,
- localParams: this.localParams,
- rawScript: editor ? editor.getValue() : ''
- });
- },
- _destroyEditor () {
- if (editor) {
- editor.toTextArea() // Uninstall
- editor.off($('.code-sql-mirror'), 'keypress', this.keypress)
- editor.off($('.code-sql-mirror'), 'changes', this.changes)
- }
+ diGuiTree(item) { // Recursive convenience tree structure
+ item.forEach(item => {
+ item.children === '' || item.children === undefined || item.children === null || item.children.length === 0?
+ delete item.children : this.diGuiTree(item.children);
+ })
}
},
watch: {
//Watch the cacheParams
cacheParams (val) {
- this._cacheParams()
+ this.$emit('on-cache-params', val);
}
},
computed: {
cacheParams () {
return {
- resourceList: this.cacheResourceList,
- localParams: this.localParams
+ resourceList: _.map(this.resourceList, v => {
+ return {id: v}
+ }),
+ localParams: this.localParams,
+ rawScript: editor ? editor.getValue() : ''
}
}
},
created () {
+ let item = this.store.state.dag.resourcesListS
+ this.diGuiTree(item)
+ this.options = item
let o = this.backfillItem
-
// Non-null objects represent backfill
if (!_.isEmpty(o)) {
this.rawScript = o.params.rawScript || ''
@@ -231,7 +238,9 @@
// backfill resourceList
let resourceList = o.params.resourceList || []
if (resourceList.length) {
- this.resourceList = resourceList
+ this.resourceList = _.map(resourceList, v => {
+ return v.id
+ })
this.cacheResourceList = resourceList
}
@@ -251,10 +260,9 @@
if (editor) {
editor.toTextArea() // Uninstall
editor.off($('.code-shell-mirror'), 'keypress', this.keypress)
- editor.off($('.code-shell-mirror'), 'changes', this.changes)
}
},
- components: { mLocalParams, mListBox, mResources, mScriptBox }
+ components: { mLocalParams, mListBox, mResources, mScriptBox, Treeselect }
}
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/createUdfFolder/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/createUdfFolder/index.vue
new file mode 100755
index 0000000000..2511452269
--- /dev/null
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/createUdfFolder/index.vue
@@ -0,0 +1,131 @@
+/*
+ * 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.
+ */
+
+
+
+
+
+ * {{$t('Folder Name')}}
+
+
+
+
+
+
+ {{$t('Description')}}
+
+
+
+
+
+
+
+
+
+ {{spinnerLoading ? 'Loading...' : $t('Create')}}
+ $router.push({name: 'resource-udf'})"> {{$t('Cancel')}}
+
+
+
+
+
+
+
+
+
+
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/details/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/details/index.vue
index e961d8b1ee..6875cd4b2e 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/details/index.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/details/index.vue
@@ -21,7 +21,7 @@
{{name}}
-
+
{{size}}
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/edit/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/edit/index.vue
index a0d1d7d187..0290af0988 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/edit/index.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/edit/index.vue
@@ -44,8 +44,8 @@
+
+
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subFileFolder/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subFileFolder/index.vue
new file mode 100755
index 0000000000..9f903a127b
--- /dev/null
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subFileFolder/index.vue
@@ -0,0 +1,144 @@
+/*
+ * 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.
+ */
+
+
+
+
+
+ * {{$t('Folder Name')}}
+
+
+
+
+
+
+
+ {{$t('Description')}}
+
+
+
+
+
+
+
+
+
+ {{spinnerLoading ? 'Loading...' : $t('Create')}}
+ $router.push({name: 'file'})"> {{$t('Cancel')}}
+
+
+
+
+
+
+
+
+
+
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subdirectory/_source/list.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subdirectory/_source/list.vue
new file mode 100755
index 0000000000..f5e801a205
--- /dev/null
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subdirectory/_source/list.vue
@@ -0,0 +1,251 @@
+/*
+ * 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.
+ */
+
+
+
+
+
+
+ {{$t('#')}}
+
+
+ {{$t('Name')}}
+
+
+ {{$t('Whether directory')}}
+
+
+ {{$t('File Name')}}
+
+
+ {{$t('Description')}}
+
+
+ {{$t('Size')}}
+
+
+ {{$t('Update Time')}}
+
+
+ {{$t('Operation')}}
+
+
+
+
+ {{parseInt(pageNo === 1 ? ($index + 1) : (($index + 1) + (pageSize * (pageNo - 1))))}}
+
+
+
+ {{item.alias}}
+
+
+
+ {{item.directory? $t('Yes') : $t('No')}}
+
+ {{item.fileName}}
+
+ {{item.description}}
+ -
+
+
+ {{_rtSize(item.size)}}
+
+
+ {{item.updateTime | formatDate}}
+ -
+
+
+
+
+
+
+
+
+
+
+
+ {{$t('Delete?')}}
+
+ {{$t('Cancel')}}
+ {{$t('Confirm')}}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subdirectory/_source/rename.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subdirectory/_source/rename.vue
new file mode 100755
index 0000000000..6f7dacae89
--- /dev/null
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subdirectory/_source/rename.vue
@@ -0,0 +1,120 @@
+/*
+ * 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.
+ */
+
+
+
+
+
+ * {{$t('Name')}}
+
+
+
+
+
+
+ {{$t('Description')}}
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subdirectory/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subdirectory/index.vue
new file mode 100755
index 0000000000..12be6b0bc8
--- /dev/null
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subdirectory/index.vue
@@ -0,0 +1,173 @@
+/*
+ * 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.
+ */
+
+
+
+
+
+
+
+ $router.push({path: `/resource/file/subFileFolder/${searchParams.id}`})">{{$t('Create folder')}}
+ $router.push({path: `/resource/file/subFile/${searchParams.id}`})">{{$t('Create File')}}
+ {{$t('Upload Files')}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/createUdfFolder/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/createUdfFolder/index.vue
new file mode 100755
index 0000000000..c707ce8c90
--- /dev/null
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/createUdfFolder/index.vue
@@ -0,0 +1,128 @@
+/*
+ * 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.
+ */
+
+
+
+
+
+ * {{$t('Folder Name')}}
+
+
+
+
+
+
+ {{$t('Description')}}
+
+
+
+
+
+
+
+
+
+ {{spinnerLoading ? 'Loading...' : $t('Create')}}
+ $router.push({name: 'resource-udf'})"> {{$t('Cancel')}}
+
+
+
+
+
+
+
+
+
+
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/function/_source/createUdf.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/function/_source/createUdf.vue
index 01d8d22650..1408c552db 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/function/_source/createUdf.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/function/_source/createUdf.vue
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-
+
@@ -72,26 +72,25 @@
* {{$t('UDF Resources')}}
-
-
-
-
+
+ {{ node.raw.fullName }}
+
{{$t('Upload Resources')}}
+
+ * {{$t('UDF resources directory')}}
+
+
+ {{ node.raw.fullName }}
+
+
+
@@ -115,6 +114,8 @@
import _ from 'lodash'
import i18n from '@/module/i18n'
import store from '@/conf/home/store'
+ import Treeselect from '@riophae/vue-treeselect'
+ import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import mPopup from '@/module/components/popup/popup'
import mListBoxF from '@/module/components/listBoxF/listBoxF'
import mUdfUpdate from '@/module/components/fileUpdate/udfUpdate'
@@ -130,10 +131,16 @@
argTypes: '',
database: '',
description: '',
- resourceId: '',
+ resourceId: null,
+ pid: null,
udfResourceList: [],
isUpdate: false,
- upDisabled: false
+ upDisabled: false,
+ normalizer(node) {
+ return {
+ label: node.name
+ }
+ },
}
},
props: {
@@ -192,17 +199,54 @@
// disabled update
this.upDisabled = true
},
+ // selTree
+ selTree(node) {
+ this.$refs.assignment.receivedValue(node.id,node.fullName)
+ },
/**
* get udf resources
*/
_getUdfList () {
return new Promise((resolve, reject) => {
this.store.dispatch('resource/getResourcesList', { type: 'UDF' }).then(res => {
- this.udfResourceList = res.data
+ let item = res.data
+ this.filterEmptyDirectory(item)
+ item = this.filterEmptyDirectory(item)
+ let item1 = _.cloneDeep(res.data)
+ this.diGuiTree(item)
+
+ this.diGuiTree(this.filterJarFile(item1))
+ this.udfResourceList = item
+ this.udfResourceDirList = item1
resolve()
})
})
},
+ // filterEmptyDirectory
+ filterEmptyDirectory(array) {
+ for (const item of array) {
+ if (item.children) {
+ this.filterEmptyDirectory(item.children)
+ }
+ }
+ return array.filter(n => ((/\.jar$/.test(n.name) && n.children.length==0) || (!/\.jar$/.test(n.name) && n.children.length>0)))
+ },
+ // filterJarFile
+ filterJarFile (array) {
+ for (const item of array) {
+ if (item.children) {
+ item.children = this.filterJarFile(item.children)
+ }
+ }
+ return array.filter(n => !/\.jar$/.test(n.name))
+ },
+ // diGuiTree
+ diGuiTree(item) { // Recursive convenience tree structure
+ item.forEach(item => {
+ item.children === '' || item.children === undefined || item.children === null || item.children.length === 0?
+ delete item.children : this.diGuiTree(item.children);
+ })
+ },
/**
* Upload udf resources
*/
@@ -257,8 +301,7 @@
})
}
},
- watch: {
- },
+ watch: {},
created () {
this._getUdfList().then(res => {
// edit
@@ -271,13 +314,18 @@
this.description = this.item.description || ''
this.resourceId = this.item.resourceId
} else {
- this.resourceId = this.udfResourceList.length && this.udfResourceList[0].id || ''
+ this.resourceId = null
}
})
},
mounted () {
},
- components: { mPopup, mListBoxF, mUdfUpdate }
+ components: { mPopup, mListBoxF, mUdfUpdate, Treeselect }
}
+
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/function/_source/list.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/function/_source/list.vue
index ed441baad0..d77f55722e 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/function/_source/list.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/function/_source/list.vue
@@ -43,7 +43,7 @@ v-ps
-
+
{{$t('Update Time')}}
@@ -71,7 +71,8 @@ v-ps
-
- {{item.resourceName}}
+ {{item.resourceName}}
+ -
+
+
+ * {{$t('File Name')}}
+
+
+
+
+
+
+ {{$t('Description')}}
+
+
+
+
+
+
+ * {{$t('Upload Files')}}
+
+
+
+
+ {{$t('Upload')}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dolphinscheduler-ui/src/js/module/components/fileUpdate/fileUpdate.vue b/dolphinscheduler-ui/src/js/module/components/fileUpdate/fileUpdate.vue
index b7cef4ecfb..5e06ddacce 100644
--- a/dolphinscheduler-ui/src/js/module/components/fileUpdate/fileUpdate.vue
+++ b/dolphinscheduler-ui/src/js/module/components/fileUpdate/fileUpdate.vue
@@ -107,6 +107,8 @@
progress: 0,
// file
file: '',
+ currentDir: '/',
+ pid: -1,
// Whether to drag upload
dragOver: false
}
@@ -124,7 +126,7 @@
this.$refs['popup'].spinnerLoading = true
if (this._validation()) {
this.store.dispatch('resource/resourceVerifyName', {
- name: this.name,
+ fullName: '/'+this.name,
type: this.type
}).then(res => {
const isLt1024M = this.file.size / 1024 / 1024 < 1024
@@ -172,6 +174,8 @@
formData.append('file', this.file)
formData.append('type', this.type)
formData.append('name', this.name)
+ formData.append('pid', this.pid)
+ formData.append('currentDir', this.currentDir)
formData.append('description', this.description)
io.post(`resources/create`, res => {
this.$message.success(res.msg)
diff --git a/dolphinscheduler-ui/src/js/module/components/fileUpdate/resourceChildUpdate.vue b/dolphinscheduler-ui/src/js/module/components/fileUpdate/resourceChildUpdate.vue
new file mode 100755
index 0000000000..05d12b15e1
--- /dev/null
+++ b/dolphinscheduler-ui/src/js/module/components/fileUpdate/resourceChildUpdate.vue
@@ -0,0 +1,318 @@
+/*
+ * 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.
+ */
+
+
+
+
+
+
+
+
+
+
diff --git a/dolphinscheduler-ui/src/js/module/components/fileUpdate/udfUpdate.vue b/dolphinscheduler-ui/src/js/module/components/fileUpdate/udfUpdate.vue
index 4285df5720..7c852c5caa 100644
--- a/dolphinscheduler-ui/src/js/module/components/fileUpdate/udfUpdate.vue
+++ b/dolphinscheduler-ui/src/js/module/components/fileUpdate/udfUpdate.vue
@@ -25,7 +25,7 @@
size="small"
v-model="udfName"
:disabled="progress !== 0"
- style="width: 268px"
+ style="width: 535px"
:placeholder="$t('Please enter resource name')"
autocomplete="off">
@@ -66,7 +66,9 @@
udfDesc: '',
file: '',
progress: 0,
- spinnerLoading: false
+ spinnerLoading: false,
+ pid: null,
+ currentDir: ''
}
},
props: {
@@ -77,6 +79,10 @@
* validation
*/
_validation () {
+ if (!this.currentDir) {
+ this.$message.warning(`${i18n.$t('Please select UDF resources directory')}`)
+ return false
+ }
if (!this.udfName) {
this.$message.warning(`${i18n.$t('Please enter file name')}`)
return false
@@ -90,7 +96,7 @@
_verifyName () {
return new Promise((resolve, reject) => {
this.store.dispatch('resource/resourceVerifyName', {
- name: this.udfName,
+ fullName: '/'+this.udfName,
type: 'UDF'
}).then(res => {
resolve()
@@ -100,11 +106,17 @@
})
})
},
+ receivedValue(pid,name) {
+ this.pid = pid
+ this.currentDir = name
+ },
_formDataUpdate () {
let self = this
let formData = new FormData()
formData.append('file', this.file)
formData.append('type', 'UDF')
+ formData.append('pid', this.pid)
+ formData.append('currentDir', this.currentDir)
formData.append('name', this.udfName)
formData.append('description', this.udfDesc)
this.spinnerLoading = true
diff --git a/dolphinscheduler-ui/src/js/module/components/nav/nav.vue b/dolphinscheduler-ui/src/js/module/components/nav/nav.vue
index 7212f5146a..a46ff6fe74 100644
--- a/dolphinscheduler-ui/src/js/module/components/nav/nav.vue
+++ b/dolphinscheduler-ui/src/js/module/components/nav/nav.vue
@@ -155,6 +155,8 @@
import { mapState, mapActions } from 'vuex'
import { findComponentDownward } from '@/module/util/'
import mFileUpdate from '@/module/components/fileUpdate/fileUpdate'
+ import mFileChildUpdate from '@/module/components/fileUpdate/fileChildUpdate'
+ import mResourceChildUpdate from '@/module/components/fileUpdate/resourceChildUpdate'
import mDefinitionUpdate from '@/module/components/fileUpdate/definitionUpdate'
import mProgressBar from '@/module/components/progressBar/progressBar'
@@ -260,6 +262,86 @@
}
})
},
+ _fileChildUpdate (type,data) {
+ if (this.progress) {
+ this._toggleArchive()
+ return
+ }
+ let self = this
+ let modal = this.$modal.dialog({
+ closable: false,
+ showMask: true,
+ escClose: true,
+ className: 'update-file-modal',
+ transitionName: 'opacityp',
+ render (h) {
+ return h(mFileChildUpdate, {
+ on: {
+ onProgress (val) {
+ self.progress = val
+ },
+ onUpdate () {
+ findComponentDownward(self.$root, `resource-list-index-${type}`)._updateList(data)
+ self.isUpdate = false
+ self.progress = 0
+ modal.remove()
+ },
+ onArchive () {
+ self.isUpdate = true
+ },
+ close () {
+ self.progress = 0
+ modal.remove()
+ }
+ },
+ props: {
+ type: type,
+ id: data
+ }
+ })
+ }
+ })
+ },
+ _resourceChildUpdate (type,data) {
+ if (this.progress) {
+ this._toggleArchive()
+ return
+ }
+ let self = this
+ let modal = this.$modal.dialog({
+ closable: false,
+ showMask: true,
+ escClose: true,
+ className: 'update-file-modal',
+ transitionName: 'opacityp',
+ render (h) {
+ return h(mResourceChildUpdate, {
+ on: {
+ onProgress (val) {
+ self.progress = val
+ },
+ onUpdate () {
+ findComponentDownward(self.$root, `resource-list-index-${type}`)._updateList(data)
+ self.isUpdate = false
+ self.progress = 0
+ modal.remove()
+ },
+ onArchive () {
+ self.isUpdate = true
+ },
+ close () {
+ self.progress = 0
+ modal.remove()
+ }
+ },
+ props: {
+ type: type,
+ id: data
+ }
+ })
+ }
+ })
+ },
/**
* Upload popup layer display
*/
diff --git a/dolphinscheduler-ui/src/js/module/components/secondaryMenu/_source/menu.js b/dolphinscheduler-ui/src/js/module/components/secondaryMenu/_source/menu.js
index 2ed0fc1234..baf2cf7808 100644
--- a/dolphinscheduler-ui/src/js/module/components/secondaryMenu/_source/menu.js
+++ b/dolphinscheduler-ui/src/js/module/components/secondaryMenu/_source/menu.js
@@ -148,13 +148,13 @@ let menu = {
children: [
{
name: `${i18n.$t('Resource manage')}`,
- path: 'resource-udf-resource',
+ path: 'resource-udf',
id: 0,
disabled: true
},
{
name: `${i18n.$t('Function manage')}`,
- path: 'resource-udf-function',
+ path: 'resource-func',
id: 1,
disabled: true
}
diff --git a/dolphinscheduler-ui/src/js/module/components/transfer/resource.vue b/dolphinscheduler-ui/src/js/module/components/transfer/resource.vue
index 72205dec4d..97397c1809 100644
--- a/dolphinscheduler-ui/src/js/module/components/transfer/resource.vue
+++ b/dolphinscheduler-ui/src/js/module/components/transfer/resource.vue
@@ -20,26 +20,21 @@
- {{$t('File resources')}}
- {{$t('UDF resources')}}
+ {{$t('File resources')}}
+ {{$t('UDF resources')}}
-
+
+ {{ node.raw.fullName }}
+
+
+ {{ node.raw.fullName }}
+
+
-
-
+
-->
@@ -80,6 +64,9 @@
import _ from 'lodash'
import mPopup from '@/module/components/popup/popup'
import mListBoxF from '@/module/components/listBoxF/listBoxF'
+ import Treeselect from '@riophae/vue-treeselect'
+ import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+
export default {
name: 'transfer',
@@ -92,11 +79,22 @@
cacheTargetList: this.fileTargetList,
fileSource: this.fileSourceList,
+ fileList: [],
+ udfList: [],
+ selectFileSource: [],
+ selectUdfSource: [],
fileTarget: this.fileTargetList,
udfSource: this.udfSourceList,
udfTarget: this.udfTargetList,
searchSourceVal: '',
- searchTargetVal: ''
+ searchTargetVal: '',
+ // define default value
+ value: null,
+ normalizer(node) {
+ return {
+ label: node.name
+ }
+ },
}
},
props: {
@@ -106,12 +104,22 @@
fileTargetList: Array,
udfTargetList: Array,
},
+ created() {
+ let file = this.fileSourceList
+ let udf = this.udfSourceList
+ this.diGuiTree(file)
+ this.diGuiTree(udf)
+ this.fileList = file
+ this.udfList = udf
+ this.selectFileSource = this.fileTargetList
+ this.selectUdfSource = this.udfTargetList
+ },
methods: {
_ok () {
this.$refs['popup'].spinnerLoading = true
setTimeout(() => {
this.$refs['popup'].spinnerLoading = false
- this.$emit('onUpdate', _.map(this.fileTarget.concat(this.udfTarget), v => v.id).join(','))
+ this.$emit('onUpdate', _.map(this.selectFileSource.concat(this.selectUdfSource), v => v).join(','))
}, 800)
},
_ckFile() {
@@ -169,6 +177,12 @@
this.udfSource = this.sourceList
this.udfTarget = this.targetList
}
+ },
+ diGuiTree(item) { // Recursive convenience tree structure
+ item.forEach(item => {
+ item.children === '' || item.children === undefined || item.children === null || item.children.length === 0?
+ delete item.children : this.diGuiTree(item.children);
+ })
}
},
watch: {
@@ -187,7 +201,7 @@
this._targetQuery()
}
},
- components: { mPopup, mListBoxF }
+ components: { mPopup, mListBoxF, Treeselect }
}
diff --git a/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js b/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
index 819af7c120..53a40af091 100755
--- a/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
+++ b/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
@@ -138,6 +138,7 @@ export default {
'jdbc connect parameters': 'jdbc connect parameters',
'Test Connect': 'Test Connect',
'Please enter resource name': 'Please enter resource name',
+ 'Please enter resource folder name': 'Please enter resource folder name',
'Please enter a non-query SQL statement': 'Please enter a non-query SQL statement',
'Please enter IP/hostname': 'Please enter IP/hostname',
'jdbc connection parameters is not a correct JSON format': 'jdbc connection parameters is not a correct JSON format',
@@ -183,6 +184,8 @@ export default {
'Authorize': 'Authorize',
'File resources': 'File resources',
'UDF resources': 'UDF resources',
+ 'Please select UDF resources directory': 'Please select UDF resources directory',
+ 'UDF resources directory' : 'UDF resources directory',
'Upload File Size': 'Upload File size cannot exceed 1g',
'Edit alarm group': 'Edit alarm group',
'Create alarm group': 'Create alarm group',
@@ -226,8 +229,11 @@ export default {
'execution': 'execution',
'finish': 'finish',
'Create File': 'Create File',
+ 'Create folder': 'Create folder',
'File Name': 'File Name',
+ 'Folder Name': 'Folder Name',
'File Format': 'File Format',
+ 'Folder Format': 'Folder Format',
'File Content': 'File Content',
'Create': 'Create',
'Please enter the resource content': 'Please enter the resource content',
@@ -274,6 +280,9 @@ export default {
'Edit UDF Function': 'Edit UDF Function',
'type': 'type',
'UDF Function Name': 'UDF Function Name',
+ 'FILE': 'FILE',
+ 'UDF': 'UDF',
+ 'File Subdirectory': 'File Subdirectory',
'Please enter a function name': 'Please enter a function name',
'Package Name': 'Package Name',
'Please enter a Package name': 'Please enter a Package name',
@@ -523,6 +532,10 @@ export default {
'0 means unlimited by byte': '0 means unlimited',
'0 means unlimited by count': '0 means unlimited',
'Modify User': 'Modify User',
+ 'Whether directory': 'Whether directory',
+ 'Yes': 'Yes',
+ 'No': 'No',
+ 'Modify User': 'Modify User',
'Please enter Mysql Database(required)': 'Please enter Mysql Database(required)',
'Please enter Mysql Table(required)': 'Please enter Mysql Table(required)',
'Please enter Columns (Comma separated)': 'Please enter Columns (Comma separated)',
diff --git a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
index fe67bae375..9b78f36ed3 100755
--- a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
+++ b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
@@ -120,6 +120,9 @@ export default {
'SQL Parameter': 'sql参数',
'SQL Statement': 'sql语句',
'UDF Function': 'UDF函数',
+ 'FILE': '文件',
+ 'UDF': 'UDF',
+ 'File Subdirectory': '文件子目录',
'Please enter a SQL Statement(required)': '请输入sql语句(必填)',
'Please enter a JSON Statement(required)': '请输入json语句(必填)',
'One form or attachment must be selected': '表格、附件必须勾选一个',
@@ -139,6 +142,7 @@ export default {
'jdbc connect parameters': 'jdbc连接参数',
'Test Connect': '测试连接',
'Please enter resource name': '请输入数据源名称',
+ 'Please enter resource folder name': '请输入资源文件夹名称',
'Please enter a non-query SQL statement': '请输入非查询sql语句',
'Please enter IP/hostname': '请输入IP/主机名',
'jdbc connection parameters is not a correct JSON format': 'jdbc连接参数不是一个正确的JSON格式',
@@ -182,6 +186,8 @@ export default {
'Authorize': '授权',
'File resources': '文件资源',
'UDF resources': 'UDF资源',
+ 'UDF resources directory': 'UDF资源目录',
+ 'Please select UDF resources directory': '请选择UDF资源目录',
'Edit alarm group': '编辑告警组',
'Create alarm group': '创建告警组',
'Group Name': '组名称',
@@ -224,8 +230,11 @@ export default {
'execution': '执行中',
'finish': '完成',
'Create File': '创建文件',
+ 'Create folder': '创建文件夹',
'File Name': '文件名称',
+ 'Folder Name': '文件夹名称',
'File Format': '文件格式',
+ 'Folder Format': '文件夹格式',
'File Content': '文件内容',
'Upload File Size': '文件大小不能超过1G',
'Create': '创建',
@@ -523,6 +532,10 @@ export default {
'0 means unlimited by byte': 'KB,0代表不限制',
'0 means unlimited by count': '0代表不限制',
'Modify User': '修改用户',
+ 'Whether directory' : '是否文件夹',
+ 'Yes': '是',
+ 'No': '否',
+ 'Modify User': '修改用户',
'Please enter Mysql Database(required)': '请输入Mysql数据库(必填)',
'Please enter Mysql Table(required)': '请输入Mysql表名(必填)',
'Please enter Columns (Comma separated)': '请输入列名,用 , 隔开',
diff --git a/dolphinscheduler-ui/src/js/module/util/routerUtil.js b/dolphinscheduler-ui/src/js/module/util/routerUtil.js
index 7ae91f0c22..c19a8e7609 100644
--- a/dolphinscheduler-ui/src/js/module/util/routerUtil.js
+++ b/dolphinscheduler-ui/src/js/module/util/routerUtil.js
@@ -19,7 +19,7 @@ import merge from 'webpack-merge'
import router from '@/conf/home/router'
export function setUrlParams (o) {
- router.push({
- query: merge(router.history.current.query, o)
- })
+ // router.push({
+ // query: merge(router.history.current.query, o)
+ // })
}
diff --git a/dolphinscheduler-ui/src/sass/common/_mixin.scss b/dolphinscheduler-ui/src/sass/common/_mixin.scss
deleted file mode 100644
index c6a5afeef5..0000000000
--- a/dolphinscheduler-ui/src/sass/common/_mixin.scss
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
\ No newline at end of file
diff --git a/dolphinscheduler-ui/src/sass/common/index.scss b/dolphinscheduler-ui/src/sass/common/index.scss
index 403f3c6980..8e47b033cb 100644
--- a/dolphinscheduler-ui/src/sass/common/index.scss
+++ b/dolphinscheduler-ui/src/sass/common/index.scss
@@ -14,8 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
-@import "mixin";
@import "animation";
@import "scrollbar";
@import "table";
From 92d944eddee86dfb4a5860c27cad87d878f3c65d Mon Sep 17 00:00:00 2001
From: break60 <790061044@qq.com>
Date: Tue, 31 Mar 2020 09:08:30 +0800
Subject: [PATCH 09/21] Modify ans-ui version and timing management style
---
dolphinscheduler-ui/package.json | 2 +-
.../pages/definition/pages/list/_source/timing.vue | 7 +++++++
.../projects/pages/instance/pages/list/_source/list.vue | 8 ++++----
3 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/dolphinscheduler-ui/package.json b/dolphinscheduler-ui/package.json
index 6b139fa880..b23969803b 100644
--- a/dolphinscheduler-ui/package.json
+++ b/dolphinscheduler-ui/package.json
@@ -12,7 +12,7 @@
},
"dependencies": {
"@riophae/vue-treeselect": "^0.4.0",
- "ans-ui": "1.1.7",
+ "ans-ui": "1.1.9",
"axios": "^0.16.2",
"bootstrap": "3.3.7",
"canvg": "1.5.1",
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue
index 16f7020939..ad87c5ae85 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue
@@ -413,4 +413,11 @@
padding: 0;
}
}
+ .x-date-packer-panel .x-date-packer-day .lattice label.bg-hover {
+ background: #00BFFF!important;
+ margin-top: -4px;
+ }
+ .x-date-packer-panel .x-date-packer-day .lattice em:hover {
+ background: #0098e1!important;
+ }
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/_source/list.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/_source/list.vue
index 57ae6bd685..c5992de20f 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/_source/list.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/_source/list.vue
@@ -22,13 +22,13 @@
-
+
{{$t('#')}}
-
+
{{$t('Process Name')}}
-
+
{{$t('Executor')}}
@@ -71,7 +71,7 @@
{{item.name}}
- {{item.executorName}}
+ {{item.executorName}}
-
{{_rtRunningType(item.commandType)}}
From b7bf172d623b4ab2adc339be9b897a9cfdcb4ed6 Mon Sep 17 00:00:00 2001
From: break60 <790061044@qq.com>
Date: Tue, 31 Mar 2020 10:55:24 +0800
Subject: [PATCH 10/21] Supplemental licenses and repair resources cannot be
renamed
---
dolphinscheduler-dist/release-docs/LICENSE | 2 ++
.../licenses/ui-licenses/LICENSE-normalize | 8 ++++++++
.../ui-licenses/LICENSE-vue-treeselect | 20 +++++++++++++++++++
.../pages/file/pages/list/_source/list.vue | 3 +--
.../pages/file/pages/list/_source/rename.vue | 7 +++----
.../pages/udf/pages/resource/_source/list.vue | 3 +--
.../udf/pages/resource/_source/rename.vue | 6 +++---
7 files changed, 38 insertions(+), 11 deletions(-)
create mode 100644 dolphinscheduler-dist/release-docs/licenses/ui-licenses/LICENSE-normalize
create mode 100644 dolphinscheduler-dist/release-docs/licenses/ui-licenses/LICENSE-vue-treeselect
diff --git a/dolphinscheduler-dist/release-docs/LICENSE b/dolphinscheduler-dist/release-docs/LICENSE
index 97946d1172..82e641ec72 100644
--- a/dolphinscheduler-dist/release-docs/LICENSE
+++ b/dolphinscheduler-dist/release-docs/LICENSE
@@ -518,6 +518,8 @@ MIT licenses
js-cookie 2.2.1: https://github.com/js-cookie/js-cookie MIT
jsplumb 2.8.6: https://github.com/jsplumb/jsplumb MIT and GPLv2
lodash 4.17.11: https://github.com/lodash/lodash MIT
+ normalize.css 8.0.1: https://github.com/necolas/normalize.css MIT
+ vue-treeselect 0.4.0: https://github.com/riophae/vue-treeselect MIT
vue 2.5.17: https://github.com/vuejs/vue MIT
vue-router 2.7.0: https://github.com/vuejs/vue-router MIT
vuex 3.0.0: https://github.com/vuejs/vuex MIT
diff --git a/dolphinscheduler-dist/release-docs/licenses/ui-licenses/LICENSE-normalize b/dolphinscheduler-dist/release-docs/licenses/ui-licenses/LICENSE-normalize
new file mode 100644
index 0000000000..90e0c091a5
--- /dev/null
+++ b/dolphinscheduler-dist/release-docs/licenses/ui-licenses/LICENSE-normalize
@@ -0,0 +1,8 @@
+The MIT License (MIT)
+Copyright © Nicolas Gallagher and Jonathan Neal
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/dolphinscheduler-dist/release-docs/licenses/ui-licenses/LICENSE-vue-treeselect b/dolphinscheduler-dist/release-docs/licenses/ui-licenses/LICENSE-vue-treeselect
new file mode 100644
index 0000000000..f7d8cc3ebd
--- /dev/null
+++ b/dolphinscheduler-dist/release-docs/licenses/ui-licenses/LICENSE-vue-treeselect
@@ -0,0 +1,20 @@
+Copyright (c) 2017-present Riophae Lee
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/list.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/list.vue
index 3bc1bfac24..4ccfa2eff3 100755
--- a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/list.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/list.vue
@@ -134,7 +134,6 @@
import { bytesToSize } from '@/module/util/util'
import { downloadFile } from '@/module/download'
import localStore from '@/module/util/localStorage'
-
export default {
name: 'file-manage-list',
data () {
@@ -238,4 +237,4 @@
},
components: { }
}
-
+
\ No newline at end of file
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/rename.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/rename.vue
index ad33503532..f7639bb959 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/rename.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/rename.vue
@@ -47,9 +47,9 @@
+
\ No newline at end of file
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/resource/_source/list.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/resource/_source/list.vue
index ddb097ee0f..362a3f6727 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/resource/_source/list.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/resource/_source/list.vue
@@ -128,7 +128,6 @@
import { downloadFile } from '@/module/download'
import { bytesToSize } from '@/module/util/util'
import localStore from '@/module/util/localStorage'
-
export default {
name: 'udf-manage-list',
data () {
@@ -215,4 +214,4 @@
},
components: { }
}
-
+
\ No newline at end of file
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/resource/_source/rename.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/resource/_source/rename.vue
index 69acdef4a5..359a16a29f 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/resource/_source/rename.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/resource/_source/rename.vue
@@ -48,9 +48,9 @@
+
\ No newline at end of file
From 4db2ac232a32d286164e1f33f030130d4696ed16 Mon Sep 17 00:00:00 2001
From: BoYiZhang <39816903+BoYiZhang@users.noreply.github.com>
Date: Tue, 31 Mar 2020 21:08:59 +0800
Subject: [PATCH 11/21] Remove invalid code (#2342)
Co-authored-by: zhanglong
Co-authored-by: dailidong
---
.../dolphinscheduler/api/controller/ResourcesController.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java
index 40effb641d..1d83fcea2b 100644
--- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java
+++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java
@@ -154,8 +154,7 @@ public class ResourcesController extends BaseController{
@ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType ="Int", example = "100"),
@ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataType ="ResourceType"),
@ApiImplicitParam(name = "name", value = "RESOURCE_NAME", required = true, dataType ="String"),
- @ApiImplicitParam(name = "description", value = "RESOURCE_DESC", dataType ="String"),
- @ApiImplicitParam(name = "file", value = "RESOURCE_FILE", required = true,dataType = "MultipartFile")
+ @ApiImplicitParam(name = "description", value = "RESOURCE_DESC", dataType ="String")
})
@PostMapping(value = "/update")
public Result updateResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
From f60edc8e615d7e0b02b8ceb7504d38252c8f51b1 Mon Sep 17 00:00:00 2001
From: Rubik-W <39549317+Rubik-W@users.noreply.github.com>
Date: Tue, 31 Mar 2020 21:58:15 +0800
Subject: [PATCH 12/21] =?UTF-8?q?fix=EF=BC=9Amail=20send=20fail=20#2345=20?=
=?UTF-8?q?(#2346)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: dailidong
---
.../dolphinscheduler/alert/utils/ExcelUtils.java | 5 +++++
.../dolphinscheduler/alert/utils/ExcelUtilsTest.java | 10 ++++++++++
2 files changed, 15 insertions(+)
diff --git a/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/utils/ExcelUtils.java b/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/utils/ExcelUtils.java
index b2e71a8980..366e2828c5 100644
--- a/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/utils/ExcelUtils.java
+++ b/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/utils/ExcelUtils.java
@@ -26,6 +26,7 @@ import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.*;
@@ -102,7 +103,11 @@ public class ExcelUtils {
for (int i = 0; i < headerList.size(); i++) {
sheet.setColumnWidth(i, headerList.get(i).length() * 800);
+ }
+ File file = new File(xlsFilePath);
+ if (!file.exists()) {
+ file.mkdirs();
}
//setting file output
diff --git a/dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/utils/ExcelUtilsTest.java b/dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/utils/ExcelUtilsTest.java
index 3ef43aeef4..8ee62358dd 100644
--- a/dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/utils/ExcelUtilsTest.java
+++ b/dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/utils/ExcelUtilsTest.java
@@ -89,4 +89,14 @@ public class ExcelUtilsTest {
ExcelUtils.genExcelFile(incorrectContent1, title, xlsFilePath);
}
+
+ /**
+ * Test GenExcelFile (check directory)
+ */
+ @Test
+ public void testGenExcelFileByCheckDir() {
+ ExcelUtils.genExcelFile("[{\"a\": \"a\"},{\"a\": \"a\"}]", "t", "/tmp/xls");
+ File file = new File("/tmp/xls" + Constants.SINGLE_SLASH + "t" + Constants.EXCEL_SUFFIX_XLS);
+ file.delete();
+ }
}
\ No newline at end of file
From db30721f5ed6a2e07d2e02b59ce27e3f486d7309 Mon Sep 17 00:00:00 2001
From: lgcareer <18610854716@163.com>
Date: Wed, 1 Apr 2020 11:56:28 +0800
Subject: [PATCH 13/21] init full_name in dml of version 1.2.2 (#2341)
Co-authored-by: dailidong
---
sql/upgrade/1.2.2_schema/mysql/dolphinscheduler_dml.sql | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/sql/upgrade/1.2.2_schema/mysql/dolphinscheduler_dml.sql b/sql/upgrade/1.2.2_schema/mysql/dolphinscheduler_dml.sql
index 38964cc551..7fb3bc2fd5 100644
--- a/sql/upgrade/1.2.2_schema/mysql/dolphinscheduler_dml.sql
+++ b/sql/upgrade/1.2.2_schema/mysql/dolphinscheduler_dml.sql
@@ -13,4 +13,8 @@
* 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.
-*/
\ No newline at end of file
+*/
+SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
+SET FOREIGN_KEY_CHECKS=0;
+UPDATE t_ds_resources SET pid=-1,is_directory=false WHERE pid IS NULL;
+UPDATE t_ds_resources SET full_name = concat('/',alias) WHERE pid=-1 and full_name IS NULL;
\ No newline at end of file
From 8561d65b2b48a0ddbd2fdc8f46b21fa486d2dfd9 Mon Sep 17 00:00:00 2001
From: break60 <790061044@qq.com>
Date: Wed, 1 Apr 2020 17:38:57 +0800
Subject: [PATCH 14/21] Corrections to historical jar packages and resource
data
---
.../dag/_source/formModel/tasks/flink.vue | 36 ++++++++++++++++--
.../pages/dag/_source/formModel/tasks/mr.vue | 36 ++++++++++++++++--
.../dag/_source/formModel/tasks/python.vue | 15 +++++++-
.../dag/_source/formModel/tasks/shell.vue | 17 +++++++--
.../dag/_source/formModel/tasks/spark.vue | 38 +++++++++++++++++--
.../instance/pages/list/_source/list.vue | 2 +-
.../src/js/conf/home/store/dag/actions.js | 13 ++++++-
7 files changed, 139 insertions(+), 18 deletions(-)
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/flink.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/flink.vue
index ac04e2187d..abf04571fd 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/flink.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/flink.vue
@@ -218,6 +218,19 @@
},
mixins: [disabledState],
methods: {
+ /**
+ * getResourceId
+ */
+ marjarId(name) {
+ this.store.dispatch('dag/getResourceId',{
+ type: 'FILE',
+ fullName: '/'+name
+ }).then(res => {
+ this.mainJar = res.id
+ }).catch(e => {
+ this.$message.error(e.msg || '')
+ })
+ },
/**
* return localParams
*/
@@ -366,7 +379,13 @@
// Non-null objects represent backfill
if (!_.isEmpty(o)) {
this.mainClass = o.params.mainClass || ''
- this.mainJar = o.params.mainJar && o.params.mainJar.id ? o.params.mainJar.id : ''
+ if(o.params.mainJar.res) {
+ this.marjarId(o.params.mainJar.res)
+ } else if(o.params.mainJar.res=='') {
+ this.mainJar = ''
+ } else {
+ this.mainJar = o.params.mainJar.id || ''
+ }
this.deployMode = o.params.deployMode || ''
this.slot = o.params.slot || 1
this.taskManager = o.params.taskManager || '2'
@@ -380,8 +399,19 @@
// backfill resourceList
let resourceList = o.params.resourceList || []
if (resourceList.length) {
- this.resourceList = _.map(resourceList, v => {
- return v.id
+ _.map(resourceList, v => {
+ if(v.res) {
+ this.store.dispatch('dag/getResourceId',{
+ type: 'FILE',
+ fullName: '/'+v.res
+ }).then(res => {
+ this.resourceList.push(res.id)
+ }).catch(e => {
+ this.$message.error(e.msg || '')
+ })
+ } else {
+ this.resourceList.push(v.id)
+ }
})
this.cacheResourceList = resourceList
}
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue
index 3691985d7d..121147d7e5 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue
@@ -142,6 +142,19 @@
},
mixins: [disabledState],
methods: {
+ /**
+ * getResourceId
+ */
+ marjarId(name) {
+ this.store.dispatch('dag/getResourceId',{
+ type: 'FILE',
+ fullName: '/'+name
+ }).then(res => {
+ this.mainJar = res.id
+ }).catch(e => {
+ this.$message.error(e.msg || '')
+ })
+ },
/**
* return localParams
*/
@@ -245,7 +258,13 @@
// Non-null objects represent backfill
if (!_.isEmpty(o)) {
this.mainClass = o.params.mainClass || ''
- this.mainJar = o.params.mainJar.id || ''
+ if(o.params.mainJar.res) {
+ this.marjarId(o.params.mainJar.res)
+ } else if(o.params.mainJar.res=='') {
+ this.mainJar = ''
+ } else {
+ this.mainJar = o.params.mainJar.id || ''
+ }
this.mainArgs = o.params.mainArgs || ''
this.others = o.params.others
this.programType = o.params.programType || 'JAVA'
@@ -253,8 +272,19 @@
// backfill resourceList
let resourceList = o.params.resourceList || []
if (resourceList.length) {
- this.resourceList = _.map(resourceList, v => {
- return v.id
+ _.map(resourceList, v => {
+ if(v.res) {
+ this.store.dispatch('dag/getResourceId',{
+ type: 'FILE',
+ fullName: '/'+v.res
+ }).then(res => {
+ this.resourceList.push(res.id)
+ }).catch(e => {
+ this.$message.error(e.msg || '')
+ })
+ } else {
+ this.resourceList.push(v.id)
+ }
})
this.cacheResourceList = resourceList
}
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue
index e8e7e58771..10cad6cb38 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue
@@ -176,8 +176,19 @@
// backfill resourceList
let resourceList = o.params.resourceList || []
if (resourceList.length) {
- this.resourceList = _.map(resourceList, v => {
- return v.id
+ _.map(resourceList, v => {
+ if(v.res) {
+ this.store.dispatch('dag/getResourceId',{
+ type: 'FILE',
+ fullName: '/'+v.res
+ }).then(res => {
+ this.resourceList.push(res.id)
+ }).catch(e => {
+ this.$message.error(e.msg || '')
+ })
+ } else {
+ this.resourceList.push(v.id)
+ }
})
this.cacheResourceList = resourceList
}
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue
index 952fd3a38d..fef1579db0 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue
@@ -96,6 +96,7 @@
label: node.name
}
},
+ id: null
}
},
mixins: [disabledState],
@@ -238,12 +239,22 @@
// backfill resourceList
let resourceList = o.params.resourceList || []
if (resourceList.length) {
- this.resourceList = _.map(resourceList, v => {
- return v.id
+ _.map(resourceList, v => {
+ if(v.res) {
+ this.store.dispatch('dag/getResourceId',{
+ type: 'FILE',
+ fullName: '/'+v.res
+ }).then(res => {
+ this.resourceList.push(res.id)
+ }).catch(e => {
+ this.$message.error(e.msg || '')
+ })
+ } else {
+ this.resourceList.push(v.id)
+ }
})
this.cacheResourceList = resourceList
}
-
// backfill localParams
let localParams = o.params.localParams || []
if (localParams.length) {
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/spark.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/spark.vue
index de7a21d990..61662d96bc 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/spark.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/spark.vue
@@ -261,6 +261,19 @@
},
mixins: [disabledState],
methods: {
+ /**
+ * getResourceId
+ */
+ marjarId(name) {
+ this.store.dispatch('dag/getResourceId',{
+ type: 'FILE',
+ fullName: '/'+name
+ }).then(res => {
+ this.mainJar = res.id
+ }).catch(e => {
+ this.$message.error(e.msg || '')
+ })
+ },
/**
* return localParams
*/
@@ -414,7 +427,13 @@
// Non-null objects represent backfill
if (!_.isEmpty(o)) {
this.mainClass = o.params.mainClass || ''
- this.mainJar = o.params.mainJar && o.params.mainJar.id ? o.params.mainJar.id : ''
+ if(o.params.mainJar.res) {
+ this.marjarId(o.params.mainJar.res)
+ } else if(o.params.mainJar.res=='') {
+ this.mainJar = ''
+ } else {
+ this.mainJar = o.params.mainJar.id || ''
+ }
this.deployMode = o.params.deployMode || ''
this.driverCores = o.params.driverCores || 1
this.driverMemory = o.params.driverMemory || '512M'
@@ -429,9 +448,20 @@
// backfill resourceList
let resourceList = o.params.resourceList || []
if (resourceList.length) {
- this.resourceList = _.map(resourceList, v => {
- return v.id
- })
+ _.map(resourceList, v => {
+ if(v.res) {
+ this.store.dispatch('dag/getResourceId',{
+ type: 'FILE',
+ fullName: '/'+v.res
+ }).then(res => {
+ this.resourceList.push(res.id)
+ }).catch(e => {
+ this.$message.error(e.msg || '')
+ })
+ } else {
+ this.resourceList.push(v.id)
+ }
+ })
this.cacheResourceList = resourceList
}
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/_source/list.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/_source/list.vue
index c5992de20f..513b8ec6dd 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/_source/list.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/_source/list.vue
@@ -22,7 +22,7 @@
-
+
{{$t('#')}}
diff --git a/dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js b/dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js
index 50295ad4b1..1f43383c8c 100644
--- a/dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js
+++ b/dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js
@@ -715,5 +715,14 @@ export default {
reject(e)
})
})
- }
-}
+ },
+ getResourceId ({ state }, payload) {
+ return new Promise((resolve, reject) => {
+ io.get(`resources/queryResource`, payload, res => {
+ resolve(res.data)
+ }).catch(e => {
+ reject(e)
+ })
+ })
+ },
+}
\ No newline at end of file
From 8da2a50d1621090926c989f40c465d6d00fab141 Mon Sep 17 00:00:00 2001
From: break60 <790061044@qq.com>
Date: Wed, 1 Apr 2020 21:05:54 +0800
Subject: [PATCH 15/21] Corrections to historical jar packages and resource
data
---
.../js/conf/home/pages/dag/_source/formModel/tasks/shell.vue | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue
index fef1579db0..2be5f12809 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue
@@ -95,8 +95,7 @@
return {
label: node.name
}
- },
- id: null
+ }
}
},
mixins: [disabledState],
From 5bff786e7cc6464e9b09bcb84a14efab1443e3e9 Mon Sep 17 00:00:00 2001
From: break60 <790061044@qq.com>
Date: Thu, 2 Apr 2020 17:00:16 +0800
Subject: [PATCH 16/21] Fix the problem of data echo in script edit box
---
.../js/conf/home/pages/dag/_source/formModel/tasks/python.vue | 1 -
.../js/conf/home/pages/dag/_source/formModel/tasks/shell.vue | 1 -
dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js | 2 +-
3 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue
index 10cad6cb38..6b381c796d 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue
@@ -162,7 +162,6 @@
return {id: v}
}),
localParams: this.localParams,
- rawScript: editor ? editor.getValue() : ''
}
}
},
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue
index 2be5f12809..58603bf084 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue
@@ -222,7 +222,6 @@
return {id: v}
}),
localParams: this.localParams,
- rawScript: editor ? editor.getValue() : ''
}
}
},
diff --git a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
index 80cb2fc783..c25b021c0d 100755
--- a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
+++ b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
@@ -115,7 +115,7 @@ export default {
'SQL Type': 'sql类型',
'Title': '主题',
'Please enter the title of email': '请输入邮件主题',
- 'Table': '表格',
+ 'Table': '表名',
'Attachment': '附件',
'SQL Parameter': 'sql参数',
'SQL Statement': 'sql语句',
From ef8d64aacc815fdae04ec98e94eb3cb89171f213 Mon Sep 17 00:00:00 2001
From: break60 <790061044@qq.com>
Date: Thu, 2 Apr 2020 17:32:00 +0800
Subject: [PATCH 17/21] fix
---
.../js/conf/home/pages/dag/_source/formModel/tasks/python.vue | 1 +
.../src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue | 1 +
2 files changed, 2 insertions(+)
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue
index 6b381c796d..10cad6cb38 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue
@@ -162,6 +162,7 @@
return {id: v}
}),
localParams: this.localParams,
+ rawScript: editor ? editor.getValue() : ''
}
}
},
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue
index 58603bf084..2be5f12809 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue
@@ -222,6 +222,7 @@
return {id: v}
}),
localParams: this.localParams,
+ rawScript: editor ? editor.getValue() : ''
}
}
},
From 69e000b54214e8331ede69bdce9710b8418e960e Mon Sep 17 00:00:00 2001
From: zixi0825 <649790970@qq.com>
Date: Fri, 3 Apr 2020 00:16:01 +0800
Subject: [PATCH 18/21] #2282 fix workflow dependent bug (#2329)
* fix workflow dependent bug
* fix workflow dependent bug 2
* fix workflow dependent bug 2
Co-authored-by: sunchaohe
Co-authored-by: dailidong
---
.../src/main/resources/application.properties | 2 +-
.../task/dependent/DependentExecute.java | 95 ++++++++++++++----
.../worker/task/dependent/DependentTask.java | 9 +-
.../task/dependent/DependentTaskTest.java | 99 +++++++++++++++----
.../service/process/ProcessService.java | 24 +++++
pom.xml | 1 +
6 files changed, 187 insertions(+), 43 deletions(-)
diff --git a/dolphinscheduler-dao/src/main/resources/application.properties b/dolphinscheduler-dao/src/main/resources/application.properties
index 06b0ee94d5..c928c72df6 100644
--- a/dolphinscheduler-dao/src/main/resources/application.properties
+++ b/dolphinscheduler-dao/src/main/resources/application.properties
@@ -22,7 +22,7 @@ spring.datasource.driver-class-name=org.postgresql.Driver
spring.datasource.url=jdbc:postgresql://localhost:5432/dolphinscheduler
# mysql
#spring.datasource.driver-class-name=com.mysql.jdbc.Driver
-#spring.datasource.url=jdbc:mysql://192.168.xx.xx:3306/dolphinscheduler?useUnicode=true&characterEncoding=UTF-8
+#spring.datasource.url=jdbc:mysql://localhost:3306/dolphinscheduler?useUnicode=true&characterEncoding=UTF-8
# h2
#spring.datasource.driver-class-name=org.h2.Driver
#spring.datasource.url=jdbc:h2:file:../sql/h2;AUTO_SERVER=TRUE
diff --git a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/dependent/DependentExecute.java b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/dependent/DependentExecute.java
index b08cabc2e9..087bb80ccb 100644
--- a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/dependent/DependentExecute.java
+++ b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/dependent/DependentExecute.java
@@ -22,6 +22,7 @@ import org.apache.dolphinscheduler.common.enums.DependentRelation;
import org.apache.dolphinscheduler.common.enums.ExecutionStatus;
import org.apache.dolphinscheduler.common.model.DateInterval;
import org.apache.dolphinscheduler.common.model.DependentItem;
+import org.apache.dolphinscheduler.common.model.TaskNode;
import org.apache.dolphinscheduler.common.utils.DependentUtils;
import org.apache.dolphinscheduler.dao.entity.ProcessInstance;
import org.apache.dolphinscheduler.dao.entity.TaskInstance;
@@ -82,7 +83,7 @@ public class DependentExecute {
* @param currentTime current time
* @return DependResult
*/
- public DependResult getDependentResultForItem(DependentItem dependentItem, Date currentTime){
+ private DependResult getDependentResultForItem(DependentItem dependentItem, Date currentTime){
List dateIntervals = DependentUtils.getDateIntervalList(currentTime, dependentItem.getDateValue());
return calculateResultForTasks(dependentItem, dateIntervals );
}
@@ -94,7 +95,8 @@ public class DependentExecute {
* @return dateIntervals
*/
private DependResult calculateResultForTasks(DependentItem dependentItem,
- List dateIntervals) {
+ List dateIntervals) {
+
DependResult result = DependResult.FAILED;
for(DateInterval dateInterval : dateIntervals){
ProcessInstance processInstance = findLastProcessInterval(dependentItem.getDefinitionId(),
@@ -104,25 +106,35 @@ public class DependentExecute {
dependentItem.getDefinitionId(), dateInterval.getStartTime(), dateInterval.getEndTime() );
return DependResult.FAILED;
}
+ // need to check workflow for updates, so get all task and check the task state
if(dependentItem.getDepTasks().equals(Constants.DEPENDENT_ALL)){
- result = getDependResultByState(processInstance.getState());
- }else{
- TaskInstance taskInstance = null;
- List taskInstanceList = processService.findValidTaskListByProcessId(processInstance.getId());
+ List taskNodes =
+ processService.getTaskNodeListByDefinitionId(dependentItem.getDefinitionId());
- for(TaskInstance task : taskInstanceList){
- if(task.getName().equals(dependentItem.getDepTasks())){
- taskInstance = task;
- break;
+ if(taskNodes != null && taskNodes.size() > 0){
+ List results = new ArrayList<>();
+ DependResult tmpResult = DependResult.FAILED;
+ for(TaskNode taskNode:taskNodes){
+ tmpResult = getDependTaskResult(taskNode.getName(),processInstance);
+ if(DependResult.FAILED == tmpResult){
+ break;
+ }else{
+ results.add(getDependTaskResult(taskNode.getName(),processInstance));
+ }
+ }
+
+ if(DependResult.FAILED == tmpResult){
+ result = DependResult.FAILED;
+ }else if(results.contains(DependResult.WAITING)){
+ result = DependResult.WAITING;
+ }else{
+ result = DependResult.SUCCESS;
}
- }
- if(taskInstance == null){
- // cannot find task in the process instance
- // maybe because process instance is running or failed.
- result = getDependResultByState(processInstance.getState());
}else{
- result = getDependResultByState(taskInstance.getState());
+ result = DependResult.FAILED;
}
+ }else{
+ result = getDependTaskResult(dependentItem.getDepTasks(),processInstance);
}
if(result != DependResult.SUCCESS){
break;
@@ -131,6 +143,35 @@ public class DependentExecute {
return result;
}
+ /**
+ * get depend task result
+ * @param taskName
+ * @param processInstance
+ * @return
+ */
+ private DependResult getDependTaskResult(String taskName, ProcessInstance processInstance) {
+ DependResult result = DependResult.FAILED;
+ TaskInstance taskInstance = null;
+ List taskInstanceList = processService.findValidTaskListByProcessId(processInstance.getId());
+
+ for(TaskInstance task : taskInstanceList){
+ if(task.getName().equals(taskName)){
+ taskInstance = task;
+ break;
+ }
+ }
+
+ if(taskInstance == null){
+ // cannot find task in the process instance
+ // maybe because process instance is running or failed.
+ result = getDependResultByProcessStateWhenTaskNull(processInstance.getState());
+ }else{
+ result = getDependResultByState(taskInstance.getState());
+ }
+
+ return result;
+ }
+
/**
* find the last one process instance that :
* 1. manual run and finish between the interval
@@ -172,7 +213,9 @@ public class DependentExecute {
*/
private DependResult getDependResultByState(ExecutionStatus state) {
- if(state.typeIsRunning() || state == ExecutionStatus.SUBMITTED_SUCCESS || state == ExecutionStatus.WAITTING_THREAD){
+ if(state.typeIsRunning()
+ || state == ExecutionStatus.SUBMITTED_SUCCESS
+ || state == ExecutionStatus.WAITTING_THREAD){
return DependResult.WAITING;
}else if(state.typeIsSuccess()){
return DependResult.SUCCESS;
@@ -181,6 +224,22 @@ public class DependentExecute {
}
}
+ /**
+ * get dependent result by task instance state when task instance is null
+ * @param state state
+ * @return DependResult
+ */
+ private DependResult getDependResultByProcessStateWhenTaskNull(ExecutionStatus state) {
+
+ if(state.typeIsRunning()
+ || state == ExecutionStatus.SUBMITTED_SUCCESS
+ || state == ExecutionStatus.WAITTING_THREAD){
+ return DependResult.WAITING;
+ }else{
+ return DependResult.FAILED;
+ }
+ }
+
/**
* judge depend item finished
* @param currentTime current time
@@ -222,7 +281,7 @@ public class DependentExecute {
* @param currentTime current time
* @return DependResult
*/
- public DependResult getDependResultForItem(DependentItem item, Date currentTime){
+ private DependResult getDependResultForItem(DependentItem item, Date currentTime){
String key = item.getKey();
if(dependResultMap.containsKey(key)){
return dependResultMap.get(key);
diff --git a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/dependent/DependentTask.java b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/dependent/DependentTask.java
index f074d57e6c..b426d32502 100644
--- a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/dependent/DependentTask.java
+++ b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/dependent/DependentTask.java
@@ -82,10 +82,11 @@ public class DependentTask extends AbstractTask {
this.dependentParameters = JSONUtils.parseObject(this.taskProps.getDependence(),
DependentParameters.class);
-
- for(DependentTaskModel taskModel : dependentParameters.getDependTaskList()){
- this.dependentTaskList.add(new DependentExecute(
- taskModel.getDependItemList(), taskModel.getRelation()));
+ if(dependentParameters != null){
+ for(DependentTaskModel taskModel : dependentParameters.getDependTaskList()){
+ this.dependentTaskList.add(new DependentExecute(
+ taskModel.getDependItemList(), taskModel.getRelation()));
+ }
}
this.processService = SpringApplicationContext.getBean(ProcessService.class);
diff --git a/dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/task/dependent/DependentTaskTest.java b/dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/task/dependent/DependentTaskTest.java
index 272fb546da..c13a7647fe 100644
--- a/dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/task/dependent/DependentTaskTest.java
+++ b/dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/task/dependent/DependentTaskTest.java
@@ -17,47 +17,106 @@
package org.apache.dolphinscheduler.server.worker.task.dependent;
import org.apache.dolphinscheduler.common.Constants;
+import org.apache.dolphinscheduler.common.enums.ExecutionStatus;
+import org.apache.dolphinscheduler.common.model.DateInterval;
+import org.apache.dolphinscheduler.common.model.TaskNode;
+import org.apache.dolphinscheduler.common.utils.dependent.DependentDateUtils;
+import org.apache.dolphinscheduler.dao.entity.ProcessInstance;
+import org.apache.dolphinscheduler.dao.entity.TaskInstance;
import org.apache.dolphinscheduler.server.worker.task.TaskProps;
+import org.apache.dolphinscheduler.service.bean.SpringApplicationContext;
+import org.apache.dolphinscheduler.service.process.ProcessService;
import org.junit.Assert;
+import org.junit.Before;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mockito;
+import org.mockito.junit.MockitoJUnitRunner;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.context.ApplicationContext;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+@RunWith(MockitoJUnitRunner.Silent.class)
public class DependentTaskTest {
private static final Logger logger = LoggerFactory.getLogger(DependentTaskTest.class);
+ private ProcessService processService;
+ private ApplicationContext applicationContext;
- @Test
- public void testDependInit() throws Exception{
- TaskProps taskProps = new TaskProps();
+ @Before
+ public void before() throws Exception{
+ processService = Mockito.mock(ProcessService.class);
+ Mockito.when(processService
+ .findLastRunningProcess(4,DependentDateUtils.getTodayInterval(new Date()).get(0)))
+ .thenReturn(findLastProcessInterval());
+ Mockito.when(processService
+ .getTaskNodeListByDefinitionId(4))
+ .thenReturn(getTaskNodes());
+ Mockito.when(processService
+ .findValidTaskListByProcessId(11))
+ .thenReturn(getTaskInstances());
- String dependString = "{\n" +
- "\"dependTaskList\":[\n" +
- " {\n" +
- " \"dependItemList\":[\n" +
- " {\n" +
- " \"definitionId\": 101,\n" +
- " \"depTasks\": \"ALL\",\n" +
- " \"cycle\": \"day\",\n" +
- " \"dateValue\": \"last1Day\"\n" +
- " }\n" +
- " ],\n" +
- " \"relation\": \"AND\"\n" +
- " }\n" +
- " ],\n" +
- "\"relation\":\"OR\"\n" +
- "}";
+ Mockito.when(processService
+ .findTaskInstanceById(252612))
+ .thenReturn(getTaskInstance());
+ applicationContext = Mockito.mock(ApplicationContext.class);
+ SpringApplicationContext springApplicationContext = new SpringApplicationContext();
+ springApplicationContext.setApplicationContext(applicationContext);
+ Mockito.when(applicationContext.getBean(ProcessService.class)).thenReturn(processService);
+ }
+ @Test
+ public void test() throws Exception{
+
+ TaskProps taskProps = new TaskProps();
+ String dependString = "{\"dependTaskList\":[{\"dependItemList\":[{\"dateValue\":\"today\",\"depTasks\":\"ALL\",\"projectId\":1,\"definitionList\":[{\"label\":\"C\",\"value\":4},{\"label\":\"B\",\"value\":3},{\"label\":\"A\",\"value\":2}],\"cycle\":\"day\",\"definitionId\":4}],\"relation\":\"AND\"}],\"relation\":\"AND\"}";
taskProps.setTaskInstId(252612);
taskProps.setDependence(dependString);
+ taskProps.setTaskStartTime(new Date());
DependentTask dependentTask = new DependentTask(taskProps, logger);
dependentTask.init();
dependentTask.handle();
- Assert.assertEquals(dependentTask.getExitStatusCode(), Constants.EXIT_CODE_FAILURE );
+ Assert.assertEquals(dependentTask.getExitStatusCode(), Constants.EXIT_CODE_SUCCESS );
}
+ private ProcessInstance findLastProcessInterval(){
+ ProcessInstance processInstance = new ProcessInstance();
+ processInstance.setId(11);
+ processInstance.setState(ExecutionStatus.SUCCESS);
+ return processInstance;
+ }
+
+ private List getTaskNodes(){
+ List list = new ArrayList<>();
+ TaskNode taskNode = new TaskNode();
+ taskNode.setName("C");
+ taskNode.setType("SQL");
+ list.add(taskNode);
+ return list;
+ }
+ private List getTaskInstances(){
+ List list = new ArrayList<>();
+ TaskInstance taskInstance = new TaskInstance();
+ taskInstance.setName("C");
+ taskInstance.setState(ExecutionStatus.SUCCESS);
+ taskInstance.setDependency("1231");
+ list.add(taskInstance);
+ return list;
+ }
+
+ private TaskInstance getTaskInstance(){
+ TaskInstance taskInstance = new TaskInstance();
+ taskInstance.setId(252612);
+ taskInstance.setName("C");
+ taskInstance.setState(ExecutionStatus.SUCCESS);
+ return taskInstance;
+ }
}
\ No newline at end of file
diff --git a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
index 3312c1004a..ce4424e24a 100644
--- a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
+++ b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
@@ -236,6 +236,30 @@ public class ProcessService {
return processInstanceMapper.queryDetailById(processId);
}
+ /**
+ * get task node list by definitionId
+ * @param defineId
+ * @return
+ */
+ public List getTaskNodeListByDefinitionId(Integer defineId){
+ ProcessDefinition processDefinition = processDefineMapper.selectById(defineId);
+ if (processDefinition == null) {
+ logger.info("process define not exists");
+ return null;
+ }
+
+ String processDefinitionJson = processDefinition.getProcessDefinitionJson();
+ ProcessData processData = JSONUtils.parseObject(processDefinitionJson, ProcessData.class);
+
+ //process data check
+ if (null == processData) {
+ logger.error("process data is null");
+ return null;
+ }
+
+ return processData.getTasks();
+ }
+
/**
* find process instance by id
* @param processId processId
diff --git a/pom.xml b/pom.xml
index ec0435cc22..84df526317 100644
--- a/pom.xml
+++ b/pom.xml
@@ -740,6 +740,7 @@
**/server/worker/task/datax/DataxTaskTest.java
**/server/worker/task/shell/ShellTaskTest.java
**/server/worker/task/sqoop/SqoopTaskTest.java
+ **/server/worker/task/dependent/DependentTaskTest.java
**/server/utils/DataxUtilsTest.java
**/service/zk/DefaultEnsembleProviderTest.java
**/dao/datasource/BaseDataSourceTest.java
From bd6adf284d77fcd3b997da3d20fd8a408e066e34 Mon Sep 17 00:00:00 2001
From: break60 <790061044@qq.com>
Date: Sat, 4 Apr 2020 12:17:02 +0800
Subject: [PATCH 19/21] Fix the problem of data echo in script edit box (#2366)
Co-authored-by: dailidong
---
.../js/conf/home/pages/dag/_source/formModel/tasks/python.vue | 3 +--
.../js/conf/home/pages/dag/_source/formModel/tasks/shell.vue | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue
index 10cad6cb38..28fded41d3 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue
@@ -161,8 +161,7 @@
resourceList: _.map(this.resourceList, v => {
return {id: v}
}),
- localParams: this.localParams,
- rawScript: editor ? editor.getValue() : ''
+ localParams: this.localParams
}
}
},
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue
index 2be5f12809..bee095acd5 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue
@@ -221,8 +221,7 @@
resourceList: _.map(this.resourceList, v => {
return {id: v}
}),
- localParams: this.localParams,
- rawScript: editor ? editor.getValue() : ''
+ localParams: this.localParams
}
}
},
From d3990dfdb4d6fd0e5ac48aa345edb99ee8313a3c Mon Sep 17 00:00:00 2001
From: itbasketplayer <825621876@qq.com>
Date: Tue, 7 Apr 2020 15:14:08 +0800
Subject: [PATCH 20/21] .gitignore remove taskInstance/index.vue(#2300) and no
need to findProcessDefineById 2 times(#2373) (#2374)
* some optimization
* revert
* ProcessDefinitionService#updateProcessDefinition findProcessDefineById 1 time
---
.gitignore | 1 -
.../api/service/ProcessDefinitionService.java | 9 ++++-----
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/.gitignore b/.gitignore
index 7cf1d4d7db..edf803fbeb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -145,6 +145,5 @@ dolphinscheduler-ui/dist/js/home/index.78a5d12.js.map
dolphinscheduler-ui/dist/js/login/index.291b8e3.js
dolphinscheduler-ui/dist/js/login/index.291b8e3.js.map
dolphinscheduler-ui/dist/lib/external/
-dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/taskInstance/index.vue
/dolphinscheduler-dao/src/main/resources/dao/data_source.properties
diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionService.java
index 734adb9b71..0639aba113 100644
--- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionService.java
+++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionService.java
@@ -307,20 +307,19 @@ public class ProcessDefinitionService extends BaseDAGService {
if ((checkProcessJson.get(Constants.STATUS) != Status.SUCCESS)) {
return checkProcessJson;
}
- ProcessDefinition processDefinition = processService.findProcessDefineById(id);
- if (processDefinition == null) {
+ ProcessDefinition processDefine = processService.findProcessDefineById(id);
+ if (processDefine == null) {
// check process definition exists
putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, id);
return result;
- } else if (processDefinition.getReleaseState() == ReleaseState.ONLINE) {
+ } else if (processDefine.getReleaseState() == ReleaseState.ONLINE) {
// online can not permit edit
- putMsg(result, Status.PROCESS_DEFINE_NOT_ALLOWED_EDIT, processDefinition.getName());
+ putMsg(result, Status.PROCESS_DEFINE_NOT_ALLOWED_EDIT, processDefine.getName());
return result;
} else {
putMsg(result, Status.SUCCESS);
}
- ProcessDefinition processDefine = processService.findProcessDefineById(id);
Date now = new Date();
processDefine.setId(id);
From 2b0b93b9123a5853b15f578a72b7f0d6e5fbbd42 Mon Sep 17 00:00:00 2001
From: songgg <1172417734@qq.com>
Date: Tue, 7 Apr 2020 22:27:28 +0800
Subject: [PATCH 21/21] =?UTF-8?q?[optimization]=EF=BC=9Aremove=20duplicate?=
=?UTF-8?q?=20code=20(#2377)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* sqlTask failed to run
* remove duplicate code
* remove duplicate code
* remove duplicate code
* remove duplicate code
* remove duplicate code
Co-authored-by: songqh
---
.../apache/dolphinscheduler/api/service/ExecutorService.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ExecutorService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ExecutorService.java
index fe43f10b78..dda960d2e6 100644
--- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ExecutorService.java
+++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ExecutorService.java
@@ -453,7 +453,7 @@ public class ExecutorService extends BaseService{
TaskDependType nodeDep, FailureStrategy failureStrategy,
String startNodeList, String schedule, WarningType warningType,
int excutorId, int warningGroupId,
- RunMode runMode,Priority processInstancePriority, int workerGroupId) throws ParseException {
+ RunMode runMode,Priority processInstancePriority, int workerGroupId){
/**
* instantiate command schedule instance
@@ -496,6 +496,7 @@ public class ExecutorService extends BaseService{
}
}
+ // determine whether to complement
if(commandType == CommandType.COMPLEMENT_DATA){
runMode = (runMode == null) ? RunMode.RUN_MODE_SERIAL : runMode;
if(null != start && null != end && start.before(end)){
@@ -540,7 +541,7 @@ public class ExecutorService extends BaseService{
processDefineId, schedule);
}
}else{
- command.setCommandParam(JSONUtils.toJson(cmdParam));
+
return processService.createCommand(command);
}