@@ -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";