Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
24fd8e4
add new vue 3 library & and 2.x (beta)
Jun 24, 2021
17ec7b0
edit config files, settings, utils, store,... corresponding to Vue 3
Jun 24, 2021
d238b59
edit layout and config to suit the new library
Jun 29, 2021
4ebbabd
fix header & side menu
Jul 5, 2021
8349181
Merge branch '4.15' into feature/upgrade-vue3-libray
Jul 6, 2021
96e5803
components, autogenview
Jul 6, 2021
11c926d
fix dashboard & compute
Jul 6, 2021
948fa01
compute: fix form errors
Jul 13, 2021
481ae89
storage: fix form & template by vue3
Jul 13, 2021
625c0ad
networks: fix form & template by vue3
Jul 13, 2021
104520b
image: fix form & template by vue3
Jul 14, 2021
2a76f90
project: fix by vue3 library
Jul 15, 2021
4f57400
Merge branch '4.15' into feature/upgrade-vue3-libray
Jul 27, 2021
5a5bcef
user: fix by vue3
Jul 27, 2021
3920a2b
Merge branch '4.15' into feature/upgrade-vue3-libray
Jul 28, 2021
e4b276a
iam: fix by vue3
Jul 28, 2021
140d862
fix zoneWizard & tooltip click event
Jul 29, 2021
bff863e
fix infra > physicalnetwork & visible modal
Aug 2, 2021
3ec54fb
Merge branch '4.15' into feature/upgrade-vue3-libray
Aug 3, 2021
6bc44ff
fix infra by vue3 & antdv 2x
Aug 3, 2021
14a56fd
fix offerings by vue3
Aug 5, 2021
13c225d
fix plugin by vue3
Aug 5, 2021
05dc417
Merge branch '4.15' into feature/upgrade-vue3-libray
Aug 9, 2021
738943f
fix form & action form
Aug 9, 2021
3e560f1
update the ant-design latest version
Aug 9, 2021
24df6db
Merge branch '4.15' into feature/upgrade-vue3-libray
Aug 12, 2021
1a7ca9d
fix icon, style dark mode, menu
Aug 12, 2021
f0ef82a
Merge branch '4.15' into feature/upgrade-vue3-libray
Aug 16, 2021
2eb25a3
fix unittest
Aug 16, 2021
4874491
fix babel plugins not found
Aug 16, 2021
1d77b05
add name,ref missing & callback i18n not found
Aug 18, 2021
544dd40
Merge branch '4.15' into feature/upgrade-vue3-libray
Aug 19, 2021
629a2c3
Merge branch '4.15' into feature/upgrade-vue3-libray
Aug 26, 2021
9c921f1
fix slot & info icon
Aug 27, 2021
9a94a9d
Merge branch '4.15' into feature/upgrade-vue3-libray
Aug 30, 2021
65bc6e5
fix unit test
Aug 30, 2021
827ffe4
Merge branch 'main' into feature/upgrade-vue3-libray
Sep 9, 2021
f22bd06
fix tooltip label of form item
Sep 9, 2021
c4d2432
fix lint errors
Sep 9, 2021
e036b91
using global app, globalProperties
Sep 10, 2021
85d39a8
add focus directive & edit the position of ctrl+Enter
Sep 10, 2021
372f7b7
upgrage Vue 3 version
Sep 10, 2021
952de8b
Merge branch 'main' into feature/upgrade-vue3-libray
Sep 13, 2021
c3709ce
fix main UT
Sep 13, 2021
ed647c6
fix build failed
Sep 13, 2021
8c6489d
Merge branch 'main' into feature/upgrade-vue3-libray
Sep 17, 2021
7831881
using `optionFilterProp="label"' & fix build fail
Sep 17, 2021
7087afa
fix UT with new code
Sep 17, 2021
cd4d6bc
Merge branch 'main' into feature/upgrade-vue3-libray
Sep 17, 2021
7dac845
Merge branch 'main' into feature/upgrade-vue3-libray
Sep 20, 2021
51d1b97
fix icons of undefined
Sep 20, 2021
29dab46
fix error run app
Sep 20, 2021
f0625ab
Merge branch 'main' into feature/upgrade-vue3-libray
Sep 21, 2021
e53c3bb
fix selectbox options
Sep 21, 2021
4afacf3
add vue version for clear storage
Sep 21, 2021
4a66b81
Merge branch 'main' into feature/upgrade-vue3-libray
Sep 22, 2021
1b0a5da
fix template
Sep 22, 2021
ca7abfd
fix template of iprange form
Sep 22, 2021
6c9edeb
fix warning test UT
Sep 22, 2021
b085a28
Merge branch 'main' into feature/upgrade-vue3-libray
Sep 23, 2021
da56362
fix conflit
Sep 23, 2021
d29525c
fix build failed
Sep 23, 2021
a010731
fix error run app the first time after upgrade
Sep 24, 2021
26ef45e
fix auto-complete & watch object/array
Sep 24, 2021
3a05f2f
fix error run application
Sep 27, 2021
0ff1928
fix error build
Sep 27, 2021
d3647c1
Merge branch 'main' into feature/upgrade-vue3-libray
Sep 28, 2021
7be35a7
fix form, icon, template & locales
Sep 28, 2021
047a160
Merge branch 'main' into feature/upgrade-vue3-libray
Sep 29, 2021
d24f3b3
Merge branch 'main' into feature/upgrade-vue3-libray
Oct 5, 2021
d055b39
fix conflit & form
Oct 5, 2021
2754827
remove slot errors
Oct 6, 2021
d0e4c77
fix error build & test UT
Oct 6, 2021
0c328ad
Merge branch 'main' into feature/upgrade-vue3-libray
Oct 13, 2021
b7d9c1b
fix error template
Oct 13, 2021
0ceaf26
Add licenses for missing files
Oct 13, 2021
fa94b30
Merge branch 'main' into feature/upgrade-vue3-libray
Oct 27, 2021
b7303dd
Merge branch 'main' into feature/upgrade-vue3-libray
Nov 18, 2021
0d5d581
add scroll to first errors
Nov 18, 2021
6302f8c
add scroll to first errors
Nov 18, 2021
730f413
Merge branch 'main' into feature/upgrade-vue3-libray
Nov 30, 2021
e906ef8
fix select filter, tag event
Nov 30, 2021
17f461a
add shallowRef async component are missing
Nov 30, 2021
9e8925f
fix css, upgrade vue-cropper version
Nov 30, 2021
053ecae
fix css
Dec 2, 2021
6ed6ab2
Merge branch 'main' into feature/upgrade-vue3-libray
Dec 3, 2021
643022d
fix vue 3 coding for new components
Dec 3, 2021
bdfd9fd
Remove unused components
Dec 9, 2021
f5d0900
Merge branch 'main' into feature/upgrade-vue3-libray
Dec 9, 2021
644b532
Merge branch 'main' into feature/upgrade-vue3-libray
Dec 13, 2021
b76810d
fixes `this` not found in @/roles
Dec 13, 2021
6f652cb
fix redirect after login again when session expired error
Dec 14, 2021
4c38e2f
fix openKeys menu & watch router
Dec 15, 2021
998248a
Merge branch 'main' into feature/upgrade-vue3-libray
Dec 27, 2021
da47383
Merge branch 'main' into feature/upgrade-vue3-libray
Dec 30, 2021
ef87c92
Merge branch 'main' into feature/upgrade-vue3-libray
Dec 31, 2021
19a4ceb
fixes
Dec 31, 2021
ee695bb
fix build failed
Dec 31, 2021
5b41b23
Merge branch 'main' into feature/upgrade-vue3-libray
Jan 5, 2022
e02be02
fixes
Jan 5, 2022
46be994
fixes ut
Jan 5, 2022
eb159f5
Merge branch 'main' into feature/upgrade-vue3-libray
Jan 10, 2022
0439ac2
Merge branch 'main' into feature/upgrade-vue3-libray
Jan 12, 2022
9cd4fa0
fixes
Jan 12, 2022
1fd4c04
Merge branch 'main' into feature/upgrade-vue3-libray
Jan 14, 2022
bd4c2fd
Merge branch 'main' into feature/upgrade-vue3-libray
Jan 19, 2022
abf4d44
fixes eslint
Jan 19, 2022
d466d37
Merge branch 'main' into feature/upgrade-vue3-libray
Jan 20, 2022
7af78c6
Merge branch 'main' into feature/upgrade-vue3-libray
Jan 24, 2022
165465b
fixes
Jan 25, 2022
56b6756
Merge branch 'main' into feature/upgrade-vue3-libray
Feb 7, 2022
d3c1ff5
fixes
Feb 7, 2022
610cb36
fixes css
Feb 8, 2022
7da77c8
fix menu sidebar css
Feb 8, 2022
e5ee5c7
fix some css icon, images
Feb 9, 2022
05ea0b6
Merge branch 'main' into feature/upgrade-vue3-libray
Feb 10, 2022
3b45e87
Merge branch 'main' into feature/upgrade-vue3-libray
Feb 10, 2022
e50669e
fix build fail
Feb 10, 2022
1b8b2b8
Merge branch 'main' into feature/upgrade-vue3-libray
Feb 11, 2022
2947b74
fixes
Feb 11, 2022
d29739b
Merge branch 'main' into feature/upgrade-vue3-libray
Feb 14, 2022
8926d69
fixes
Feb 14, 2022
2eb385c
fixes
Feb 15, 2022
8241e8b
Merge branch 'main' into feature/upgrade-vue3-libray
Feb 16, 2022
2f628da
fixes
Feb 16, 2022
cc7fee8
fix publicip resource
Feb 16, 2022
6fa84bb
Merge branch 'main' into feature/upgrade-vue3-libray
Feb 21, 2022
7b9dc1a
Merge branch 'main' into feature/upgrade-vue3-libray
Feb 21, 2022
5a64856
Merge branch 'main' into feature/upgrade-vue3-libray
Feb 22, 2022
41cf44c
fixes ut
Feb 22, 2022
600990d
fixes
Feb 22, 2022
7848d63
Merge branch 'main' into feature/upgrade-vue3-libray
Feb 23, 2022
a6f6921
Merge branch 'main' into feature/upgrade-vue3-libray
Feb 23, 2022
130b1d3
Merge branch 'main' into feature/upgrade-vue3-libray
Feb 25, 2022
3c286f7
fixes
Feb 28, 2022
5fa941d
fixes layout mode
Feb 28, 2022
dec92b7
fixes dropdown filter columns
Feb 28, 2022
6cc3e1d
fixes dashboard & hidden setting for normal user
Mar 1, 2022
01c8776
Merge branch 'main' into feature/upgrade-vue3-libray
Mar 2, 2022
58ddc40
fixes
Mar 2, 2022
7ee13e8
fixes layout
Mar 8, 2022
9462ab3
Merge branch 'main' into feature/upgrade-vue3-libray
Mar 8, 2022
2a80385
Merge branch 'main' into feature/upgrade-vue3-libray
Mar 9, 2022
6e90b76
fixes avatar
Mar 9, 2022
dd20d79
fixes
Mar 9, 2022
0fff131
Merge remote-tracking branch 'apache/main' into feature/upgrade-vue3-…
davidjumani Mar 9, 2022
dc2ab5c
Add missing else
davidjumani Mar 9, 2022
5132126
Fix query in routable paths
davidjumani Mar 9, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ui/.babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"plugins": [
["import", { "libraryName": "ant-design-vue", "libraryDirectory": "lib"}, "ant-design-vue"]
],
"env": {
"test": {
"plugins": ["require-context-hook"]
Expand Down
3 changes: 2 additions & 1 deletion ui/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
// under the License.

module.exports = {
preset: '@vue/cli-plugin-unit-jest',
testURL: 'http://localhost/',
setupFiles: ['<rootDir>/tests/setup.js'],
moduleFileExtensions: [
Expand All @@ -41,7 +42,7 @@ module.exports = {
'**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)'
],
transformIgnorePatterns: [
'<rootDir>/node_modules/(?!ant-design-vue|vue)'
'<rootDir>/node_modules/(?!ant-design-vue|vue|@babel/runtime|lodash-es|@ant-design)'
],
collectCoverage: true,
collectCoverageFrom: [
Expand Down
23,822 changes: 10,651 additions & 13,171 deletions ui/package-lock.json

Large diffs are not rendered by default.

77 changes: 46 additions & 31 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"@fortawesome/fontawesome-svg-core": "^1.2.34",
"@fortawesome/free-brands-svg-icons": "^5.15.2",
"@fortawesome/free-solid-svg-icons": "^5.15.2",
"@fortawesome/vue-fontawesome": "^2.0.2",
"ant-design-vue": "~1.7.3",
"@fortawesome/vue-fontawesome": "^3.0.0-4",
"ant-design-vue": "^2.2.3",
"antd-theme-webpack-plugin": "^1.3.9",
"axios": "^0.21.1",
"babel-plugin-require-context-hook": "^1.0.0",
Expand All @@ -47,56 +47,60 @@
"js-cookie": "^2.2.1",
"lodash": "^4.17.15",
"md5": "^2.2.1",
"mitt": "^2.1.0",
"moment": "^2.26.0",
"npm-check-updates": "^6.0.1",
"nprogress": "^0.2.0",
"viser-vue": "^2.4.8",
"vue": "^2.6.12",
"vue": "^3.2.11",
"vue-clipboard2": "^0.3.1",
"vue-cropper": "0.5.6",
"vue-i18n": "^8.22.4",
"vue-cropper": "^1.0.2",
"vue-i18n": "^9.1.6",
"vue-loader": "^16.2.0",
"vue-ls": "^3.2.2",
"vue-router": "^3.5.1",
"vue-svg-component-runtime": "^1.0.1",
"vuedraggable": "^2.24.3",
"vuex": "^3.6.2"
"vue-router": "^4.0.0-0",
"vue-web-storage": "^6.1.0",
"vue3-clipboard": "^1.0.0",
"vuedraggable": "^4.0.3",
"vuex": "^4.0.0-0"
},
"devDependencies": {
"@babel/core": "^7.15.0",
"@vue/cli": "^4.4.1",
"@vue/cli-plugin-babel": "^4.4.1",
"@vue/cli-plugin-eslint": "^4.4.1",
"@vue/cli-plugin-unit-jest": "^4.4.1",
"@vue/cli-service": "^4.4.1",
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-unit-jest": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/compiler-sfc": "^3.0.0",
"@vue/eslint-config-standard": "^5.1.2",
"@vue/test-utils": "^1.0.3",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "^10.0.3",
"babel-jest": "^25.1.0",
"babel-plugin-import": "^1.13.0",
"eslint": "^6.8.0",
"eslint-plugin-html": "^6.0.2",
"@vue/test-utils": "^2.0.0-0",
"babel-eslint": "^10.1.0",
"babel-jest": "^26.6.3",
"babel-plugin-import": "^1.13.3",
"eslint": "^6.7.2",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"eslint-plugin-vue": "^6.2.2",
"less": "^3.11.1",
"eslint-plugin-standard": "^4.0.0",
"eslint-plugin-vue": "^7.0.0",
"less": "^3.0.4",
"less-loader": "^5.0.0",
"node-sass": "^4.13.1",
"node-sass": "^4.0.0",
"sass": "^1.35.1",
"sass-loader": "^8.0.2",
"uglifyjs-webpack-plugin": "^2.2.0",
"vue-cli-plugin-i18n": "^1.0.1",
"vue-svg-icon-loader": "^2.1.1",
"vue-template-compiler": "^2.6.12",
"webpack": "^4.43.0"
"vue-jest": "^5.0.0-0",
"vue-svg-loader": "^0.17.0-beta.2",
"webpack": "^4.46.0"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/strongly-recommended",
"plugin:vue/vue3-essential",
"@vue/standard"
],
"parserOptions": {
Expand Down Expand Up @@ -149,7 +153,18 @@
"ignoreReadBeforeAssign": false
}
]
}
},
"overrides": [
{
"files": [
"**/__tests__/*.{j,t}s?(x)",
"**/tests/unit/**/*.spec.{j,t}s?(x)"
],
"env": {
"jest": true
}
}
]
},
"postcss": {
"plugins": {
Expand Down
1 change: 1 addition & 0 deletions ui/public/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"500": "assets/500.png"
},
"theme": {
"@layout-mode": "light",
"@logo-background-color": "#ffffff",
"@navigation-background-color": "#ffffff",
"@project-nav-background-color": "#001529",
Expand Down
4 changes: 2 additions & 2 deletions ui/public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,7 @@
"label.download.kubernetes.cluster.config": "Download Kubernetes cluster config",
"label.download.percent": "Download Percent",
"label.download.progress": "Download Progress",
"label.download.setting": "Download setting",
"label.download.state": "Download State",
"label.dpd": "Dead Peer Detection",
"label.drag.new.position": "Drag to new position",
Expand Down Expand Up @@ -1958,7 +1959,6 @@
"label.save.and.continue": "Save and continue",
"label.save.changes": "Save changes",
"label.save.new.rule": "Save new Rule",
"label.save.setting": "Save setting",
"label.saving.processing": "Saving....",
"label.scale.up.policy": "SCALE UP POLICY",
"label.scale.vm": "Scale VM",
Expand Down Expand Up @@ -2210,7 +2210,7 @@
"label.templatetype": "Template Type",
"label.tftp.dir": "TFTP Directory",
"label.tftpdir": "Tftp root directory",
"label.theme.alert": "Please save for the changes to take effect.",
"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`",
"label.theme.color": "Theme Color",
"label.theme.cyan": "Cyan",
"label.theme.dark": "Dark Style",
Expand Down
7 changes: 1 addition & 6 deletions ui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@ export default {
}
},
created () {
const userThemeSetting = this.$store.getters.themeSetting || {}
if (Object.keys(userThemeSetting).length === 0) {
window.less.modifyVars(this.$config.theme)
} else {
window.less.modifyVars(userThemeSetting)
}
window.less.modifyVars(this.$config.theme)
console.log('config and theme applied')
}
}
Expand Down
12 changes: 0 additions & 12 deletions ui/src/assets/icons/cloudian.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions ui/src/assets/icons/debian.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 0 additions & 9 deletions ui/src/assets/icons/kubernetes.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 6 additions & 5 deletions ui/src/components/CheckBoxInputPair.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<a-col>
<a-row :md="24" :lg="layout === 'horizontal' ? 12 : 24">
<a-checkbox
v-decorator="[checkBoxDecorator, {}]"
v-model:value="fields[checkBoxDecorator]"
:checked="checked"
@change="handleCheckChange">
{{ checkBoxLabel }}
Expand All @@ -31,9 +31,7 @@
:label="inputLabel"
v-if="reversed !== checked">
<a-input
v-decorator="[inputDecorator, {
initialValue: defaultInputValue
}]"
v-model:value="fields[inputDecorator]"
@change="val => handleInputChangeTimed(val)" />
</a-form-item>
</a-row>
Expand Down Expand Up @@ -91,11 +89,14 @@ export default {
return {
checked: false,
inputValue: '',
inputUpdateTimer: null
inputUpdateTimer: null,
fields: {}
}
},
created () {
this.checked = this.defaultCheckBoxValue
this.fields[this.checkBoxDecorator] = this.checked
this.fields[this.inputDecorator] = this.defaultInputValue
},
methods: {
handleCheckChange (e) {
Expand Down
18 changes: 12 additions & 6 deletions ui/src/components/CheckBoxSelectPair.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<template>
<div style="width: 100%">
<a-row :gutter="6">
<a-col :md="24" :lg="layout === 'horizontal' ? 12 : 24">
<a-col :md="24" :lg="layout === 'horizontal' ? 10 : 24">
<a-checkbox
:checked="checked"
@change="handleCheckChange">
Expand All @@ -27,16 +27,16 @@
</a-col>
<a-col :md="24" :lg="layout === 'horizontal' ? 12 : 24">
<a-form-item
v-if="reversed != checked"
v-if="reversed !== checked"
:label="selectLabel">
<a-select
v-model="selectedOption"
v-model:value="selectedOption"
showSearch
optionFilterProp="children"
optionFilterProp="label"
:filterOption="(input, option) => {
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
return option.children[0].children.toLowerCase().indexOf(input.toLowerCase()) >= 0
}"
@change="val => { this.handleSelectChange(val) }">
@change="val => { handleSelectChange(val) }">
<a-select-option
v-for="(opt) in selectSource"
:key="opt.id"
Expand Down Expand Up @@ -138,3 +138,9 @@ export default {
}
}
</script>

<style lang="less" scoped>
.ant-list-split .ant-list-item div {
width: 100%;
}
</style>
40 changes: 28 additions & 12 deletions ui/src/components/header/HeaderNotice.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,50 +23,66 @@
:autoAdjustOverflow="true"
:arrowPointAtCenter="true"
overlayClassName="header-notice-popover">
<template slot="content">
<template #content>
<a-spin :spinning="loading">
<a-list style="min-width: 200px; max-width: 300px">
<a-list-item>
<a-list-item-meta :title="$t('label.notifications')">
<a-avatar :style="{backgroundColor: '#6887d0', verticalAlign: 'middle'}" icon="notification" slot="avatar"/>
<a-button size="small" slot="description" @click="clearJobs">{{ $t('label.clear.list') }}</a-button>
<template #avatar>
<a-avatar :style="{ backgroundColor: '#6887d0', verticalAlign: 'middle' }">
<template #icon><notification-outlined /></template>
</a-avatar>
</template>
<template #description><a-button size="small" @click="clearJobs">{{ $t('label.clear.list') }}</a-button></template>
</a-list-item-meta>
</a-list-item>
<a-list-item v-for="(notice, index) in notices" :key="index">
<div slot="title"> {{ notice.path }} </div>
<template #title>{{ notice.path }} </template>
<a-list-item-meta :title="notice.title">
<a-avatar :style="notificationAvatar[notice.status].style" :icon="notificationAvatar[notice.status].icon" slot="avatar"/>
<span slot="description" v-if="getResourceName(notice.description, 'name') && notice.path"><router-link :to="{ path: notice.path}"> {{ getResourceName(notice.description, "name") + ' - ' }}</router-link></span>
<span slot="description" v-if="getResourceName(notice.description, 'name') && notice.path"> {{ getResourceName(notice.description, "msg") }}</span>
<span slot="description" v-else> {{ notice.description }} </span>
<template #avatar>
<a-avatar :style="notificationAvatar[notice.status].style">
<template #icon>
<render-icon :icon="notificationAvatar[notice.status].icon" />
</template>
</a-avatar>
</template>
<template #description>
<span v-if="getResourceName(notice.description, 'name') && notice.path">
<router-link :to="{ path: notice.path}"> {{ getResourceName(notice.description, "name") + ' - ' }}</router-link>
</span>
<span v-if="getResourceName(notice.description, 'name') && notice.path"> {{ getResourceName(notice.description, "msg") }}</span>
<span v-else>{{ notice.description }}</span>
</template>
</a-list-item-meta>
</a-list-item>
</a-list>
</a-spin>
</template>
<span @click="showNotifications" class="header-notice-opener">
<a-badge :count="notices.length">
<a-icon class="header-notice-icon" type="bell" />
<bell-outlined class="header-notice-icon" />
</a-badge>
</span>
</a-popover>
</template>

<script>
import store from '@/store'
import RenderIcon from '@/utils/renderIcon'

export default {
name: 'HeaderNotice',
components: { RenderIcon },
data () {
return {
loading: false,
visible: false,
notices: [],
poller: null,
notificationAvatar: {
done: { icon: 'check-circle', style: 'backgroundColor:#87d068' },
progress: { icon: 'loading', style: 'backgroundColor:#ffbf00' },
failed: { icon: 'close-circle', style: 'backgroundColor:#f56a00' }
done: { icon: 'check-circle-outlined', style: { backgroundColor: '#87d068' } },
progress: { icon: 'loading-outlined', style: { backgroundColor: '#ffbf00' } },
failed: { icon: 'close-circle-outlined', style: { backgroundColor: '#f56a00' } }
}
}
},
Expand Down
Loading