fix: 修复 connection token 页面信息字段 actions

This commit is contained in:
Bai 2023-02-08 15:20:41 +08:00 committed by Jiangjie.Bai
parent 8d3a3587d1
commit 5b3dc2bc48

View File

@ -22,7 +22,6 @@ export default {
helpMessage: this.$t('setting.helpText.ConnectionTokenList'), helpMessage: this.$t('setting.helpText.ConnectionTokenList'),
tableConfig: { tableConfig: {
url: ajaxUrl, url: ajaxUrl,
columnsExclude: ['actions'],
columnsExtra: ['action'], columnsExtra: ['action'],
columnsShow: { columnsShow: {
min: ['id', 'actions'], min: ['id', 'actions'],
@ -38,7 +37,9 @@ export default {
action: { action: {
label: this.$t('common.Action'), label: this.$t('common.Action'),
formatter: function(row) { formatter: function(row) {
return row.actions.map(item => { return item.label }).join(', ') return row.actions.map(item => {
return item.label
}).join(', ')
} }
}, },
actions: { actions: {
@ -51,7 +52,7 @@ export default {
name: 'Expired', name: 'Expired',
title: this.$t('setting.Expire'), title: this.$t('setting.Expire'),
type: 'info', type: 'info',
can: ({ row }) => row['is_valid'], can: ({ row }) => !row['is_expired'],
callback: function({ row }) { callback: function({ row }) {
this.$axios.patch(`${ajaxUrl}${row.id}/expire/`, this.$axios.patch(`${ajaxUrl}${row.id}/expire/`,
).then(res => { ).then(res => {