Skip to content

Commit 14cf02a

Browse files
committed
fix user template listing
Signed-off-by: Abhishek Kumar <[email protected]>
1 parent f2e1b57 commit 14cf02a

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

ui/src/views/compute/DeployVM.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1659,7 +1659,7 @@ export default {
16591659
return ['community']
16601660
}
16611661
}
1662-
return ['all']
1662+
return this.isNormalAndDomainUser ? ['executable'] : ['all']
16631663
}
16641664
return [
16651665
'featured',

ui/src/views/compute/wizard/OsBasedImageSelection.vue

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
<os-based-image-radio-group
8080
:imagesList="imagesList"
8181
:categoryIcon="selectedCategoryIcon"
82-
:itemCount="imageItems[filterType] ? imageItems[filterType].count || 0 : 0"
82+
:itemCount="imagesCount"
8383
:input-decorator="localSelectedImageType"
8484
:selected="selectedImageId"
8585
:preFillContent="preFillContent"
@@ -214,7 +214,7 @@ export default {
214214
},
215215
data () {
216216
return {
217-
filterType: 'all',
217+
filterType: this.defaultImageFilter,
218218
selectedImageId: '',
219219
imageSearchFilters: {},
220220
showRootDiskSizeChanger: false,
@@ -244,13 +244,19 @@ export default {
244244
}
245245
},
246246
computed: {
247+
defaultImageFilter () {
248+
return ['DomainAdmin', 'User'].includes(this.$store.getters.userInfo.roletype) ? 'executable' : 'all'
249+
},
247250
imagesList () {
248251
if (!this.localSelectedImageType || !this.imageItems || !this.imageItems[this.filterType]) {
249252
return []
250253
}
251254
const imageTypeKey = this.localSelectedImageType.slice(0, -2)
252255
return this.imageItems[this.filterType][imageTypeKey] || []
253256
},
257+
imagesCount () {
258+
return this.imageItems[this.filterType] ? this.imageItems[this.filterType].count || 0 : 0
259+
},
254260
selectedCategory () {
255261
if (this.localSelectedGuestOsCategoryId && this.guestOsCategories) {
256262
return this.guestOsCategories.find(option => option.id === this.localSelectedGuestOsCategoryId)
@@ -286,7 +292,7 @@ export default {
286292
this.emitSearchFilter()
287293
},
288294
updateImageFilterType () {
289-
this.filterType = 'all'
295+
this.filterType = this.defaultImageFilter
290296
if (this.localSelectedGuestOsCategoryId === '0') {
291297
this.filterType = 'self'
292298
} else {

0 commit comments

Comments
 (0)