This is an automated email from the ASF dual-hosted git repository.
sureshanaparti pushed a commit to branch 4.19
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/4.19 by this push:
new 1bfebd550ce ui: update project menu on projects change (#11369)
1bfebd550ce is described below
commit 1bfebd550ce9e20fc5c7823c230f1c1ef3a6b118
Author: Abhishek Kumar <[email protected]>
AuthorDate: Fri Aug 1 17:41:02 2025 +0530
ui: update project menu on projects change (#11369)
Fixes #11357
Signed-off-by: Abhishek Kumar <[email protected]>
---
ui/src/components/header/ProjectMenu.vue | 10 ++++++++--
ui/src/views/AutogenView.vue | 3 +++
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/ui/src/components/header/ProjectMenu.vue
b/ui/src/components/header/ProjectMenu.vue
index 590a8a2fbd0..32a77723825 100644
--- a/ui/src/components/header/ProjectMenu.vue
+++ b/ui/src/components/header/ProjectMenu.vue
@@ -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) {
diff --git a/ui/src/views/AutogenView.vue b/ui/src/views/AutogenView.vue
index 74fae8cada4..4c9983013b7 100644
--- a/ui/src/views/AutogenView.vue
+++ b/ui/src/views/AutogenView.vue
@@ -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: () => {