mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 10:32:34 +01:00
projectmenu: Use project displaytext and use name as fallback
This uses project displaytext instead of name when available. Fixes #38 Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
0b4b9b6c62
commit
004080540b
@ -10,7 +10,7 @@
|
||||
@change="changeProject"
|
||||
showSearch>
|
||||
<a-select-option v-for="(project, index) in projects" :key="index">
|
||||
{{ project.name }}
|
||||
{{ project.displaytext || project.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</span>
|
||||
@ -54,7 +54,7 @@ export default {
|
||||
const currentProject = Vue.ls.get(CURRENT_PROJECT)
|
||||
for (var project of this.projects) {
|
||||
if (project.id === currentProject.id) {
|
||||
this.selectedProject = project.name
|
||||
this.setSelectedProject(project)
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -69,9 +69,12 @@ export default {
|
||||
isDisabled () {
|
||||
return !store.getters.apis.hasOwnProperty('listProjects')
|
||||
},
|
||||
setSelectedProject (project) {
|
||||
this.selectedProject = project.displaytext || project.name
|
||||
},
|
||||
changeProject (index) {
|
||||
const project = this.projects[index]
|
||||
this.selectedProject = project.name
|
||||
this.setSelectedProject(project)
|
||||
this.$store.dispatch('SetProject', project)
|
||||
this.$store.dispatch('ToggleTheme', project.id === undefined ? 'light' : 'dark')
|
||||
this.$message.success(`Switched to "${project.name}"`)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user