mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
image: list unique templates and isos in list view
Related: https://github.com/apache/cloudstack/issues/4041 Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
cec74abc00
commit
c429e7e8d3
@ -450,6 +450,12 @@ export default {
|
||||
delete params.treeView
|
||||
}
|
||||
|
||||
if (['listTemplates', 'listIsos'].includes(this.apiName) && !this.dataView) {
|
||||
if (['Admin'].includes(this.$store.getters.userInfo.roletype)) {
|
||||
params.templatefilter = 'all'
|
||||
}
|
||||
}
|
||||
|
||||
api(this.apiName, params).then(json => {
|
||||
var responseName
|
||||
var objectName
|
||||
@ -472,6 +478,9 @@ export default {
|
||||
if (!this.items || this.items.length === 0) {
|
||||
this.items = []
|
||||
}
|
||||
if (['listTemplates', 'listIsos'].includes(this.apiName) && this.items.length > 1) {
|
||||
this.items = [...new Map(this.items.map(x => [x.id, x])).values()]
|
||||
}
|
||||
if (this.treeView) {
|
||||
this.treeData = this.generateTreeData(this.items)
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user