ui: Hidden features checkbox as user role (#5597)

* hidden features checkbox as user role

* change display conditions
This commit is contained in:
Hoang Nguyen 2021-10-21 23:48:51 +07:00 committed by GitHub
parent f2ca11fc68
commit e63234e8fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 21 deletions

View File

@ -144,17 +144,11 @@
<a-form-item
:label="$t('label.ispublic')"
v-if="$store.getters.userInfo.roletype === 'Admin' || $store.getters.features.userpublictemplateenabled" >
<a-switch
v-decorator="['ispublic', {
initialValue: false
}]" />
<a-switch v-decorator="['ispublic', { initialValue: false }]" />
</a-form-item>
<a-form-item :label="$t('label.isfeatured')">
<a-switch
v-decorator="['isfeatured', {
initialValue: false
}]" />
<a-form-item :label="$t('label.isfeatured')" v-if="$store.getters.userInfo.roletype === 'Admin'">
<a-switch v-decorator="['isfeatured', { initialValue: false }]" />
</a-form-item>
<div :span="24" class="action-button">

View File

@ -350,8 +350,6 @@
{{ $t('label.passwordenabled') }}
</a-checkbox>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-checkbox value="isdynamicallyscalable">
{{ $t('label.isdynamicallyscalable') }}
@ -362,23 +360,17 @@
{{ $t('label.requireshvm') }}
</a-checkbox>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-col :span="12" v-if="isAdminRole">
<a-checkbox value="isfeatured">
{{ $t('label.isfeatured') }}
</a-checkbox>
</a-col>
<a-col :span="12">
<a-checkbox
value="ispublic"
v-if="$store.getters.userInfo.roletype === 'Admin' || $store.getters.features.userpublictemplateenabled" >
<a-col :span="12" v-if="isAdminRole || $store.getters.features.userpublictemplateenabled">
<a-checkbox value="ispublic">
{{ $t('label.ispublic') }}
</a-checkbox>
</a-col>
</a-row>
<a-row>
<a-col :span="12" v-if="$store.getters.userInfo.roletype === 'Admin'">
<a-col :span="12" v-if="isAdminRole">
<a-checkbox value="isrouting">
{{ $t('label.isrouting') }}
</a-checkbox>
@ -473,6 +465,9 @@ export default {
this.fetchData()
},
computed: {
isAdminRole () {
return this.$store.getters.userInfo.roletype === 'Admin'
}
},
methods: {
fetchData () {