Skip to content
This repository has been archived by the owner on Jan 20, 2021. It is now read-only.

Commit

Permalink
Allow changing template type by admin (#838)
Browse files Browse the repository at this point in the history
* Allow changing template type by admin

Currently the template has following types:
'BUILTIN', 'USER', 'SYSTEM', 'ROUTING', 'PERHOST'

Provide ui support for admins os that they can change
the template type

* add extr afields

* remove perhost

Co-authored-by: Rakesh Venkatesh <[email protected]>
  • Loading branch information
ravening and Rakesh Venkatesh authored Dec 1, 2020
1 parent fde6a89 commit 4ce0b40
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
17 changes: 15 additions & 2 deletions src/config/section/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,15 @@ export default {
}
return fields
},
details: ['name', 'id', 'displaytext', 'checksum', 'hypervisor', 'format', 'ostypename', 'size', 'isready', 'passwordenabled', 'directdownload', 'deployasis', 'isextractable', 'isdynamicallyscalable', 'ispublic', 'isfeatured', 'crosszones', 'type', 'account', 'domain', 'created', 'url'],
details: () => {
var fields = ['name', 'id', 'displaytext', 'checksum', 'hypervisor', 'format', 'ostypename', 'size', 'isready', 'passwordenabled',
'directdownload', 'deployasis', 'ispublic', 'isfeatured', 'isextractable', 'isdynamicallyscalable', 'crosszones', 'type',
'account', 'domain', 'created']
if (['Admin'].includes(store.getters.userInfo.roletype)) {
fields.push('templatetype', 'url')
}
return fields
},
searchFilters: ['name', 'zoneid', 'tags'],
related: [{
name: 'vm',
Expand Down Expand Up @@ -94,9 +102,14 @@ export default {
args: (record, store) => {
var fields = ['name', 'displaytext', 'passwordenabled', 'ostypeid', 'isdynamicallyscalable']
if (['Admin'].includes(store.userInfo.roletype)) {
fields.push('isrouting')
fields.push('isrouting', 'templatetype')
}
return fields
},
mapping: {
templatetype: {
options: ['BUILTIN', 'USER', 'SYSTEM', 'ROUTING']
}
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2080,7 +2080,7 @@
"label.templates": "Templates",
"label.templatesubject": "Subject",
"label.templatetotal": "Template",
"label.templatetype": "Email Template",
"label.templatetype": "Template Type",
"label.tftp.dir": "TFTP Directory",
"label.tftpdir": "Tftp root directory",
"label.theme.default": "Default Theme",
Expand Down

0 comments on commit 4ce0b40

Please sign in to comment.