1
0
mirror of https://github.com/jumpserver/lina.git synced 2025-05-12 10:08:52 +00:00

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
src
components/Apps/AccountListTable
views/accounts/AccountChangeSecret/Overview

View File

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

View File

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

View File

@ -29,12 +29,13 @@ export default {
data() {
const vm = this
return {
url: '/api/v1/accounts/change-secret-records/dashboard/',
showViewSecretDialog: false,
cardConfig: {
title: this.$tc('ChangeSecretFailAccounts')
title: vm.$tc('ChangeSecretFailAccounts')
},
tableConfig: {
url: `/api/v1/accounts/change-secret-records/dashboard/?days=${this.days}`,
url: vm.tableUrl(),
columns: [
'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>