Skip to content

Commit d14e5d2

Browse files
committed
ui: do not allow vnf external template
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
1 parent 58645cd commit d14e5d2

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

ui/src/utils/plugins.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,8 +566,11 @@ export const cpuArchitectureUtilPlugin = {
566566

567567
export const imagesUtilPlugin = {
568568
install (app) {
569-
app.config.globalProperties.$fetchTemplateTypes = function () {
570-
const baseTypes = ['USER', 'VNF']
569+
app.config.globalProperties.$fetchTemplateTypes = function (hypervisor) {
570+
const baseTypes = ['USER']
571+
if (hypervisor !== 'External') {
572+
baseTypes.push('VNF')
573+
}
571574
const adminTypes = ['SYSTEM', 'BUILTIN', 'ROUTING']
572575
const types = [...baseTypes]
573576
if (store.getters.userInfo?.roletype === 'Admin') {

ui/src/views/image/RegisterOrUploadTemplate.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,6 +1060,7 @@ export default {
10601060
this.fetchRootDisk(hyperVisor)
10611061
this.fetchNicAdapterTypes()
10621062
this.fetchKeyboardType()
1063+
this.templateTypes.opts = this.$fetchTemplateTypes(hyperVisor)
10631064
10641065
this.form.rootDiskControllerType = this.rootDisk.opts.length > 0 ? 'osdefault' : ''
10651066
},

0 commit comments

Comments
 (0)