Skip to content

Commit d258da5

Browse files
Hoang Nguyendavidjumani
andauthored
UI: Upgrade to Vue3 library (apache#5151)
* add new vue 3 library & and 2.x (beta) * edit config files, settings, utils, store,... corresponding to Vue 3 * edit layout and config to suit the new library * fix header & side menu * components, autogenview * fix dashboard & compute * compute: fix form errors * storage: fix form & template by vue3 * networks: fix form & template by vue3 * image: fix form & template by vue3 * project: fix by vue3 library * user: fix by vue3 * iam: fix by vue3 * fix zoneWizard & tooltip click event * fix infra > physicalnetwork & visible modal * fix infra by vue3 & antdv 2x * fix offerings by vue3 * fix plugin by vue3 * fix form & action form * update the ant-design latest version * fix icon, style dark mode, menu * fix unittest * fix babel plugins not found * add name,ref missing & callback i18n not found * fix slot & info icon * fix unit test * fix tooltip label of form item * fix lint errors * using global app, globalProperties * add focus directive & edit the position of ctrl+Enter * upgrage Vue 3 version * fix main UT * fix build failed * using `optionFilterProp="label"' & fix build fail * fix UT with new code * fix icons of undefined * fix error run app * fix selectbox options * add vue version for clear storage * fix template * fix template of iprange form * fix warning test UT * fix conflit * fix build failed * fix error run app the first time after upgrade * fix auto-complete & watch object/array * fix error run application * fix error build * fix form, icon, template & locales * fix conflit & form * remove slot errors * fix error build & test UT * fix error template * Add licenses for missing files * add scroll to first errors * add scroll to first errors * fix select filter, tag event * add shallowRef async component are missing * fix css, upgrade vue-cropper version * fix css * fix vue 3 coding for new components * Remove unused components * fixes `this` not found in @/roles * fix redirect after login again when session expired error * fix openKeys menu & watch router * fixes * fix build failed * fixes * fixes ut * fixes * fixes eslint * fixes * fixes * fixes css * fix menu sidebar css * fix some css icon, images * fix build fail * fixes * fixes * fixes * fixes * fix publicip resource * fixes ut * fixes * fixes * fixes layout mode * fixes dropdown filter columns * fixes dashboard & hidden setting for normal user * fixes * fixes layout * fixes avatar * fixes * Add missing else * Fix query in routable paths Co-authored-by: davidjumani <dj.davidjumani1994@gmail.com>
1 parent 7439581 commit d258da5

File tree

297 files changed

+29330
-28462
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

297 files changed

+29330
-28462
lines changed

ui/.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2+
"plugins": [
3+
["import", { "libraryName": "ant-design-vue", "libraryDirectory": "lib"}, "ant-design-vue"]
4+
],
25
"env": {
36
"test": {
47
"plugins": ["require-context-hook"]

ui/jest.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
// under the License.
1717

1818
module.exports = {
19+
preset: '@vue/cli-plugin-unit-jest',
1920
testURL: 'http://localhost/',
2021
setupFiles: ['<rootDir>/tests/setup.js'],
2122
moduleFileExtensions: [
@@ -41,7 +42,7 @@ module.exports = {
4142
'**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)'
4243
],
4344
transformIgnorePatterns: [
44-
'<rootDir>/node_modules/(?!ant-design-vue|vue)'
45+
'<rootDir>/node_modules/(?!ant-design-vue|vue|@babel/runtime|lodash-es|@ant-design)'
4546
],
4647
collectCoverage: true,
4748
collectCoverageFrom: [

ui/package-lock.json

Lines changed: 10651 additions & 13171 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/package.json

Lines changed: 46 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
"@fortawesome/fontawesome-svg-core": "^1.2.34",
3838
"@fortawesome/free-brands-svg-icons": "^5.15.2",
3939
"@fortawesome/free-solid-svg-icons": "^5.15.2",
40-
"@fortawesome/vue-fontawesome": "^2.0.2",
41-
"ant-design-vue": "~1.7.3",
40+
"@fortawesome/vue-fontawesome": "^3.0.0-4",
41+
"ant-design-vue": "^2.2.3",
4242
"antd-theme-webpack-plugin": "^1.3.9",
4343
"axios": "^0.21.1",
4444
"babel-plugin-require-context-hook": "^1.0.0",
@@ -47,56 +47,60 @@
4747
"js-cookie": "^2.2.1",
4848
"lodash": "^4.17.15",
4949
"md5": "^2.2.1",
50+
"mitt": "^2.1.0",
5051
"moment": "^2.26.0",
5152
"npm-check-updates": "^6.0.1",
5253
"nprogress": "^0.2.0",
53-
"viser-vue": "^2.4.8",
54-
"vue": "^2.6.12",
54+
"vue": "^3.2.11",
5555
"vue-clipboard2": "^0.3.1",
56-
"vue-cropper": "0.5.6",
57-
"vue-i18n": "^8.22.4",
56+
"vue-cropper": "^1.0.2",
57+
"vue-i18n": "^9.1.6",
58+
"vue-loader": "^16.2.0",
5859
"vue-ls": "^3.2.2",
59-
"vue-router": "^3.5.1",
60-
"vue-svg-component-runtime": "^1.0.1",
61-
"vuedraggable": "^2.24.3",
62-
"vuex": "^3.6.2"
60+
"vue-router": "^4.0.0-0",
61+
"vue-web-storage": "^6.1.0",
62+
"vue3-clipboard": "^1.0.0",
63+
"vuedraggable": "^4.0.3",
64+
"vuex": "^4.0.0-0"
6365
},
6466
"devDependencies": {
67+
"@babel/core": "^7.15.0",
6568
"@vue/cli": "^4.4.1",
66-
"@vue/cli-plugin-babel": "^4.4.1",
67-
"@vue/cli-plugin-eslint": "^4.4.1",
68-
"@vue/cli-plugin-unit-jest": "^4.4.1",
69-
"@vue/cli-service": "^4.4.1",
69+
"@vue/cli-plugin-babel": "~4.5.0",
70+
"@vue/cli-plugin-eslint": "~4.5.0",
71+
"@vue/cli-plugin-router": "~4.5.0",
72+
"@vue/cli-plugin-unit-jest": "~4.5.0",
73+
"@vue/cli-plugin-vuex": "~4.5.0",
74+
"@vue/cli-service": "~4.5.0",
75+
"@vue/compiler-sfc": "^3.0.0",
7076
"@vue/eslint-config-standard": "^5.1.2",
71-
"@vue/test-utils": "^1.0.3",
72-
"babel-core": "7.0.0-bridge.0",
73-
"babel-eslint": "^10.0.3",
74-
"babel-jest": "^25.1.0",
75-
"babel-plugin-import": "^1.13.0",
76-
"eslint": "^6.8.0",
77-
"eslint-plugin-html": "^6.0.2",
77+
"@vue/test-utils": "^2.0.0-0",
78+
"babel-eslint": "^10.1.0",
79+
"babel-jest": "^26.6.3",
80+
"babel-plugin-import": "^1.13.3",
81+
"eslint": "^6.7.2",
7882
"eslint-plugin-import": "^2.20.2",
7983
"eslint-plugin-node": "^11.1.0",
8084
"eslint-plugin-promise": "^4.2.1",
81-
"eslint-plugin-standard": "^4.0.1",
82-
"eslint-plugin-vue": "^6.2.2",
83-
"less": "^3.11.1",
85+
"eslint-plugin-standard": "^4.0.0",
86+
"eslint-plugin-vue": "^7.0.0",
87+
"less": "^3.0.4",
8488
"less-loader": "^5.0.0",
85-
"node-sass": "^4.13.1",
89+
"node-sass": "^4.0.0",
90+
"sass": "^1.35.1",
8691
"sass-loader": "^8.0.2",
8792
"uglifyjs-webpack-plugin": "^2.2.0",
88-
"vue-cli-plugin-i18n": "^1.0.1",
89-
"vue-svg-icon-loader": "^2.1.1",
90-
"vue-template-compiler": "^2.6.12",
91-
"webpack": "^4.43.0"
93+
"vue-jest": "^5.0.0-0",
94+
"vue-svg-loader": "^0.17.0-beta.2",
95+
"webpack": "^4.46.0"
9296
},
9397
"eslintConfig": {
9498
"root": true,
9599
"env": {
96100
"node": true
97101
},
98102
"extends": [
99-
"plugin:vue/strongly-recommended",
103+
"plugin:vue/vue3-essential",
100104
"@vue/standard"
101105
],
102106
"parserOptions": {
@@ -149,7 +153,18 @@
149153
"ignoreReadBeforeAssign": false
150154
}
151155
]
152-
}
156+
},
157+
"overrides": [
158+
{
159+
"files": [
160+
"**/__tests__/*.{j,t}s?(x)",
161+
"**/tests/unit/**/*.spec.{j,t}s?(x)"
162+
],
163+
"env": {
164+
"jest": true
165+
}
166+
}
167+
]
153168
},
154169
"postcss": {
155170
"plugins": {

ui/public/config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"500": "assets/500.png"
2020
},
2121
"theme": {
22+
"@layout-mode": "light",
2223
"@logo-background-color": "#ffffff",
2324
"@navigation-background-color": "#ffffff",
2425
"@project-nav-background-color": "#001529",

ui/public/locales/en.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,7 @@
860860
"label.download.kubernetes.cluster.config": "Download Kubernetes cluster config",
861861
"label.download.percent": "Download Percent",
862862
"label.download.progress": "Download Progress",
863+
"label.download.setting": "Download setting",
863864
"label.download.state": "Download State",
864865
"label.dpd": "Dead Peer Detection",
865866
"label.drag.new.position": "Drag to new position",
@@ -1958,7 +1959,6 @@
19581959
"label.save.and.continue": "Save and continue",
19591960
"label.save.changes": "Save changes",
19601961
"label.save.new.rule": "Save new Rule",
1961-
"label.save.setting": "Save setting",
19621962
"label.saving.processing": "Saving....",
19631963
"label.scale.up.policy": "SCALE UP POLICY",
19641964
"label.scale.vm": "Scale VM",
@@ -2210,7 +2210,7 @@
22102210
"label.templatetype": "Template Type",
22112211
"label.tftp.dir": "TFTP Directory",
22122212
"label.tftpdir": "Tftp root directory",
2213-
"label.theme.alert": "Please save for the changes to take effect.",
2213+
"label.theme.alert": "The setting is only visible to the current browser. To apply the setting, please download the JSON file and replace its content in the `theme` section of the `config.json` file under the path: `/public/config.json`",
22142214
"label.theme.color": "Theme Color",
22152215
"label.theme.cyan": "Cyan",
22162216
"label.theme.dark": "Dark Style",

ui/src/App.vue

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,7 @@ export default {
3636
}
3737
},
3838
created () {
39-
const userThemeSetting = this.$store.getters.themeSetting || {}
40-
if (Object.keys(userThemeSetting).length === 0) {
41-
window.less.modifyVars(this.$config.theme)
42-
} else {
43-
window.less.modifyVars(userThemeSetting)
44-
}
39+
window.less.modifyVars(this.$config.theme)
4540
console.log('config and theme applied')
4641
}
4742
}

ui/src/assets/icons/cloudian.svg

Lines changed: 0 additions & 12 deletions
Loading

ui/src/assets/icons/debian.svg

Lines changed: 0 additions & 2 deletions
Loading

ui/src/assets/icons/kubernetes.svg

Lines changed: 0 additions & 9 deletions
Loading

0 commit comments

Comments
 (0)