fix: correct API key cost calculation and UI display issues

- Fix admin panel cost display for "all time" period using permanent Redis key
- Fix user statistics total cost limit to show complete history
- Fix restricted models list overflow with scrollable container

Backend changes:
- src/routes/admin/apiKeys.js: Use allTimeCost for timeRange='all' instead of scanning TTL keys
- src/routes/apiStats.js: Prioritize permanent usage:cost:total key over monthly keys

Frontend changes:
- web/admin-spa/src/components/apistats/LimitConfig.vue: Add overflow-visible and scrolling to model list

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
John Doe
2025-12-12 18:11:02 +03:00
parent 87426133a2
commit baafebbf7b
3 changed files with 87 additions and 52 deletions

View File

@@ -284,7 +284,7 @@
</div>
<!-- 详细限制信息 -->
<div v-if="hasModelRestrictions" class="card p-4 md:p-6">
<div v-if="hasModelRestrictions" class="card !overflow-visible p-4 md:p-6">
<h3
class="mb-3 flex items-center text-lg font-bold text-gray-900 dark:text-gray-100 md:mb-4 md:text-xl"
>
@@ -301,7 +301,7 @@
<i class="fas fa-robot mr-1 text-xs md:mr-2 md:text-sm" />
受限模型列表
</h4>
<div class="space-y-1 md:space-y-2">
<div class="max-h-64 space-y-1 overflow-y-auto pr-1 md:max-h-80 md:space-y-2">
<div
v-for="model in statsData.restrictions.restrictedModels"
:key="model"