feat(api-key): 增加 API Key 上次使用时间并补齐测试

This commit is contained in:
yangjianbo
2026-02-22 22:07:17 +08:00
parent 1fae8d086d
commit 7be1195281
29 changed files with 1067 additions and 16 deletions

View File

@@ -478,6 +478,7 @@ export default {
today: 'Today',
total: 'Total',
quota: 'Quota',
lastUsedAt: 'Last Used',
useKey: 'Use Key',
useKeyModal: {
title: 'Use API Key',

View File

@@ -479,6 +479,7 @@ export default {
today: '今日',
total: '累计',
quota: '额度',
lastUsedAt: '上次使用时间',
useKey: '使用密钥',
useKeyModal: {
title: '使用 API 密钥',

View File

@@ -159,6 +159,13 @@
</span>
</template>
<template #cell-last_used_at="{ value }">
<span v-if="value" class="text-sm text-gray-500 dark:text-dark-400">
{{ formatDateTime(value) }}
</span>
<span v-else class="text-sm text-gray-400 dark:text-dark-500">-</span>
</template>
<template #cell-created_at="{ value }">
<span class="text-sm text-gray-500 dark:text-dark-400">{{ formatDateTime(value) }}</span>
</template>
@@ -738,6 +745,7 @@ const columns = computed<Column[]>(() => [
{ key: 'usage', label: t('keys.usage'), sortable: false },
{ key: 'expires_at', label: t('keys.expiresAt'), sortable: true },
{ key: 'status', label: t('common.status'), sortable: true },
{ key: 'last_used_at', label: t('keys.lastUsedAt'), sortable: true },
{ key: 'created_at', label: t('keys.created'), sortable: true },
{ key: 'actions', label: t('common.actions'), sortable: false }
])