perf: change secret

This commit is contained in:
feng 2025-03-18 13:27:08 +08:00 committed by feng626
parent 6aab902762
commit 4502375ed0
3 changed files with 18 additions and 6 deletions

View File

@ -294,7 +294,7 @@ export default {
type: 'primary', type: 'primary',
icon: 'plus', icon: 'plus',
can: () => { can: () => {
return vm.$hasPerm('accounts.add_account') && !this.$store.getters.currentOrgIsRoot return vm.$hasPerm('accounts.add_account') && !vm.$store.getters.currentOrgIsRoot
}, },
callback: () => { callback: () => {
setTimeout(() => { setTimeout(() => {
@ -310,7 +310,7 @@ export default {
title: this.$t('TemplateAdd'), title: this.$t('TemplateAdd'),
has: !(this.platform || this.asset), has: !(this.platform || this.asset),
can: () => { can: () => {
return vm.$hasPerm('accounts.add_account') && !this.$store.getters.currentOrgIsRoot return vm.$hasPerm('accounts.add_account') && !vm.$store.getters.currentOrgIsRoot
}, },
callback: async() => { callback: async() => {
await this.getAssetDetail() await this.getAssetDetail()

View File

@ -151,7 +151,7 @@ export const accountOtherActions = (vm) => [
title: vm.$t('CopyToAsset'), title: vm.$t('CopyToAsset'),
type: 'primary', type: 'primary',
divided: true, divided: true,
can: () => vm.$hasPerm('accounts.create_account') && !vm.$store.getters.currentOrgIsRoot, can: () => vm.$hasPerm('accounts.add_account') && !vm.$store.getters.currentOrgIsRoot,
has: () => { has: () => {
return !vm.asset return !vm.asset
}, },
@ -167,7 +167,7 @@ export const accountOtherActions = (vm) => [
name: 'MoveToOther', name: 'MoveToOther',
title: vm.$t('MoveToAsset'), title: vm.$t('MoveToAsset'),
type: 'primary', type: 'primary',
can: () => vm.$hasPerm('accounts.create_account') && !vm.$store.getters.currentOrgIsRoot, can: () => vm.$hasPerm('accounts.add_account') && !vm.$store.getters.currentOrgIsRoot,
has: () => { has: () => {
return !vm.asset return !vm.asset
}, },

View File

@ -29,12 +29,13 @@ export default {
data() { data() {
const vm = this const vm = this
return { return {
url: '/api/v1/accounts/change-secret-records/dashboard/',
showViewSecretDialog: false, showViewSecretDialog: false,
cardConfig: { cardConfig: {
title: this.$tc('ChangeSecretFailAccounts') title: vm.$tc('ChangeSecretFailAccounts')
}, },
tableConfig: { tableConfig: {
url: `/api/v1/accounts/change-secret-records/dashboard/?days=${this.days}`, url: vm.tableUrl(),
columns: [ columns: [
'asset', 'account', 'date_finished', 'is_success', 'error', 'actions' 'asset', 'account', 'date_finished', 'is_success', 'error', 'actions'
], ],
@ -138,6 +139,17 @@ export default {
} }
} }
} }
},
watch: {
days() {
this.$refs.HomeCard.$refs.ListTable.tableConfig.url = this.tableUrl()
this.$refs.HomeCard.$refs.ListTable.reloadTable()
}
},
methods: {
tableUrl() {
return `/api/v1/accounts/change-secret-records/dashboard/?days=${this.days}`
}
} }
} }
</script> </script>