mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 09:38:02 +00:00
1
This commit is contained in:
@@ -351,7 +351,7 @@
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { useUserStore } from '@/stores/user'
|
||||
import { showToast } from '@/utils/tools'
|
||||
import { showToast, formatNumber } from '@/utils/tools'
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
@@ -360,15 +360,6 @@ const selectedPeriod = ref('week')
|
||||
const usageStats = ref(null)
|
||||
const userApiKeys = ref([])
|
||||
|
||||
const formatNumber = (num) => {
|
||||
if (num >= 1000000) {
|
||||
return (num / 1000000).toFixed(1) + 'M'
|
||||
} else if (num >= 1000) {
|
||||
return (num / 1000).toFixed(1) + 'K'
|
||||
}
|
||||
return num.toString()
|
||||
}
|
||||
|
||||
const loadUsageStats = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
@@ -391,7 +382,3 @@ onMounted(() => {
|
||||
loadUsageStats()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 组件特定样式 */
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user