mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-01 07:01:26 +00:00
perf: 优化全局组织下一些权限问题
This commit is contained in:
parent
55c6202c5e
commit
d74e70893e
@ -268,7 +268,7 @@ export default {
|
||||
title: this.$t('common.Add'),
|
||||
type: 'primary',
|
||||
can: () => {
|
||||
return vm.$hasPerm('accounts.add_account')
|
||||
return vm.$hasPerm('accounts.add_account') && !this.$store.getters.currentOrgIsRoot
|
||||
},
|
||||
callback: async() => {
|
||||
await this.getAssetDetail()
|
||||
|
@ -119,7 +119,14 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
const url = `/api/v1/accounts/account-secrets/${this.account.id}/histories/?limit=1`
|
||||
this.$axios.get(url).then(resp => {
|
||||
this.$axios.get(url,
|
||||
{
|
||||
validateStatus: (status) => {
|
||||
if (status === 400) return 200
|
||||
return status
|
||||
}
|
||||
}
|
||||
).then(resp => {
|
||||
this.versions = resp.count
|
||||
})
|
||||
},
|
||||
|
@ -83,7 +83,12 @@ export default {
|
||||
attrs: {
|
||||
type: 'primary',
|
||||
label: this.$t('assets.Test'),
|
||||
disabled: !vm.$hasPerm('accounts.verify_account')
|
||||
disabled: (
|
||||
!vm.$hasPerm('accounts.verify_account') ||
|
||||
!vm.object.asset.auto_info?.ansible_enabled ||
|
||||
!vm.object.asset.auto_info?.ping_enabled ||
|
||||
this.$store.getters.currentOrgIsRoot
|
||||
)
|
||||
},
|
||||
callbacks: Object.freeze({
|
||||
click: () => {
|
||||
@ -104,7 +109,11 @@ export default {
|
||||
attrs: {
|
||||
type: 'primary',
|
||||
label: this.$t('assets.Push'),
|
||||
disabled: !vm.$hasPerm('accounts.push_account')
|
||||
disabled: (
|
||||
!vm.$hasPerm('accounts.push_account') ||
|
||||
!vm.object.asset.auto_info?.push_account_enabled ||
|
||||
this.$store.getters.currentOrgIsRoot
|
||||
)
|
||||
},
|
||||
callbacks: Object.freeze({
|
||||
click: () => {
|
||||
|
@ -69,7 +69,7 @@ export default {
|
||||
{
|
||||
name: 'View',
|
||||
title: this.$t('common.Sync'),
|
||||
can: this.$hasPerm('accounts.add_gatheredaccount'),
|
||||
can: this.$hasPerm('accounts.add_gatheredaccount') && !this.$store.getters.currentOrgIsRoot,
|
||||
type: 'primary',
|
||||
callback: ({ row }) => {
|
||||
this.$axios.post(
|
||||
|
@ -54,7 +54,11 @@ export default {
|
||||
{
|
||||
name: 'Test',
|
||||
title: this.$t('common.Test'),
|
||||
can: this.$hasPerm('assets.test_assetconnectivity'),
|
||||
can: ({ row }) =>
|
||||
this.$hasPerm('assets.test_assetconnectivity') &&
|
||||
!this.$store.getters.currentOrgIsRoot &&
|
||||
row['auto_info'].ansible_enabled &&
|
||||
row['auto_info'].ping_enabled,
|
||||
callback: ({ row }) => {
|
||||
if (row.platform.name === 'Gateway') {
|
||||
this.GatewayVisible = true
|
||||
|
Loading…
Reference in New Issue
Block a user