From 4c7dabfc38d7e43d571e033045d067a01882fabd Mon Sep 17 00:00:00 2001 From: Daniel Gloeckner Date: Sat, 10 Sep 2022 00:47:28 +0200 Subject: [PATCH 1/7] feat: don't load columns into tree; re-do search bar WIP --- pnpm-lock.yaml | 191 ++++++++++++++++++---------------- src/components/sql/Filter.vue | 33 +++--- src/components/sql/utils.ts | 2 +- src/utils/http.ts | 4 + 4 files changed, 119 insertions(+), 111 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 83dfc1dd..bd21955c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,4 +1,4 @@ -lockfileVersion: 5.3 +lockfileVersion: 5.4 specifiers: 3d-force-graph: 1.67.7 @@ -48,14 +48,14 @@ specifiers: dependencies: '@element-plus/icons-vue': 2.0.6_vue@3.2.25 - butterfly-dag: 4.3.6_jquery@3.6.0+lodash@4.17.21 + butterfly-dag: 4.3.6_dq5gpbql4sccvlqrt6xudehxa4 dayjs: 1.11.3 echarts: 5.3.3 element-plus: 2.2.6_vue@3.2.25 jquery: 3.6.0 lodash: 4.17.21 monaco-editor: 0.29.1 - pinia: 2.0.14_typescript@4.5.4+vue@3.2.25 + pinia: 2.0.14_rvwc7kfd64xpiqorn3aa5sklme pinia-plugin-persist: 1.0.0_pinia@2.0.14+vue@3.2.25 randomcolor: 0.6.2 sql-limiter: 3.0.0 @@ -74,14 +74,14 @@ devDependencies: '@commitlint/cli': 17.0.2 '@commitlint/config-conventional': 17.0.2 '@types/jquery': 3.5.14 - '@typescript-eslint/eslint-plugin': 5.28.0_e31b29f1fecf005ba924419e2b988db8 - '@typescript-eslint/parser': 5.28.0_eslint@8.17.0+typescript@4.5.4 + '@typescript-eslint/eslint-plugin': 5.28.0_4mnst4p6z4afxkjeigpcxgenxa + '@typescript-eslint/parser': 5.28.0_pn4c2euezwjqh4cpvwz4zteq6u '@vitejs/plugin-vue': 2.3.3_vite@2.9.9+vue@3.2.25 cross-env: 7.0.3 eslint: 8.17.0 - eslint-config-standard: 17.0.0_e06a80ed3e0e8d52f93dc737cf677d38 + eslint-config-standard: 17.0.0_4bvib3j6b2gvf6j5y4346z35ha eslint-define-config: 1.5.1 - eslint-plugin-import: 2.26.0_eslint@8.17.0 + eslint-plugin-import: 2.26.0_wyrfqmvemfacbroyi3ypviy7f4 eslint-plugin-n: 15.0.0_eslint@8.17.0 eslint-plugin-promise: 6.0.0_eslint@8.17.0 eslint-plugin-vue: 9.1.1_eslint@8.17.0 @@ -134,10 +134,13 @@ packages: '@babel/highlight': 7.18.6 dev: true + /@babel/helper-string-parser/7.18.10: + resolution: {integrity: sha512-XtIfWmeNY3i4t7t4D2t02q50HvqHybPqW2ki1kosnvWCwuCMeo81Jf0gwr85jy/neUdg5XDdeFE/80DXiO+njw==} + engines: {node: '>=6.9.0'} + /@babel/helper-validator-identifier/7.18.6: resolution: {integrity: sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g==} engines: {node: '>=6.9.0'} - dev: true /@babel/highlight/7.18.6: resolution: {integrity: sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==} @@ -152,6 +155,8 @@ packages: resolution: {integrity: sha512-dgXcIfMuQ0kgzLB2b9tRZs7TTFFaGM2AbtA4fJgUUYukzGH4jwsS7hzQHEGs67jdehpm22vkgKwvbU+aEflgwg==} engines: {node: '>=6.0.0'} hasBin: true + dependencies: + '@babel/types': 7.19.0 /@babel/runtime/7.18.9: resolution: {integrity: sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw==} @@ -160,6 +165,14 @@ packages: regenerator-runtime: 0.13.9 dev: true + /@babel/types/7.19.0: + resolution: {integrity: sha512-YuGopBq3ke25BVSiS6fgF49Ul9gH1x70Bcr6bqRLjWCkcX8Hre1/5+z+IiWOIerRMSSEfGZVB9z9kyq7wVs9YA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-string-parser': 7.18.10 + '@babel/helper-validator-identifier': 7.18.6 + to-fast-properties: 2.0.0 + /@commitlint/cli/17.0.2: resolution: {integrity: sha512-Axe89Js0YzGGd4gxo3JLlF7yIdjOVpG1LbOorGc6PfYF+drBh14PvarSDLzyd2TNqdylUCq9wb9/A88ZjIdyhA==} engines: {node: '>=v14'} @@ -245,7 +258,7 @@ packages: '@types/node': 18.7.11 chalk: 4.1.2 cosmiconfig: 7.0.1 - cosmiconfig-typescript-loader: 2.0.2_c532c1b383b0670bfdc8e007fab27648 + cosmiconfig-typescript-loader: 2.0.2_yuzmdm4dwbtqx7oi4ad7vmtwja lodash: 4.17.21 resolve-from: 5.0.0 typescript: 4.7.4 @@ -346,7 +359,6 @@ packages: cpu: [loong64] os: [linux] requiresBuild: true - dev: true optional: true /@eslint/eslintrc/1.3.0: @@ -556,7 +568,7 @@ packages: resolution: {integrity: sha512-5d2RhCard1nQUC3aHcq/gHzWYO6K0WJmAbjO7mQJgCQKtZpgXxv1rOM6O/dBDhDYYVutk1sciOgNSe+5YyfM8A==} dev: false - /@typescript-eslint/eslint-plugin/5.28.0_e31b29f1fecf005ba924419e2b988db8: + /@typescript-eslint/eslint-plugin/5.28.0_4mnst4p6z4afxkjeigpcxgenxa: resolution: {integrity: sha512-DXVU6Cg29H2M6EybqSg2A+x8DgO9TCUBRp4QEXQHJceLS7ogVDP0g3Lkg/SZCqcvkAP/RruuQqK0gdlkgmhSUA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -567,10 +579,10 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.28.0_eslint@8.17.0+typescript@4.5.4 + '@typescript-eslint/parser': 5.28.0_pn4c2euezwjqh4cpvwz4zteq6u '@typescript-eslint/scope-manager': 5.28.0 - '@typescript-eslint/type-utils': 5.28.0_eslint@8.17.0+typescript@4.5.4 - '@typescript-eslint/utils': 5.28.0_eslint@8.17.0+typescript@4.5.4 + '@typescript-eslint/type-utils': 5.28.0_pn4c2euezwjqh4cpvwz4zteq6u + '@typescript-eslint/utils': 5.28.0_pn4c2euezwjqh4cpvwz4zteq6u debug: 4.3.4 eslint: 8.17.0 functional-red-black-tree: 1.0.1 @@ -583,7 +595,7 @@ packages: - supports-color dev: true - /@typescript-eslint/parser/5.28.0_eslint@8.17.0+typescript@4.5.4: + /@typescript-eslint/parser/5.28.0_pn4c2euezwjqh4cpvwz4zteq6u: resolution: {integrity: sha512-ekqoNRNK1lAcKhZESN/PdpVsWbP9jtiNqzFWkp/yAUdZvJalw2heCYuqRmM5eUJSIYEkgq5sGOjq+ZqsLMjtRA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -611,7 +623,7 @@ packages: '@typescript-eslint/visitor-keys': 5.28.0 dev: true - /@typescript-eslint/type-utils/5.28.0_eslint@8.17.0+typescript@4.5.4: + /@typescript-eslint/type-utils/5.28.0_pn4c2euezwjqh4cpvwz4zteq6u: resolution: {integrity: sha512-SyKjKh4CXPglueyC6ceAFytjYWMoPHMswPQae236zqe1YbhvCVQyIawesYywGiu98L9DwrxsBN69vGIVxJ4mQQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -621,7 +633,7 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/utils': 5.28.0_eslint@8.17.0+typescript@4.5.4 + '@typescript-eslint/utils': 5.28.0_pn4c2euezwjqh4cpvwz4zteq6u debug: 4.3.4 eslint: 8.17.0 tsutils: 3.21.0_typescript@4.5.4 @@ -656,7 +668,7 @@ packages: - supports-color dev: true - /@typescript-eslint/utils/5.28.0_eslint@8.17.0+typescript@4.5.4: + /@typescript-eslint/utils/5.28.0_pn4c2euezwjqh4cpvwz4zteq6u: resolution: {integrity: sha512-E60N5L0fjv7iPJV3UGc4EC+A3Lcj4jle9zzR0gW7vXhflO7/J29kwiTGITA2RlrmPokKiZbBy2DgaclCaEUs6g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -730,7 +742,6 @@ packages: '@vue/shared': 3.2.25 estree-walker: 2.0.2 source-map: 0.6.1 - dev: false /@vue/compiler-core/3.2.37: resolution: {integrity: sha512-81KhEjo7YAOh0vQJoSmAD68wLfYqJvoiD4ulyedzF+OEk/bk6/hx3fTNVfuzugIIaTrOx4PGx6pAiBRe5e9Zmg==} @@ -746,7 +757,6 @@ packages: dependencies: '@vue/compiler-core': 3.2.25 '@vue/shared': 3.2.25 - dev: false /@vue/compiler-dom/3.2.37: resolution: {integrity: sha512-yxJLH167fucHKxaqXpYk7x8z7mMEnXOw3G2q62FTkmsvNxu4FQSu5+3UMb+L7fjKa26DEzhrmCxAgFLLIzVfqQ==} @@ -768,7 +778,6 @@ packages: magic-string: 0.25.9 postcss: 8.4.16 source-map: 0.6.1 - dev: false /@vue/compiler-sfc/3.2.37: resolution: {integrity: sha512-+7i/2+9LYlpqDv+KTtWhOZH+pa8/HnX/905MdVmAcI/mPQOBwkHHIzrsEsucyOIZQYMkXUiTkmZq5am/NyXKkg==} @@ -790,7 +799,6 @@ packages: dependencies: '@vue/compiler-dom': 3.2.25 '@vue/shared': 3.2.25 - dev: false /@vue/compiler-ssr/3.2.37: resolution: {integrity: sha512-7mQJD7HdXxQjktmsWp/J67lThEIcxLemz1Vb5I6rYJHR5vI+lON3nPGOH3ubmbvYGt8xEUaAr1j7/tIFWiEOqw==} @@ -811,7 +819,6 @@ packages: '@vue/shared': 3.2.25 estree-walker: 2.0.2 magic-string: 0.25.9 - dev: false /@vue/reactivity-transform/3.2.37: resolution: {integrity: sha512-IWopkKEb+8qpu/1eMKVeXrK0NLw9HicGviJzhJDEyfxTR9e1WtpnnbYkJWurX6WwoFP0sz10xQg8yL8lgskAZg==} @@ -827,7 +834,6 @@ packages: resolution: {integrity: sha512-Dxc/u/dxoneIDqyfmuwPVBR0G3OQJqe3Dtz4z3NGt+CGj4UuOZQfN5raJPmp6xGYgrtC6PAWoCgHhyrgr1qCtg==} dependencies: '@vue/shared': 3.2.25 - dev: false /@vue/reactivity/3.2.37: resolution: {integrity: sha512-/7WRafBOshOc6m3F7plwzPeCu/RCVv9uMpOwa/5PiY1Zz+WLVRWiy0MYKwmg19KBdGtFWsmZ4cD+LOdVPcs52A==} @@ -840,7 +846,6 @@ packages: dependencies: '@vue/reactivity': 3.2.25 '@vue/shared': 3.2.25 - dev: false /@vue/runtime-dom/3.2.25: resolution: {integrity: sha512-3gGeyHnygn4yG6bssRKhQIxnE8vgB8FtYUUwoYoA/Pm0vZ+bGPoZax4TbtZD9eW9rvs8CY8boNp4t/sJaPJrRQ==} @@ -848,7 +853,6 @@ packages: '@vue/runtime-core': 3.2.25 '@vue/shared': 3.2.25 csstype: 2.6.20 - dev: false /@vue/server-renderer/3.2.25_vue@3.2.25: resolution: {integrity: sha512-qFRmcyeyyhWbnTPn6cbCZ4bjeuPLSkUpFa98p4LEJtFBFbxjGnrHXHOjYxCY3Lznmxe0kMM3qG4t3GnjcXP12w==} @@ -858,11 +862,9 @@ packages: '@vue/compiler-ssr': 3.2.25 '@vue/shared': 3.2.25 vue: 3.2.25 - dev: false /@vue/shared/3.2.25: resolution: {integrity: sha512-DkHJFV2gw9WBRmUCa21eyG0WvlF0l1QFOgTkWj29O4mt2Tv3BSE5PQOKhUruZIym4bBYCqx9ZGtoD1WohDprow==} - dev: false /@vue/shared/3.2.37: resolution: {integrity: sha512-4rSJemR2NQIo9Klm1vabqWjD8rs/ZaJSzMxkMNeJS6lHiUjjUeYFbooN19NgFjztubEKh3WlZUeOLVdbbUWHsw==} @@ -1020,7 +1022,6 @@ packages: dependencies: normalize-path: 3.0.0 picomatch: 2.3.1 - dev: true /arg/4.1.3: resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} @@ -1129,7 +1130,6 @@ packages: /binary-extensions/2.2.0: resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} engines: {node: '>=8'} - dev: true /bluebird/3.7.2: resolution: {integrity: sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==} @@ -1159,6 +1159,8 @@ packages: snapdragon-node: 2.1.1 split-string: 3.1.0 to-regex: 3.0.2 + transitivePeerDependencies: + - supports-color dev: false /braces/3.0.2: @@ -1166,9 +1168,8 @@ packages: engines: {node: '>=8'} dependencies: fill-range: 7.0.1 - dev: true - /butterfly-dag/4.3.6_jquery@3.6.0+lodash@4.17.21: + /butterfly-dag/4.3.6_dq5gpbql4sccvlqrt6xudehxa4: resolution: {integrity: sha512-PFQzyY2Vb+sz1v9bnh+hwkAi+iJg03nRJEKapKcemRVxUrlVIARewLp+p6zJaVZKVuKio7oGCZHeWvsF4IU/+w==} peerDependencies: jquery: '>=2.0.0' @@ -1267,7 +1268,6 @@ packages: readdirp: 3.6.0 optionalDependencies: fsevents: 2.3.2 - dev: true /class-utils/0.3.6: resolution: {integrity: sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==} @@ -1400,8 +1400,8 @@ packages: engines: {node: '>=10'} hasBin: true dependencies: - is-text-path: 1.0.1 JSONStream: 1.3.5 + is-text-path: 1.0.1 lodash: 4.17.21 meow: 8.1.2 split2: 3.2.2 @@ -1421,7 +1421,7 @@ packages: vary: 1.1.2 dev: false - /cosmiconfig-typescript-loader/2.0.2_c532c1b383b0670bfdc8e007fab27648: + /cosmiconfig-typescript-loader/2.0.2_yuzmdm4dwbtqx7oi4ad7vmtwja: resolution: {integrity: sha512-KmE+bMjWMXJbkWCeY4FJX/npHuZPNr9XF9q9CIQ/bpFwi1qHfCmSiKarrCcRa0LO4fWjk93pVoeRtJAkTGcYNw==} engines: {node: '>=12', npm: '>=6'} peerDependencies: @@ -1430,7 +1430,7 @@ packages: dependencies: '@types/node': 18.7.11 cosmiconfig: 7.0.1 - ts-node: 10.9.1_c532c1b383b0670bfdc8e007fab27648 + ts-node: 10.9.1_yuzmdm4dwbtqx7oi4ad7vmtwja typescript: 4.7.4 transitivePeerDependencies: - '@swc/core' @@ -1507,7 +1507,6 @@ packages: /csstype/2.6.20: resolution: {integrity: sha512-/WwNkdXfckNgw6S5R125rrW8ez139lBHWouiBvX8dfMFtcn6V81REDqnH7+CRpRipfYlyU1CmOnOxrmGcFOjeA==} - dev: false /csstype/3.1.0: resolution: {integrity: sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA==} @@ -1652,11 +1651,21 @@ packages: /debug/2.6.9: resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true dependencies: ms: 2.0.0 /debug/3.2.7: resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true dependencies: ms: 2.1.3 dev: true @@ -1840,7 +1849,7 @@ packages: escape-html: 1.0.3 lodash: 4.17.21 lodash-es: 4.17.21 - lodash-unified: 1.0.2_da03a4540fbd16bbaafbb96724306afd + lodash-unified: 1.0.2_3ib2ivapxullxkx3xftsimdk7u memoize-one: 6.0.0 normalize-wheel-es: 1.2.0 vue: 3.2.25 @@ -1925,7 +1934,6 @@ packages: cpu: [x64] os: [android] requiresBuild: true - dev: true optional: true /esbuild-android-arm64/0.14.54: @@ -1934,7 +1942,6 @@ packages: cpu: [arm64] os: [android] requiresBuild: true - dev: true optional: true /esbuild-darwin-64/0.14.54: @@ -1943,7 +1950,6 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true - dev: true optional: true /esbuild-darwin-arm64/0.14.54: @@ -1952,7 +1958,6 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true - dev: true optional: true /esbuild-freebsd-64/0.14.54: @@ -1961,7 +1966,6 @@ packages: cpu: [x64] os: [freebsd] requiresBuild: true - dev: true optional: true /esbuild-freebsd-arm64/0.14.54: @@ -1970,7 +1974,6 @@ packages: cpu: [arm64] os: [freebsd] requiresBuild: true - dev: true optional: true /esbuild-linux-32/0.14.54: @@ -1979,7 +1982,6 @@ packages: cpu: [ia32] os: [linux] requiresBuild: true - dev: true optional: true /esbuild-linux-64/0.14.54: @@ -1988,7 +1990,6 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: true optional: true /esbuild-linux-arm/0.14.54: @@ -1997,7 +1998,6 @@ packages: cpu: [arm] os: [linux] requiresBuild: true - dev: true optional: true /esbuild-linux-arm64/0.14.54: @@ -2006,7 +2006,6 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: true optional: true /esbuild-linux-mips64le/0.14.54: @@ -2015,7 +2014,6 @@ packages: cpu: [mips64el] os: [linux] requiresBuild: true - dev: true optional: true /esbuild-linux-ppc64le/0.14.54: @@ -2024,7 +2022,6 @@ packages: cpu: [ppc64] os: [linux] requiresBuild: true - dev: true optional: true /esbuild-linux-riscv64/0.14.54: @@ -2033,7 +2030,6 @@ packages: cpu: [riscv64] os: [linux] requiresBuild: true - dev: true optional: true /esbuild-linux-s390x/0.14.54: @@ -2042,7 +2038,6 @@ packages: cpu: [s390x] os: [linux] requiresBuild: true - dev: true optional: true /esbuild-netbsd-64/0.14.54: @@ -2051,7 +2046,6 @@ packages: cpu: [x64] os: [netbsd] requiresBuild: true - dev: true optional: true /esbuild-openbsd-64/0.14.54: @@ -2060,7 +2054,6 @@ packages: cpu: [x64] os: [openbsd] requiresBuild: true - dev: true optional: true /esbuild-sunos-64/0.14.54: @@ -2069,7 +2062,6 @@ packages: cpu: [x64] os: [sunos] requiresBuild: true - dev: true optional: true /esbuild-windows-32/0.14.54: @@ -2078,7 +2070,6 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true - dev: true optional: true /esbuild-windows-64/0.14.54: @@ -2087,7 +2078,6 @@ packages: cpu: [x64] os: [win32] requiresBuild: true - dev: true optional: true /esbuild-windows-arm64/0.14.54: @@ -2096,7 +2086,6 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true - dev: true optional: true /esbuild/0.14.54: @@ -2126,7 +2115,6 @@ packages: esbuild-windows-32: 0.14.54 esbuild-windows-64: 0.14.54 esbuild-windows-arm64: 0.14.54 - dev: true /escalade/3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} @@ -2146,7 +2134,7 @@ packages: engines: {node: '>=10'} dev: true - /eslint-config-standard/17.0.0_e06a80ed3e0e8d52f93dc737cf677d38: + /eslint-config-standard/17.0.0_4bvib3j6b2gvf6j5y4346z35ha: resolution: {integrity: sha512-/2ks1GKyqSOkH7JFvXJicu0iMpoojkwB+f5Du/1SC0PtBL+s8v30k9njRZ21pm2drKYm2342jFnGWzttxPmZVg==} peerDependencies: eslint: ^8.0.1 @@ -2155,7 +2143,7 @@ packages: eslint-plugin-promise: ^6.0.0 dependencies: eslint: 8.17.0 - eslint-plugin-import: 2.26.0_eslint@8.17.0 + eslint-plugin-import: 2.26.0_wyrfqmvemfacbroyi3ypviy7f4 eslint-plugin-n: 15.0.0_eslint@8.17.0 eslint-plugin-promise: 6.0.0_eslint@8.17.0 dev: true @@ -2170,19 +2158,37 @@ packages: dependencies: debug: 3.2.7 resolve: 1.22.1 + transitivePeerDependencies: + - supports-color dev: true - /eslint-module-utils/2.7.4_eslint@8.17.0: + /eslint-module-utils/2.7.4_pudgocv7lvbqrxvvlp5wdogo2e: resolution: {integrity: sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==} engines: {node: '>=4'} peerDependencies: + '@typescript-eslint/parser': '*' eslint: '*' + eslint-import-resolver-node: '*' + eslint-import-resolver-typescript: '*' + eslint-import-resolver-webpack: '*' peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true eslint: optional: true + eslint-import-resolver-node: + optional: true + eslint-import-resolver-typescript: + optional: true + eslint-import-resolver-webpack: + optional: true dependencies: + '@typescript-eslint/parser': 5.28.0_pn4c2euezwjqh4cpvwz4zteq6u debug: 3.2.7 eslint: 8.17.0 + eslint-import-resolver-node: 0.3.6 + transitivePeerDependencies: + - supports-color dev: true /eslint-plugin-es/4.1.0_eslint@8.17.0: @@ -2196,19 +2202,24 @@ packages: regexpp: 3.2.0 dev: true - /eslint-plugin-import/2.26.0_eslint@8.17.0: + /eslint-plugin-import/2.26.0_wyrfqmvemfacbroyi3ypviy7f4: resolution: {integrity: sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==} engines: {node: '>=4'} peerDependencies: + '@typescript-eslint/parser': '*' eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 + peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true dependencies: + '@typescript-eslint/parser': 5.28.0_pn4c2euezwjqh4cpvwz4zteq6u array-includes: 3.1.5 array.prototype.flat: 1.3.0 debug: 2.6.9 doctrine: 2.1.0 eslint: 8.17.0 eslint-import-resolver-node: 0.3.6 - eslint-module-utils: 2.7.4_eslint@8.17.0 + eslint-module-utils: 2.7.4_pudgocv7lvbqrxvvlp5wdogo2e has: 1.0.3 is-core-module: 2.10.0 is-glob: 4.0.3 @@ -2216,6 +2227,10 @@ packages: object.values: 1.1.5 resolve: 1.22.1 tsconfig-paths: 3.14.1 + transitivePeerDependencies: + - eslint-import-resolver-typescript + - eslint-import-resolver-webpack + - supports-color dev: true /eslint-plugin-n/15.0.0_eslint@8.17.0: @@ -2444,6 +2459,8 @@ packages: regex-not: 1.0.2 snapdragon: 0.8.2 to-regex: 3.0.2 + transitivePeerDependencies: + - supports-color dev: false /extend-shallow/2.0.1: @@ -2473,6 +2490,8 @@ packages: regex-not: 1.0.2 snapdragon: 0.8.2 to-regex: 3.0.2 + transitivePeerDependencies: + - supports-color dev: false /fast-deep-equal/3.1.3: @@ -2526,7 +2545,6 @@ packages: engines: {node: '>=8'} dependencies: to-regex-range: 5.0.1 - dev: true /find-up/4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} @@ -2585,12 +2603,10 @@ packages: engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] requiresBuild: true - dev: true optional: true /function-bind/1.1.1: resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} - dev: true /function.prototype.name/1.1.5: resolution: {integrity: sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==} @@ -2662,7 +2678,6 @@ packages: engines: {node: '>= 6'} dependencies: is-glob: 4.0.3 - dev: true /glob-parent/6.0.2: resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} @@ -2802,7 +2817,6 @@ packages: engines: {node: '>= 0.4.0'} dependencies: function-bind: 1.1.1 - dev: true /he/1.2.0: resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} @@ -2860,7 +2874,6 @@ packages: /immutable/4.1.0: resolution: {integrity: sha512-oNkuqVTA8jqG1Q6c+UglTOD1xhC1BtjKI7XkCXRkZHrN5m18/XsnUp8Q89GkQO/z+0WjonSvl0FLhDYftp46nQ==} - dev: true /import-fresh/3.3.0: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} @@ -2945,7 +2958,6 @@ packages: engines: {node: '>=8'} dependencies: binary-extensions: 2.2.0 - dev: true /is-boolean-object/1.1.2: resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} @@ -2968,7 +2980,6 @@ packages: resolution: {integrity: sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg==} dependencies: has: 1.0.3 - dev: true /is-data-descriptor/0.1.4: resolution: {integrity: sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==} @@ -3024,7 +3035,6 @@ packages: /is-extglob/2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} - dev: true /is-fullwidth-code-point/3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} @@ -3041,7 +3051,6 @@ packages: engines: {node: '>=0.10.0'} dependencies: is-extglob: 2.1.1 - dev: true /is-negative-zero/2.0.2: resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} @@ -3065,7 +3074,6 @@ packages: /is-number/7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} - dev: true /is-obj/2.0.0: resolution: {integrity: sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==} @@ -3327,7 +3335,7 @@ packages: resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} dev: false - /lodash-unified/1.0.2_da03a4540fbd16bbaafbb96724306afd: + /lodash-unified/1.0.2_3ib2ivapxullxkx3xftsimdk7u: resolution: {integrity: sha512-OGbEy+1P+UT26CYi4opY4gebD8cWRDxAT6MAObIVQMiqYdxZr1g3QHWCToVsm31x2NkLS4K3+MC2qInaRMa39g==} peerDependencies: '@types/lodash-es': '*' @@ -3452,6 +3460,8 @@ packages: regex-not: 1.0.2 snapdragon: 0.8.2 to-regex: 3.0.2 + transitivePeerDependencies: + - supports-color dev: false /micromatch/4.0.5: @@ -3532,7 +3542,6 @@ packages: /monaco-editor/0.29.1: resolution: {integrity: sha512-rguaEG/zrPQSaKzQB7IfX/PpNa0qxF1FY8ZXRkN4WIl8qZdTQRSRJCtRto7IMcSgrU6H53RXI+fTcywOBC4aVw==} - dev: false /moo/0.5.1: resolution: {integrity: sha512-I1mnb5xn4fO80BH9BLcF0yLypy2UKl+Cb01Fu0hJRkJjlCRtxZMWkTdAtDd5ZqCOxtCkhmRwyI57vWT+1iZ67w==} @@ -3568,6 +3577,8 @@ packages: regex-not: 1.0.2 snapdragon: 0.8.2 to-regex: 3.0.2 + transitivePeerDependencies: + - supports-color dev: false /natural-compare/1.4.0: @@ -3622,7 +3633,6 @@ packages: /normalize-path/3.0.0: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} - dev: true /normalize-wheel-es/1.2.0: resolution: {integrity: sha512-Wj7+EJQ8mSuXr2iWfnujrimU35R2W4FAErEyTmJoJ7ucwTn2hOUSsRehMb5RSYkxXGTM7Y9QpvPmp++w5ftoJw==} @@ -3819,7 +3829,6 @@ packages: /path-parse/1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} - dev: true /path-type/4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} @@ -3836,7 +3845,6 @@ packages: /picomatch/2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} - dev: true /pidtree/0.6.0: resolution: {integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==} @@ -3854,12 +3862,12 @@ packages: '@vue/composition-api': optional: true dependencies: - pinia: 2.0.14_typescript@4.5.4+vue@3.2.25 + pinia: 2.0.14_rvwc7kfd64xpiqorn3aa5sklme vue: 3.2.25 vue-demi: 0.12.5_vue@3.2.25 dev: false - /pinia/2.0.14_typescript@4.5.4+vue@3.2.25: + /pinia/2.0.14_rvwc7kfd64xpiqorn3aa5sklme: resolution: {integrity: sha512-0nPuZR4TetT/WcLN+feMSjWJku3SQU7dBbXC6uw+R6FLQJCsg+/0pzXyD82T1FmAYe0lsx+jnEDQ1BLgkRKlxA==} peerDependencies: '@vue/composition-api': ^1.4.0 @@ -4026,7 +4034,6 @@ packages: engines: {node: '>=8.10.0'} dependencies: picomatch: 2.3.1 - dev: true /redent/3.0.0: resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} @@ -4111,7 +4118,6 @@ packages: is-core-module: 2.10.0 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 - dev: true /restore-cursor/3.1.0: resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} @@ -4157,7 +4163,6 @@ packages: hasBin: true optionalDependencies: fsevents: 2.3.2 - dev: true /run-parallel/1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} @@ -4188,7 +4193,6 @@ packages: chokidar: 3.5.3 immutable: 4.1.0 source-map-js: 1.0.2 - dev: true /semver/5.7.1: resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==} @@ -4301,6 +4305,8 @@ packages: source-map: 0.5.7 source-map-resolve: 0.5.3 use: 3.1.1 + transitivePeerDependencies: + - supports-color dev: false /source-map-js/1.0.2: @@ -4515,7 +4521,6 @@ packages: /supports-preserve-symlinks-flag/1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - dev: true /svg-baker/1.7.0: resolution: {integrity: sha512-nibslMbkXOIkqKVrfcncwha45f97fGuAOn1G99YwnwTj8kF9YiM6XexPcUso97NxOm6GsP0SIvYVIosBis1xLg==} @@ -4533,6 +4538,8 @@ packages: posthtml-svg-mode: 1.0.3 query-string: 4.3.4 traverse: 0.6.6 + transitivePeerDependencies: + - supports-color dev: false /svgo/2.8.0: @@ -4626,6 +4633,10 @@ packages: resolution: {integrity: sha512-vJhccZPs965sV/L2sU4oRQVAos0pQXwsvTLkWYdqJ+a8Q5kPFzJTuOFwy7UniPli44NKQGAglksjvOcpo95aZA==} dev: true + /to-fast-properties/2.0.0: + resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} + engines: {node: '>=4'} + /to-object-path/0.3.0: resolution: {integrity: sha512-9mWHdnGRuh3onocaHzukyvCZhzvr6tiflAy/JRFXcJX0TjgfWA9pk9t8CMbzmBE4Jfw58pXbkngtBtqYxzNEyg==} engines: {node: '>=0.10.0'} @@ -4646,7 +4657,6 @@ packages: engines: {node: '>=8.0'} dependencies: is-number: 7.0.0 - dev: true /to-regex/3.0.2: resolution: {integrity: sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==} @@ -4667,7 +4677,7 @@ packages: engines: {node: '>=8'} dev: true - /ts-node/10.9.1_c532c1b383b0670bfdc8e007fab27648: + /ts-node/10.9.1_yuzmdm4dwbtqx7oi4ad7vmtwja: resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -4764,7 +4774,6 @@ packages: resolution: {integrity: sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==} engines: {node: '>=4.2.0'} hasBin: true - dev: true /typescript/4.7.4: resolution: {integrity: sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==} @@ -4901,7 +4910,6 @@ packages: sass: 1.52.3 optionalDependencies: fsevents: 2.3.2 - dev: true /vue-demi/0.12.5_vue@3.2.25: resolution: {integrity: sha512-BREuTgTYlUr0zw0EZn3hnhC3I6gPWv+Kwh4MCih6QcAeaTlaIX0DwOVN0wHej7hSvDPecz4jygy/idsgKfW58Q==} @@ -4991,7 +4999,6 @@ packages: '@vue/runtime-dom': 3.2.25 '@vue/server-renderer': 3.2.25_vue@3.2.25 '@vue/shared': 3.2.25 - dev: false /which-boxed-primitive/1.0.2: resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} diff --git a/src/components/sql/Filter.vue b/src/components/sql/Filter.vue index 72bb3895..7ab0b074 100644 --- a/src/components/sql/Filter.vue +++ b/src/components/sql/Filter.vue @@ -15,12 +15,9 @@ const emit = defineEmits(['tableCommand']) // const loginStore = useLoginStore() const treeLoading = ref(false) -const columns = ref([]) const selectV2Columns = ref([]) const tree = ref([]) const defaultExpandKeys = ref([]) -const seletedColumn = ref() -const selectedColumnObj = ref() const treeInstance = ref() const dataloading = ref(false) const dragEle = ref() @@ -66,8 +63,6 @@ const getTreeData = () => { Promise.all([queryAllColumns(), queryAllTables(), queryAllDatabases()]) .then(res => { const dataArr = res.map(item => item.data) - columns.value = dataArr[0] - selectV2Columns.value = dataArr[0].map((item: any) => ({ label: item.name, value: `${item.database}.${item.table}.${item.name}`})) tree.value = createTree( dataArr[0], dataArr[1], @@ -88,15 +83,15 @@ const clickCommand = (node: any, command: string) => { } const changeSelected = (val: string) => { - if (selectedColumnObj.value) { - selectedColumnObj.value.selected = false - } - const [database, table, currentCol] = val.split('.') - const selectedColumn = columns.value.find((item: any) => item.name === currentCol) - selectedColumnObj.value = selectedColumn - selectedColumn.selected = true - treeInstance.value.store.nodesMap[database].expanded = true - treeInstance.value.store.nodesMap[table].expanded = true + // if (selectedColumnObj.value) { + // selectedColumnObj.value.selected = false + // } + // const [database, table, currentCol] = val.split('.') + // const selectedColumn = columns.value.find((item: any) => item.name === currentCol) + // selectedColumnObj.value = selectedColumn + // selectedColumn.selected = true + // treeInstance.value.store.nodesMap[database].expanded = true + // treeInstance.value.store.nodesMap[table].expanded = true // setTimeout(() => { // console.log(`#${database}-${table}-${currentCol}`) @@ -142,15 +137,17 @@ defineExpose({ class="loading" > +
+ +
- - - - - + - - +
@@ -361,10 +303,15 @@ defineExpose({ border-bottom-right-radius: 4px; border-top-right-radius: 4px; } +.search-checkbox { + display: flex; + justify-content: left; + align-items: left; + height: 32px; +} .custom-tree-node { position: relative; font-size: 16px; - line-height: 56px; z-index: 2; } .tree-content { @@ -372,14 +319,12 @@ defineExpose({ overflow-y: auto; :deep(.el-tree-node__content) { - position: relative; - height: 56px; background-color: unset; } .suffix { position: absolute; - top: 17px; - right: 10px; + top: 0px; + right: 0px; color: rgba(255, 255, 255, 0.45); z-index: 2; } @@ -390,8 +335,8 @@ defineExpose({ .root-btn { position: absolute; - top: 17px; - right: 10px; + top: 5px; + right: 0px; display: flex; z-index: 2; @@ -414,5 +359,12 @@ defineExpose({ position: relative; z-index: 2; } + .open-btn { + margin-left: 2px; + + *:hover { + color: var(--el-color-primary) !important; + } + } } diff --git a/src/components/sql/query.ts b/src/components/sql/query.ts index 1ba256be..a2eb7f7b 100644 --- a/src/components/sql/query.ts +++ b/src/components/sql/query.ts @@ -72,6 +72,7 @@ export const queryAllTables = () => { const sql = `SELECT t.database, t.name, t.engine, + t.total_rows, -- t.*, pa.size FROM system.tables as t ANY LEFT JOIN ( SELECT database,table as name,formatReadableSize(sum(bytes)) as size FROM system.parts GROUP BY database,name ) as pa USING (database,name) diff --git a/src/components/sql/types.ts b/src/components/sql/types.ts index 23f0d0af..aff51987 100644 --- a/src/components/sql/types.ts +++ b/src/components/sql/types.ts @@ -25,6 +25,7 @@ export type ColumnItem = { export type TableItem = { database: string engine: string + total_rows: number name: string size: string } diff --git a/src/components/sql/utils.ts b/src/components/sql/utils.ts index efce1f5b..b9495818 100644 --- a/src/components/sql/utils.ts +++ b/src/components/sql/utils.ts @@ -9,7 +9,7 @@ export const createTree = (columns: ColumnItem[], tables: TableItem[], database: const children = columns.filter((col) => col.table === item.name) return { ...item, - children: [] + children } }) diff --git a/src/main.ts b/src/main.ts index 55a30734..59c9a83b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -19,6 +19,8 @@ import { addRouteHooks } from './router/utils' import { GlobalEvents } from 'vue-global-events' +// import * as ElementPlusIconsVue from '@element-plus/icons-vue' + const app = createApp(App) app.use(i18n) app.use(ElementPlus) @@ -26,3 +28,7 @@ app.use(addRouteHooks(router)) app.use(piniaStore) app.mount('#app') app.component('GlobalEvents', GlobalEvents) + +// for (const [key, component] of Object.entries(ElementPlusIconsVue)) { +// app.component(key, component) +// } \ No newline at end of file From a7259011f3529fad414d5f4adcd5a290960ae671 Mon Sep 17 00:00:00 2001 From: Daniel Gloeckner Date: Tue, 13 Sep 2022 23:07:11 +0200 Subject: [PATCH 5/7] feat: finit login params from URL --- src/views/login.vue | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/views/login.vue b/src/views/login.vue index 2e08a0eb..becf8a6f 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -178,7 +178,10 @@ import { ref, reactive, onMounted, onUnmounted } from 'vue' import { useLoginStore } from '@/store' import { useGoTo } from '@/layout/hooks' + import { useRoute, useRouter } from 'vue-router' + const router = useRouter() + const route = useRoute() const goTo = useGoTo() const loginStore = useLoginStore() @@ -204,6 +207,27 @@ onMounted(() => { // @keyup.enter="login" document.addEventListener('keyup', keyupLogin) + // Initialize defaults from URL parameters. + if (route.query.connectionName) { + if (typeof route.query.connectionName === 'string') { + loginForm.connectionName = route.query.connectionName + } + } + if (route.query.connectionUrl) { + if (typeof route.query.connectionUrl === 'string') { + loginForm.connectionUrl = route.query.connectionUrl + } + } + if (route.query.username) { + if (typeof route.query.username === 'string') { + loginForm.username = route.query.username + } + } + if (route.query.password) { + if (typeof route.query.password === 'string') { + loginForm.password = route.query.password + } + } }) onUnmounted(() => [ From b878423743d6042cd38903308171a2076c2f2509 Mon Sep 17 00:00:00 2001 From: Daniel Gloeckner Date: Wed, 14 Sep 2022 00:10:24 +0200 Subject: [PATCH 6/7] feat: make views switchable --- .env | 5 ++++- src/layout/Header.vue | 25 +++++++++++++++++-------- src/utils/http.ts | 2 +- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/.env b/.env index 7d95f6fb..0b851bbf 100644 --- a/.env +++ b/.env @@ -1,2 +1,5 @@ # 机器学习模块接口地址,此处配合 proxy -VITE_MACHINELEARNING_URL="/ml" \ No newline at end of file +VITE_MACHINELEARNING_URL="/ml" + +VITE_ENABLE_GRAPH=true +VITE_ENABLE_ML=true diff --git a/src/layout/Header.vue b/src/layout/Header.vue index 0f8c6604..34f88924 100644 --- a/src/layout/Header.vue +++ b/src/layout/Header.vue @@ -6,18 +6,27 @@ import { useGoTo } from './hooks' import { RouteName } from './types' import i18n from '@/i18n' +import.meta.env.VITE_SOME_KEY + const router = useRouter() const route = useRoute() const goTo = useGoTo() -const nvaList = [ - RouteName.Metrics, +const getNavList = () => { + const routes= [RouteName.Metrics, RouteName.SQL, - RouteName.Processes, - RouteName.Graph, - RouteName.Ml, - RouteName.HistorySQL -] + RouteName.Processes] + if (import.meta.env.VITE_ENABLE_GRAPH == 'true') { + routes.push(RouteName.Graph) + } + if (import.meta.env.VITE_ENABLE_ML == 'true') { + routes.push(RouteName.Ml) + } + routes.push(RouteName.HistorySQL) + return routes +} + +const nvaList = [RouteName.SQL] const hasRouteName = (item: string) => { return (route.name as string)?.startsWith(item) @@ -57,7 +66,7 @@ const goGithub = () => {