mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
ui: update project menu on projects change (#11369)
Fixes #11357 Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
parent
3850445b50
commit
1bfebd550c
@ -33,6 +33,7 @@
|
||||
|
||||
<script>
|
||||
import InfiniteScrollSelect from '@/components/widgets/InfiniteScrollSelect'
|
||||
import eventBus from '@/config/eventBus'
|
||||
|
||||
export default {
|
||||
name: 'ProjectMenu',
|
||||
@ -42,7 +43,8 @@ export default {
|
||||
data () {
|
||||
return {
|
||||
selectedProjectId: null,
|
||||
loading: false
|
||||
loading: false,
|
||||
timestamp: new Date().getTime()
|
||||
}
|
||||
},
|
||||
created () {
|
||||
@ -59,7 +61,8 @@ export default {
|
||||
projectsApiParams () {
|
||||
return {
|
||||
details: 'min',
|
||||
listall: true
|
||||
listall: true,
|
||||
timestamp: this.timestamp
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -70,6 +73,9 @@ export default {
|
||||
this.selectedProjectId = newId
|
||||
}
|
||||
)
|
||||
eventBus.on('projects-updated', (args) => {
|
||||
this.timestamp = new Date().getTime()
|
||||
})
|
||||
},
|
||||
beforeUnmount () {
|
||||
if (this.unwatchProject) {
|
||||
|
||||
@ -1372,6 +1372,9 @@ export default {
|
||||
if ('successMethod' in action) {
|
||||
action.successMethod(this, result)
|
||||
}
|
||||
if (['createProject', 'updateProject', 'deleteProject'].includes(action.api)) {
|
||||
eventBus.emit('projects-updated', { action: action.api, project: this.resource })
|
||||
}
|
||||
resolve(true)
|
||||
},
|
||||
errorMethod: () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user