From db466707fdfb1fae808412b6de4d490bc7d2913c Mon Sep 17 00:00:00 2001 From: Marvin Zhang Date: Sun, 18 Dec 2022 17:31:57 +0800 Subject: [PATCH] fix: attempt to fix unable to load vue issue --- .env.docker | 1 - .env.production | 1 - package.json | 5 ++-- pnpm-lock.yaml | 25 +++++++++++++++---- src/components/file/FileEditorNavMenu.vue | 2 +- src/components/file/fileEditorDropZone.ts | 10 ++------ .../spider/UploadSpiderFilesDialog.vue | 2 +- 7 files changed, 27 insertions(+), 19 deletions(-) diff --git a/.env.docker b/.env.docker index a5e998027cc56..b5bbde801b66d 100644 --- a/.env.docker +++ b/.env.docker @@ -1,2 +1 @@ -NODE_ENV='production' VITE_APP_API_BASE_URL='/api' diff --git a/.env.production b/.env.production index d3ec763730b2b..dd2e38d083c58 100644 --- a/.env.production +++ b/.env.production @@ -1,2 +1 @@ -NODE_ENV='production' VITE_APP_API_BASE_URL=http://localhost:8000 diff --git a/package.json b/package.json index df63d47811820..a15a842bb79c8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "crawlab-ui", - "version": "0.6.0-31", + "version": "0.6.0-32", "private": false, "author": { "name": "Marvin Zhang", @@ -83,6 +83,7 @@ "axios": "^0.21.1", "codemirror": "^5", "core-js": "^3.6.5", + "crawlab-vue3-dropzone": "3.0.2", "cron-parser": "^3.5.0", "cronstrue": "^1.114.0", "dayjs": "^1.10.5", @@ -101,7 +102,7 @@ "simplemde": "^1.11.2", "url-join": "^4.0.1", "vue": "^3.2.0", - "vue-clipboard3": "^1.0.1", + "vue-clipboard3": "^2.0.0", "vue-debounce": "^4.0.0", "vue-i18n": "9.1.9", "vue-router": "4.0.11", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 00a492126ac71..98e9b138201b5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -36,6 +36,7 @@ specifiers: chalk: ^4.1.2 codemirror: ^5 core-js: ^3.6.5 + crawlab-vue3-dropzone: 3.0.2 cron-parser: ^3.5.0 cronstrue: ^1.114.0 dayjs: ^1.10.5 @@ -70,7 +71,7 @@ specifiers: vite-aliases: ^0.9.7 vite-plugin-dynamic-import: ^1.2.4 vue: ^3.2.0 - vue-clipboard3: ^1.0.1 + vue-clipboard3: ^2.0.0 vue-debounce: ^4.0.0 vue-i18n: 9.1.9 vue-router: 4.0.11 @@ -102,6 +103,7 @@ dependencies: axios: registry.npmmirror.com/axios/0.21.4 codemirror: registry.npmmirror.com/codemirror/5.65.10 core-js: registry.npmmirror.com/core-js/3.26.1 + crawlab-vue3-dropzone: registry.npmmirror.com/crawlab-vue3-dropzone/3.0.2_vue@3.2.45 cron-parser: registry.npmmirror.com/cron-parser/3.5.0 cronstrue: registry.npmmirror.com/cronstrue/1.125.0 dayjs: registry.npmmirror.com/dayjs/1.11.6 @@ -120,7 +122,7 @@ dependencies: simplemde: registry.npmmirror.com/simplemde/1.11.2 url-join: registry.npmmirror.com/url-join/4.0.1 vue: registry.npmmirror.com/vue/3.2.45 - vue-clipboard3: registry.npmmirror.com/vue-clipboard3/1.0.1 + vue-clipboard3: registry.npmmirror.com/vue-clipboard3/2.0.0 vue-debounce: registry.npmmirror.com/vue-debounce/4.0.0_vue@3.2.45 vue-i18n: registry.npmmirror.com/vue-i18n/9.1.9_vue@3.2.45 vue-router: registry.npmmirror.com/vue-router/4.0.11_vue@3.2.45 @@ -6471,6 +6473,19 @@ packages: dev: true optional: true + registry.npmmirror.com/crawlab-vue3-dropzone/3.0.2_vue@3.2.45: + resolution: {integrity: sha512-11kwSm62Kq6UwVVwW1e43h0sPbemt8jKi/mq5ZSAIJosF9wx2AZWvPM5tTWE0HEd0Ms4zfPh5auaYfwM5sSpxw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/crawlab-vue3-dropzone/-/crawlab-vue3-dropzone-3.0.2.tgz} + id: registry.npmmirror.com/crawlab-vue3-dropzone/3.0.2 + name: crawlab-vue3-dropzone + version: 3.0.2 + peerDependencies: + vue: '>=3.2.45' + dependencies: + attr-accept: registry.npmmirror.com/attr-accept/2.2.2 + file-selector: registry.npmmirror.com/file-selector/0.2.4 + vue: registry.npmmirror.com/vue/3.2.45 + dev: false + registry.npmmirror.com/create-ecdh/4.0.4: resolution: {integrity: sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/create-ecdh/-/create-ecdh-4.0.4.tgz} name: create-ecdh @@ -16853,10 +16868,10 @@ packages: version: 1.1.2 dev: true - registry.npmmirror.com/vue-clipboard3/1.0.1: - resolution: {integrity: sha512-iJ2vrizowfA73W3pcxMAKhYSvfekJrQ3FhbveVe9esS1Vfu+xW3Fgc0UKE8N4Q6DyRtcAoNlef8txmD8tK8dIg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/vue-clipboard3/-/vue-clipboard3-1.0.1.tgz} + registry.npmmirror.com/vue-clipboard3/2.0.0: + resolution: {integrity: sha512-Q9S7dzWGax7LN5iiSPcu/K1GGm2gcBBlYwmMsUc5/16N6w90cbKow3FnPmPs95sungns4yvd9/+JhbAznECS2A==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/vue-clipboard3/-/vue-clipboard3-2.0.0.tgz} name: vue-clipboard3 - version: 1.0.1 + version: 2.0.0 dependencies: clipboard: registry.npmmirror.com/clipboard/2.0.11 dev: false diff --git a/src/components/file/FileEditorNavMenu.vue b/src/components/file/FileEditorNavMenu.vue index 4e2f675d035c6..699bded2441e1 100644 --- a/src/components/file/FileEditorNavMenu.vue +++ b/src/components/file/FileEditorNavMenu.vue @@ -71,7 +71,7 @@ import Node from 'element-plus/lib/components/tree/src/model/node'; import {DropType} from 'element-plus/lib/components/tree/src/tree.type'; import {KEY_CONTROL, KEY_META} from '@/constants/keyboard'; import {ElMessageBox, ElTree} from 'element-plus'; -import {useDropzone} from 'vue3-dropzone'; +import {useDropzone} from 'crawlab-vue3-dropzone'; import {emptyArrayFunc, emptyObjectFunc} from '@/utils/func'; import {useI18n} from 'vue-i18n'; diff --git a/src/components/file/fileEditorDropZone.ts b/src/components/file/fileEditorDropZone.ts index febbfc67ba179..f6026bc321ce7 100644 --- a/src/components/file/fileEditorDropZone.ts +++ b/src/components/file/fileEditorDropZone.ts @@ -1,17 +1,11 @@ -import {useDropzone} from 'vue3-dropzone'; +import {useDropzone} from 'crawlab-vue3-dropzone'; const useFileEditorDropZone = () => { - const onDrop = (acceptedFiles: InputFile[], rejectReasons: FileRejectReason[], event: Event) => { - // console.log(acceptedFiles); - }; - const { getRootProps, getInputProps, open, - } = useDropzone({ - onDrop, - }); + } = useDropzone({}); return { getRootProps, diff --git a/src/components/spider/UploadSpiderFilesDialog.vue b/src/components/spider/UploadSpiderFilesDialog.vue index 3a230a23b9ba5..995d3047b6a10 100644 --- a/src/components/spider/UploadSpiderFilesDialog.vue +++ b/src/components/spider/UploadSpiderFilesDialog.vue @@ -29,7 +29,7 @@ import useSpiderService from '@/services/spider/spiderService'; import {getOSPathSeparator} from '@/utils'; import {useRoute} from 'vue-router'; import {FILE_UPLOAD_MODE_DIR} from '@/constants'; -import {useDropzone} from 'vue3-dropzone'; +import {useDropzone} from 'crawlab-vue3-dropzone'; import useSpiderDetail from '@/views/spider/detail/useSpiderDetail'; export default defineComponent({