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