perf: Change secret

This commit is contained in:
feng 2025-03-19 18:45:10 +08:00 committed by feng626
parent 849d2829f4
commit c08f446464
4 changed files with 27 additions and 13 deletions

View File

@ -16,8 +16,9 @@ export default {
BaseExecutionList BaseExecutionList
}, },
data() { data() {
const params = new URLSearchParams(this.$route.params).toString()
return { return {
url: '/api/v1/accounts/change-secret-executions/', url: `/api/v1/accounts/change-secret-executions/?${params}`,
detailRoute: 'AccountChangeSecretExecutionDetail', detailRoute: 'AccountChangeSecretExecutionDetail',
automationRoute: 'AccountChangeSecretDetail', automationRoute: 'AccountChangeSecretDetail',
resource: 'changesecretexecution' resource: 'changesecretexecution'

View File

@ -52,7 +52,14 @@ export default {
canDirect: true, canDirect: true,
count: this.data.total_count_change_secrets, count: this.data.total_count_change_secrets,
callback: () => { callback: () => {
this.$eventBus.$emit('change-tab', 'AccountChangeSecretList') this.$eventBus.$emit('change-tab',
{
name: 'AccountChangeSecretList',
payload: {
days: this.days
}
}
)
} }
} }
}, },
@ -78,7 +85,12 @@ export default {
canDirect: true, canDirect: true,
count: this.data.total_count_change_secret_executions, count: this.data.total_count_change_secret_executions,
callback: () => { callback: () => {
this.$eventBus.$emit('change-tab', 'AccountChangeSecretExecutionList') this.$eventBus.$emit('change-tab', {
name: 'AccountChangeSecretExecutionList',
payload: {
days: this.days
}
})
} }
} }
}, },

View File

@ -53,8 +53,9 @@ export default {
this.$eventBus.$off('change-tab', this.handleChangeTab) this.$eventBus.$off('change-tab', this.handleChangeTab)
}, },
methods: { methods: {
handleChangeTab(tab) { handleChangeTab({ name, payload }) {
this.config.activeMenu = tab this.config.activeMenu = name
Object.assign(this.$route.params, { ...payload })
} }
} }
} }

View File

@ -51,6 +51,11 @@ export default {
createDrawer: () => import('@/views/assets/Domain/DomainDetail/GatewayCreateUpdate.vue'), createDrawer: () => import('@/views/assets/Domain/DomainDetail/GatewayCreateUpdate.vue'),
detailDrawer: () => import('@/views/assets/Asset/AssetDetail'), detailDrawer: () => import('@/views/assets/Asset/AssetDetail'),
transObject: {}, transObject: {},
testConfig: {
port: 0,
visible: false,
cell: ''
},
tableConfig: { tableConfig: {
url: `/api/v1/assets/gateways/?domain=${this.object.id}`, url: `/api/v1/assets/gateways/?domain=${this.object.id}`,
columnsExclude: [ columnsExclude: [
@ -133,13 +138,13 @@ export default {
can: this.$hasPerm('assets.test_assetconnectivity') && !this.$store.getters.currentOrgIsRoot, can: this.$hasPerm('assets.test_assetconnectivity') && !this.$store.getters.currentOrgIsRoot,
title: this.$t('TestConnection'), title: this.$t('TestConnection'),
callback: function(val) { callback: function(val) {
this.visible = true vm.testConfig.visible = true
const port = val.row.protocols.find(item => item.name === 'ssh').port const port = val.row.protocols.find(item => item.name === 'ssh').port
if (!port) { if (!port) {
return this.$message.error(this.$tc('BadRequestErrorMsg')) return this.$message.error(this.$tc('BadRequestErrorMsg'))
} else { } else {
this.port = port vm.testConfig.port = port
this.cell = val.row.id vm.testConfig.cell = val.row.id
} }
}.bind(this) }.bind(this)
} }
@ -205,11 +210,6 @@ export default {
vm.$refs.ListTable.onCreate() vm.$refs.ListTable.onCreate()
} }
}, },
testConfig: {
port: 0,
visible: false,
cell: ''
},
addGatewaySetting: { addGatewaySetting: {
addGatewayDialogVisible: false addGatewayDialogVisible: false
} }