add get file content service
diff --git a/.env.development b/.env.development
new file mode 100644
index 0000000..89fe736
--- /dev/null
+++ b/.env.development
@@ -0,0 +1,18 @@
+ # 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.
+
+NODE_ENV=development
+
+VITE_APP_DEV_WEB_URL='http://127.0.0.1:12345'
diff --git a/.env.production b/.env.production
new file mode 100644
index 0000000..74bc29d
--- /dev/null
+++ b/.env.production
@@ -0,0 +1,18 @@
+ # 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.
+
+NODE_ENV=production
+
+VITE_APP_PROD_WEB_URL=''
diff --git a/package.json b/package.json
index 217f830..6216b90 100644
--- a/package.json
+++ b/package.json
@@ -21,17 +21,21 @@
"*.{.ts,.tsx,.vue}": "eslint --fix"
},
"dependencies": {
+ "axios": "^0.27.2",
+ "lodash": "^4.17.21",
"monaco-editor": "^0.34.0",
"naive-ui": "2.32.0",
"nprogress": "^0.2.0",
"pinia": "^2.0.21",
"pinia-plugin-persistedstate": "^2.1.1",
+ "qs": "^6.11.0",
"vue": "^3.2.37",
"vue-i18n": "^9.2.2",
"vue-router": "^4.1.5"
},
"devDependencies": {
"@types/nprogress": "^0.2.0",
+ "@types/qs": "^6.9.7",
"@typescript-eslint/eslint-plugin": "^5.0.0",
"@vicons/antd": "^0.12.0",
"@vitejs/plugin-vue": "^3.0.3",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 1cee548..eb649dd 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -2,10 +2,12 @@
specifiers:
'@types/nprogress': ^0.2.0
+ '@types/qs': ^6.9.7
'@typescript-eslint/eslint-plugin': ^5.0.0
'@vicons/antd': ^0.12.0
'@vitejs/plugin-vue': ^3.0.3
'@vitejs/plugin-vue-jsx': ^2.0.0
+ axios: ^0.27.2
eslint: ^8.0.1
eslint-config-prettier: ^8.5.0
eslint-config-standard-with-typescript: ^22.0.0
@@ -16,12 +18,14 @@
eslint-plugin-vue: ^9.4.0
husky: ^8.0.0
lint-staged: ^13.0.3
+ lodash: ^4.17.21
monaco-editor: ^0.34.0
naive-ui: 2.32.0
nprogress: ^0.2.0
pinia: ^2.0.21
pinia-plugin-persistedstate: ^2.1.1
prettier: ^2.7.1
+ qs: ^6.11.0
sass: ^1.54.5
typescript: '*'
vite: ^3.0.7
@@ -33,17 +37,21 @@
vue-tsc: ^0.39.5
dependencies:
+ axios: registry.npmmirror.com/axios/0.27.2
+ lodash: registry.npmmirror.com/lodash/4.17.21
monaco-editor: 0.34.0
naive-ui: 2.32.0_vue@3.2.37
nprogress: 0.2.0
pinia: 2.0.21_typescript@4.8.2+vue@3.2.37
pinia-plugin-persistedstate: 2.1.1_pinia@2.0.21
+ qs: registry.npmmirror.com/qs/6.11.0
vue: 3.2.37
vue-i18n: 9.2.2_vue@3.2.37
vue-router: 4.1.5_vue@3.2.37
devDependencies:
'@types/nprogress': 0.2.0
+ '@types/qs': registry.npmmirror.com/@types/qs/6.9.7
'@typescript-eslint/eslint-plugin': 5.35.1_eslint@8.23.0+typescript@4.8.2
'@vicons/antd': 0.12.0
'@vitejs/plugin-vue': 3.0.3_vite@3.0.9+vue@3.2.37
@@ -526,7 +534,7 @@
'@rushstack/rig-package': 0.3.14
'@rushstack/ts-command-line': 4.12.2
colors: 1.2.5
- lodash: 4.17.21
+ lodash: registry.npmmirror.com/lodash/4.17.21
resolve: 1.17.0
semver: 7.3.7
source-map: 0.6.1
@@ -1077,8 +1085,8 @@
/call-bind/1.0.2:
resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==}
dependencies:
- function-bind: 1.1.1
- get-intrinsic: 1.1.2
+ function-bind: registry.npmmirror.com/function-bind/1.1.1
+ get-intrinsic: registry.npmmirror.com/get-intrinsic/1.1.2
dev: true
/callsites/3.1.0:
@@ -1255,15 +1263,15 @@
resolution: {integrity: sha512-WEm2oBhfoI2sImeM4OF2zE2V3BYdSF+KnSi9Sidz51fQHd7+JuF8Xgcj9/0o+OWeIeIS/MiuNnlruQrJf16GQA==}
engines: {node: '>= 0.4'}
dependencies:
- call-bind: 1.0.2
+ call-bind: registry.npmmirror.com/call-bind/1.0.2
es-to-primitive: 1.2.1
- function-bind: 1.1.1
+ function-bind: registry.npmmirror.com/function-bind/1.1.1
function.prototype.name: 1.1.5
- get-intrinsic: 1.1.2
+ get-intrinsic: registry.npmmirror.com/get-intrinsic/1.1.2
get-symbol-description: 1.0.0
- has: 1.0.3
+ has: registry.npmmirror.com/has/1.0.3
has-property-descriptors: 1.0.0
- has-symbols: 1.0.3
+ has-symbols: registry.npmmirror.com/has-symbols/1.0.3
internal-slot: 1.0.3
is-callable: 1.2.4
is-negative-zero: 2.0.2
@@ -1283,7 +1291,7 @@
/es-shim-unscopables/1.0.0:
resolution: {integrity: sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==}
dependencies:
- has: 1.0.3
+ has: registry.npmmirror.com/has/1.0.3
dev: true
/es-to-primitive/1.2.1:
@@ -1729,7 +1737,7 @@
resolution: {integrity: sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==}
engines: {node: '>= 0.4'}
dependencies:
- call-bind: 1.0.2
+ call-bind: registry.npmmirror.com/call-bind/1.0.2
define-properties: 1.1.4
es-abstract: 1.20.1
functions-have-names: 1.2.3
@@ -1751,17 +1759,17 @@
/get-intrinsic/1.1.2:
resolution: {integrity: sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==}
dependencies:
- function-bind: 1.1.1
- has: 1.0.3
- has-symbols: 1.0.3
+ function-bind: registry.npmmirror.com/function-bind/1.1.1
+ has: registry.npmmirror.com/has/1.0.3
+ has-symbols: registry.npmmirror.com/has-symbols/1.0.3
dev: true
/get-symbol-description/1.0.0:
resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==}
engines: {node: '>= 0.4'}
dependencies:
- call-bind: 1.0.2
- get-intrinsic: 1.1.2
+ call-bind: registry.npmmirror.com/call-bind/1.0.2
+ get-intrinsic: registry.npmmirror.com/get-intrinsic/1.1.2
dev: true
/glob-parent/5.1.2:
@@ -1838,19 +1846,14 @@
/has-property-descriptors/1.0.0:
resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==}
dependencies:
- get-intrinsic: 1.1.2
- dev: true
-
- /has-symbols/1.0.3:
- resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==}
- engines: {node: '>= 0.4'}
+ get-intrinsic: registry.npmmirror.com/get-intrinsic/1.1.2
dev: true
/has-tostringtag/1.0.0:
resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==}
engines: {node: '>= 0.4'}
dependencies:
- has-symbols: 1.0.3
+ has-symbols: registry.npmmirror.com/has-symbols/1.0.3
dev: true
/has/1.0.3:
@@ -1912,9 +1915,9 @@
resolution: {integrity: sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==}
engines: {node: '>= 0.4'}
dependencies:
- get-intrinsic: 1.1.2
- has: 1.0.3
- side-channel: 1.0.4
+ get-intrinsic: registry.npmmirror.com/get-intrinsic/1.1.2
+ has: registry.npmmirror.com/has/1.0.3
+ side-channel: registry.npmmirror.com/side-channel/1.0.4
dev: true
/is-bigint/1.0.4:
@@ -1934,7 +1937,7 @@
resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==}
engines: {node: '>= 0.4'}
dependencies:
- call-bind: 1.0.2
+ call-bind: registry.npmmirror.com/call-bind/1.0.2
has-tostringtag: 1.0.0
dev: true
@@ -1984,14 +1987,14 @@
resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==}
engines: {node: '>= 0.4'}
dependencies:
- call-bind: 1.0.2
+ call-bind: registry.npmmirror.com/call-bind/1.0.2
has-tostringtag: 1.0.0
dev: true
/is-shared-array-buffer/1.0.2:
resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==}
dependencies:
- call-bind: 1.0.2
+ call-bind: registry.npmmirror.com/call-bind/1.0.2
dev: true
/is-string/1.0.7:
@@ -2005,13 +2008,13 @@
resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==}
engines: {node: '>= 0.4'}
dependencies:
- has-symbols: 1.0.3
+ has-symbols: registry.npmmirror.com/has-symbols/1.0.3
dev: true
/is-weakref/1.0.2:
resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==}
dependencies:
- call-bind: 1.0.2
+ call-bind: registry.npmmirror.com/call-bind/1.0.2
dev: true
/jju/1.4.0:
@@ -2101,9 +2104,6 @@
resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==}
dev: true
- /lodash/4.17.21:
- resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==}
-
/lru-cache/6.0.0:
resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==}
engines: {node: '>=10'}
@@ -2179,7 +2179,7 @@
date-fns-tz: 1.3.6_date-fns@2.29.2
evtd: 0.2.4
highlight.js: 11.6.0
- lodash: 4.17.21
+ lodash: registry.npmmirror.com/lodash/4.17.21
lodash-es: 4.17.21
seemly: 0.3.6
treemate: 0.3.11
@@ -2226,9 +2226,9 @@
resolution: {integrity: sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==}
engines: {node: '>= 0.4'}
dependencies:
- call-bind: 1.0.2
+ call-bind: registry.npmmirror.com/call-bind/1.0.2
define-properties: 1.1.4
- has-symbols: 1.0.3
+ has-symbols: registry.npmmirror.com/has-symbols/1.0.3
object-keys: 1.1.1
dev: true
@@ -2394,7 +2394,7 @@
resolution: {integrity: sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==}
engines: {node: '>= 0.4'}
dependencies:
- call-bind: 1.0.2
+ call-bind: registry.npmmirror.com/call-bind/1.0.2
define-properties: 1.1.4
functions-have-names: 1.2.3
dev: true
@@ -2495,14 +2495,6 @@
shebang-regex: registry.npmmirror.com/shebang-regex/3.0.0
dev: true
- /side-channel/1.0.4:
- resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==}
- dependencies:
- call-bind: 1.0.2
- get-intrinsic: 1.1.2
- object-inspect: registry.npmmirror.com/object-inspect/1.12.2
- dev: true
-
/slash/3.0.0:
resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==}
engines: {node: '>=8'}
@@ -2526,7 +2518,7 @@
/string.prototype.trimend/1.0.5:
resolution: {integrity: sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog==}
dependencies:
- call-bind: 1.0.2
+ call-bind: registry.npmmirror.com/call-bind/1.0.2
define-properties: 1.1.4
es-abstract: 1.20.1
dev: true
@@ -2534,7 +2526,7 @@
/string.prototype.trimstart/1.0.5:
resolution: {integrity: sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg==}
dependencies:
- call-bind: 1.0.2
+ call-bind: registry.npmmirror.com/call-bind/1.0.2
define-properties: 1.1.4
es-abstract: 1.20.1
dev: true
@@ -2649,9 +2641,9 @@
/unbox-primitive/1.0.2:
resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==}
dependencies:
- call-bind: 1.0.2
+ call-bind: registry.npmmirror.com/call-bind/1.0.2
has-bigints: 1.0.2
- has-symbols: 1.0.3
+ has-symbols: registry.npmmirror.com/has-symbols/1.0.3
which-boxed-primitive: 1.0.2
dev: true
@@ -2795,7 +2787,7 @@
eslint-visitor-keys: 3.3.0
espree: 9.4.0
esquery: 1.4.0
- lodash: 4.17.21
+ lodash: registry.npmmirror.com/lodash/4.17.21
semver: 7.3.7
transitivePeerDependencies:
- supports-color
@@ -2923,6 +2915,12 @@
dev: true
optional: true
+ registry.npmmirror.com/@types/qs/6.9.7:
+ resolution: {integrity: sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@types/qs/-/qs-6.9.7.tgz}
+ name: '@types/qs'
+ version: 6.9.7
+ dev: true
+
registry.npmmirror.com/aggregate-error/3.1.0:
resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/aggregate-error/-/aggregate-error-3.1.0.tgz}
name: aggregate-error
@@ -2988,6 +2986,23 @@
engines: {node: '>=8'}
dev: true
+ registry.npmmirror.com/asynckit/0.4.0:
+ resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz}
+ name: asynckit
+ version: 0.4.0
+ dev: false
+
+ registry.npmmirror.com/axios/0.27.2:
+ resolution: {integrity: sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/axios/-/axios-0.27.2.tgz}
+ name: axios
+ version: 0.27.2
+ dependencies:
+ follow-redirects: registry.npmmirror.com/follow-redirects/1.15.1
+ form-data: registry.npmmirror.com/form-data/4.0.0
+ transitivePeerDependencies:
+ - debug
+ dev: false
+
registry.npmmirror.com/braces/3.0.2:
resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/braces/-/braces-3.0.2.tgz}
name: braces
@@ -2997,6 +3012,14 @@
fill-range: registry.npmmirror.com/fill-range/7.0.1
dev: true
+ registry.npmmirror.com/call-bind/1.0.2:
+ resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/call-bind/-/call-bind-1.0.2.tgz}
+ name: call-bind
+ version: 1.0.2
+ dependencies:
+ function-bind: registry.npmmirror.com/function-bind/1.1.1
+ get-intrinsic: registry.npmmirror.com/get-intrinsic/1.1.2
+
registry.npmmirror.com/clean-stack/2.2.0:
resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/clean-stack/-/clean-stack-2.2.0.tgz}
name: clean-stack
@@ -3068,6 +3091,15 @@
version: 2.0.19
dev: true
+ registry.npmmirror.com/combined-stream/1.0.8:
+ resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz}
+ name: combined-stream
+ version: 1.0.8
+ engines: {node: '>= 0.8'}
+ dependencies:
+ delayed-stream: registry.npmmirror.com/delayed-stream/1.0.0
+ dev: false
+
registry.npmmirror.com/commander/2.20.3:
resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/commander/-/commander-2.20.3.tgz}
name: commander
@@ -3108,6 +3140,13 @@
ms: registry.npmmirror.com/ms/2.1.2
dev: true
+ registry.npmmirror.com/delayed-stream/1.0.0:
+ resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz}
+ name: delayed-stream
+ version: 1.0.0
+ engines: {node: '>=0.4.0'}
+ dev: false
+
registry.npmmirror.com/eastasianwidth/0.2.0:
resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz}
name: eastasianwidth
@@ -3372,6 +3411,29 @@
to-regex-range: registry.npmmirror.com/to-regex-range/5.0.1
dev: true
+ registry.npmmirror.com/follow-redirects/1.15.1:
+ resolution: {integrity: sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.1.tgz}
+ name: follow-redirects
+ version: 1.15.1
+ engines: {node: '>=4.0'}
+ peerDependencies:
+ debug: '*'
+ peerDependenciesMeta:
+ debug:
+ optional: true
+ dev: false
+
+ registry.npmmirror.com/form-data/4.0.0:
+ resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/form-data/-/form-data-4.0.0.tgz}
+ name: form-data
+ version: 4.0.0
+ engines: {node: '>= 6'}
+ dependencies:
+ asynckit: registry.npmmirror.com/asynckit/0.4.0
+ combined-stream: registry.npmmirror.com/combined-stream/1.0.8
+ mime-types: registry.npmmirror.com/mime-types/2.1.35
+ dev: false
+
registry.npmmirror.com/fsevents/2.3.2:
resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/fsevents/-/fsevents-2.3.2.tgz}
name: fsevents
@@ -3382,6 +3444,20 @@
dev: true
optional: true
+ registry.npmmirror.com/function-bind/1.1.1:
+ resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/function-bind/-/function-bind-1.1.1.tgz}
+ name: function-bind
+ version: 1.1.1
+
+ registry.npmmirror.com/get-intrinsic/1.1.2:
+ resolution: {integrity: sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/get-intrinsic/-/get-intrinsic-1.1.2.tgz}
+ name: get-intrinsic
+ version: 1.1.2
+ dependencies:
+ function-bind: registry.npmmirror.com/function-bind/1.1.1
+ has: registry.npmmirror.com/has/1.0.3
+ has-symbols: registry.npmmirror.com/has-symbols/1.0.3
+
registry.npmmirror.com/get-stream/6.0.1:
resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/get-stream/-/get-stream-6.0.1.tgz}
name: get-stream
@@ -3397,6 +3473,20 @@
dev: true
optional: true
+ registry.npmmirror.com/has-symbols/1.0.3:
+ resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/has-symbols/-/has-symbols-1.0.3.tgz}
+ name: has-symbols
+ version: 1.0.3
+ engines: {node: '>= 0.4'}
+
+ registry.npmmirror.com/has/1.0.3:
+ resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/has/-/has-1.0.3.tgz}
+ name: has
+ version: 1.0.3
+ engines: {node: '>= 0.4.0'}
+ dependencies:
+ function-bind: registry.npmmirror.com/function-bind/1.1.1
+
registry.npmmirror.com/human-signals/3.0.1:
resolution: {integrity: sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/human-signals/-/human-signals-3.0.1.tgz}
name: human-signals
@@ -3506,6 +3596,11 @@
wrap-ansi: registry.npmmirror.com/wrap-ansi/7.0.0
dev: true
+ registry.npmmirror.com/lodash/4.17.21:
+ resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz}
+ name: lodash
+ version: 4.17.21
+
registry.npmmirror.com/log-update/4.0.0:
resolution: {integrity: sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/log-update/-/log-update-4.0.0.tgz}
name: log-update
@@ -3534,6 +3629,22 @@
picomatch: registry.npmmirror.com/picomatch/2.3.1
dev: true
+ registry.npmmirror.com/mime-db/1.52.0:
+ resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/mime-db/-/mime-db-1.52.0.tgz}
+ name: mime-db
+ version: 1.52.0
+ engines: {node: '>= 0.6'}
+ dev: false
+
+ registry.npmmirror.com/mime-types/2.1.35:
+ resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/mime-types/-/mime-types-2.1.35.tgz}
+ name: mime-types
+ version: 2.1.35
+ engines: {node: '>= 0.6'}
+ dependencies:
+ mime-db: registry.npmmirror.com/mime-db/1.52.0
+ dev: false
+
registry.npmmirror.com/mimic-fn/2.1.0:
resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/mimic-fn/-/mimic-fn-2.1.0.tgz}
name: mimic-fn
@@ -3574,7 +3685,6 @@
resolution: {integrity: sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/object-inspect/-/object-inspect-1.12.2.tgz}
name: object-inspect
version: 1.12.2
- dev: true
registry.npmmirror.com/onetime/5.1.2:
resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/onetime/-/onetime-5.1.2.tgz}
@@ -3632,6 +3742,15 @@
hasBin: true
dev: true
+ registry.npmmirror.com/qs/6.11.0:
+ resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/qs/-/qs-6.11.0.tgz}
+ name: qs
+ version: 6.11.0
+ engines: {node: '>=0.6'}
+ dependencies:
+ side-channel: registry.npmmirror.com/side-channel/1.0.4
+ dev: false
+
registry.npmmirror.com/restore-cursor/3.1.0:
resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/restore-cursor/-/restore-cursor-3.1.0.tgz}
name: restore-cursor
@@ -3672,6 +3791,15 @@
engines: {node: '>=8'}
dev: true
+ registry.npmmirror.com/side-channel/1.0.4:
+ resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/side-channel/-/side-channel-1.0.4.tgz}
+ name: side-channel
+ version: 1.0.4
+ dependencies:
+ call-bind: registry.npmmirror.com/call-bind/1.0.2
+ get-intrinsic: registry.npmmirror.com/get-intrinsic/1.1.2
+ object-inspect: registry.npmmirror.com/object-inspect/1.12.2
+
registry.npmmirror.com/signal-exit/3.0.7:
resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/signal-exit/-/signal-exit-3.0.7.tgz}
name: signal-exit
diff --git a/studio/components/monaco/index.tsx b/studio/components/monaco/index.tsx
index 24f897c..ed8c5cf 100644
--- a/studio/components/monaco/index.tsx
+++ b/studio/components/monaco/index.tsx
@@ -59,6 +59,7 @@
if (dom) {
editor = monaco.editor.create(dom, {
...props.options,
+ value: props.defaultValue ?? props.value,
automaticLayout: true,
theme: 'vs'
})
diff --git a/studio/components/tab/index.tsx b/studio/components/tab/index.tsx
index e547b2a..ebd3653 100644
--- a/studio/components/tab/index.tsx
+++ b/studio/components/tab/index.tsx
@@ -15,31 +15,63 @@
* limitations under the License.
*/
-import { defineComponent, ref } from 'vue'
+import { defineComponent, ref, PropType, onMounted } from 'vue'
import { NTabPane, NTabs } from 'naive-ui'
+import { MonacoEditor } from '../monaco'
+import { getFileContent } from '@/service/modules/file'
+
+interface ITab {
+ id: number
+ name: string
+}
+
+const props = {
+ value: {
+ type: Array as PropType<ITab[]>,
+ default: []
+ }
+}
export const Tabs = defineComponent({
name: 'tabs',
- setup() {
- const fileRef = ref(1)
+ props,
+ setup(props) {
+ const fileRef = ref<string | number>()
+
+ const updateContent = (value: number) => {
+ fileRef.value = value
+ getFileContent(value)
+ }
const handleClose = () => {}
- const tabPanes = [1, 2, 3].map((item) => {
+ const handleChange = (value: number) => {
+ updateContent(value)
+ }
+
+ const tabPanes = props.value.map((item) => {
return (
- <NTabPane name={item} key={item} tab={item.toString()}>
- {{ item }}
+ <NTabPane name={item.id} key={item.id} tab={item.name}>
+ <MonacoEditor defaultValue={item.name} />
</NTabPane>
)
})
+ onMounted(() => {
+ if (props.value.length) {
+ updateContent(props.value[0].id)
+ }
+ })
+
return () => (
<NTabs
value={fileRef.value}
type='card'
closable
tabStyle={{ minWidth: '80px' }}
+ size='small'
onClose={handleClose}
+ on-update:value={handleChange}
>
{tabPanes}
</NTabs>
diff --git a/studio/pages/editor.tsx b/studio/pages/editor.tsx
index 5eabe33..3e1acdc 100644
--- a/studio/pages/editor.tsx
+++ b/studio/pages/editor.tsx
@@ -19,7 +19,6 @@
import { defineComponent } from 'vue'
import { Toolbar } from '../components/toolbar'
import { Tabs } from '../components/tab'
-import { MonacoEditor } from '../components/monaco'
export const EditorPage = defineComponent({
name: 'editor-page',
@@ -31,7 +30,6 @@
</NLayoutHeader>
<NLayoutContent>
<Tabs />
- <MonacoEditor />
</NLayoutContent>
</NLayout>
)
diff --git a/studio/service/modules/file/index.ts b/studio/service/modules/file/index.ts
new file mode 100644
index 0000000..c6f1cea
--- /dev/null
+++ b/studio/service/modules/file/index.ts
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ */
+
+import { axios } from '@/service/service'
+
+export const getFileContent = (id: number) => {
+ return axios({
+ url: `files/${id}`,
+ method: 'get'
+ })
+}
diff --git a/studio/service/service.ts b/studio/service/service.ts
new file mode 100644
index 0000000..6109131
--- /dev/null
+++ b/studio/service/service.ts
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ */
+
+import axios, { AxiosRequestConfig, AxiosResponse } from 'axios'
+import qs from 'qs'
+import _ from 'lodash'
+
+/**
+ * @description Log and display errors
+ * @param {Error} error Error object
+ */
+const handleError = (res: AxiosResponse<any, any>) => {
+ // Print to console
+ if (import.meta.env.MODE === 'development') {
+ // eslint-disable-next-line no-console
+ console.error(res)
+ }
+}
+
+const baseRequestConfig: AxiosRequestConfig = {
+ baseURL: '/',
+ timeout: 1500,
+ transformRequest: (params) => {
+ if (_.isPlainObject(params)) {
+ return qs.stringify(params, { arrayFormat: 'repeat' })
+ } else {
+ return params
+ }
+ },
+ paramsSerializer: (params) => {
+ return qs.stringify(params, { arrayFormat: 'repeat' })
+ }
+}
+
+const service = axios.create(baseRequestConfig)
+
+// The response to intercept
+service.interceptors.response.use(async (res: AxiosResponse) => {
+ if (res.data.code === undefined) {
+ return res.data
+ }
+
+ switch (res.data.code) {
+ case 0:
+ return res.data.data
+ default:
+ handleError(res)
+ throw new Error()
+ }
+})
+
+export { service as axios }
diff --git a/tsconfig.json b/tsconfig.json
index 7c045fa..4a78edf 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -14,7 +14,10 @@
"skipLibCheck": true,
"noEmit": true,
"declaration": true,
- "declarationDir": "dist"
+ "declarationDir": "dist",
+ "paths": {
+ "@/*": ["studio/*"]
+ },
},
"include": [
"src/**/*.ts",
diff --git a/vite.config.ts b/vite.config.ts
index b98a67c..ab05d2a 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -15,11 +15,12 @@
* limitations under the License.
*/
-import { defineConfig } from 'vite'
+import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import viteCompression from 'vite-plugin-compression'
import dts from 'vite-plugin-dts'
+import path from 'path'
// https://vitejs.dev/config/
export default defineConfig({
@@ -38,6 +39,19 @@
formats: ['es']
}
},
+ resolve: {
+ alias: {
+ '@': path.resolve(__dirname, 'studio')
+ }
+ },
+ server: {
+ proxy: {
+ '/stdio/api': {
+ target: loadEnv('development', './').VITE_APP_DEV_WEB_URL,
+ changeOrigin: true
+ }
+ }
+ },
plugins: [
vue(),
vueJsx(),