feat: keep API key stats modal and add timeline entry point

This commit is contained in:
atoz03
2025-12-04 14:56:27 +08:00
parent 92b30e1924
commit 9fe2918a54
2 changed files with 52 additions and 2 deletions

View File

@@ -231,6 +231,9 @@
<!-- 底部按钮 -->
<div class="mt-4 flex justify-end gap-2 sm:mt-6 sm:gap-3">
<button class="btn btn-primary px-4 py-2 text-sm" type="button" @click="openTimeline">
查看请求时间线
</button>
<button class="btn btn-secondary px-4 py-2 text-sm" type="button" @click="close">
关闭
</button>
@@ -256,7 +259,7 @@ const props = defineProps({
}
})
const emit = defineEmits(['close'])
const emit = defineEmits(['close', 'open-timeline'])
// 计算属性
const totalRequests = computed(() => props.apiKey.usage?.total?.requests || 0)
@@ -320,6 +323,10 @@ const formatTokenCount = (count) => {
const close = () => {
emit('close')
}
const openTimeline = () => {
emit('open-timeline', props.apiKey?.id)
}
</script>
<style scoped>