bugfix: usability issue fixes (#506)

Fixes #502

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Pearl Dsilva 2020-07-07 15:33:02 +05:30 committed by Rohit Yadav
parent a2be4abd8b
commit f00d3f9623
3 changed files with 10 additions and 3 deletions

View File

@ -47,6 +47,7 @@
:dataSource="detailOptions[newKey]"
:placeholder="$t('label.value')"
@change="e => onAddInputChange(e, 'newValue')" />
<p v-if="error" style="color: red"> {{ $t(error) }} </p>
<a-button type="primary" style="width: 25%" icon="plus" @click="addDetail">{{ $t('label.add.setting') }}</a-button>
<a-button type="dashed" style="width: 25%" icon="close" @click="showAddDetail = false">{{ $t('label.cancel') }}</a-button>
</div>
@ -118,7 +119,8 @@ export default {
newKey: '',
newValue: '',
loading: false,
resourceType: 'UserVm'
resourceType: 'UserVm',
error: false
}
},
watch: {
@ -217,6 +219,11 @@ export default {
})
},
addDetail () {
if (this.newKey === '' || this.newValue === '') {
this.error = 'Must provide a valid key and value for setting'
return
}
this.error = false
this.details.push({ name: this.newKey, value: this.newValue })
this.runApi()
},

View File

@ -42,7 +42,7 @@ export default {
}
return fields
},
details: ['name', 'id', 'displaytext', 'checksum', 'hypervisor', 'format', 'ostypename', 'size', 'isready', 'passwordenabled', 'directdownload', 'isextractable', 'isdynamicallyscalable', 'ispublic', 'isfeatured', 'crosszones', 'type', 'account', 'domain', 'created'],
details: ['name', 'id', 'displaytext', 'checksum', 'hypervisor', 'format', 'ostypename', 'size', 'isready', 'passwordenabled', 'sshkeyenabled', 'directdownload', 'isextractable', 'isdynamicallyscalable', 'ispublic', 'isfeatured', 'crosszones', 'type', 'account', 'domain', 'created'],
searchFilters: ['name', 'zoneid', 'tags'],
related: [{
name: 'vm',

View File

@ -500,7 +500,7 @@ export default {
}
if (['listTemplates', 'listIsos', 'listVirtualMachinesMetrics'].includes(this.apiName) && !this.dataView) {
if (['Admin'].includes(this.$store.getters.userInfo.roletype) || this.apiName === 'listVirtualMachinesMetrics') {
if (['Admin', 'DomainAdmin'].includes(this.$store.getters.userInfo.roletype) || this.apiName === 'listVirtualMachinesMetrics') {
this.filters = ['all', ...this.filters]
if (this.selectedFilter === '') {
this.selectedFilter = 'all'