fix: 供应商统计排除 unknown 及表格列宽响应式优化

- 从 Dashboard 供应商成本统计中排除 unknown 提供商
- 优化供应商管理表格列宽为百分比宽度配合最小宽度

Closes #110
Co-authored-by: RWDai <27391645+RWDai@users.noreply.github.com>
This commit is contained in:
fawney19
2026-01-19 20:47:00 +08:00
parent c29d57622f
commit 1874214927
2 changed files with 10 additions and 8 deletions
@@ -98,22 +98,22 @@
<Table>
<TableHeader>
<TableRow class="border-b border-border/40 hover:bg-transparent">
<TableHead class="w-[180px] h-11 font-medium text-foreground/80">
<TableHead class="w-[18%] min-w-[140px] h-11 font-medium text-foreground/80">
提供商信息
</TableHead>
<TableHead class="w-[100px] h-11 font-medium text-foreground/80">
<TableHead class="w-[16%] min-w-[180px] h-11 font-medium text-foreground/80">
余额监控
</TableHead>
<TableHead class="w-[120px] h-11 font-medium text-foreground/80 text-center">
<TableHead class="w-[12%] min-w-[100px] h-11 font-medium text-foreground/80 text-center">
资源统计
</TableHead>
<TableHead class="w-[280px] h-11 font-medium text-foreground/80">
<TableHead class="w-[30%] min-w-[200px] h-11 font-medium text-foreground/80">
端点健康
</TableHead>
<TableHead class="w-[80px] h-11 font-medium text-foreground/80 text-center">
<TableHead class="w-[8%] min-w-[60px] h-11 font-medium text-foreground/80 text-center">
状态
</TableHead>
<TableHead class="w-[120px] h-11 font-medium text-foreground/80 text-center">
<TableHead class="w-[16%] min-w-[120px] h-11 font-medium text-foreground/80 text-center">
操作
</TableHead>
</TableRow>
+4 -2
View File
@@ -1191,7 +1191,7 @@ class DashboardDailyStatsAdapter(DashboardAdapter):
provider_agg[provider]["tokens"] += int(stat.tokens or 0)
provider_agg[provider]["cost"] += float(stat.cost or 0)
# 构建 provider_summary
# 构建 provider_summary(排除 unknown
provider_summary = [
{
"provider": provider,
@@ -1200,6 +1200,7 @@ class DashboardDailyStatsAdapter(DashboardAdapter):
"cost": agg["cost"],
}
for provider, agg in provider_agg.items()
if provider.lower() != "unknown"
]
provider_summary.sort(key=lambda x: x["cost"], reverse=True)
@@ -1226,12 +1227,13 @@ class DashboardDailyStatsAdapter(DashboardAdapter):
provider_summary = [
{
"provider": stat.provider_name or "Unknown",
"provider": stat.provider_name,
"requests": stat.requests or 0,
"tokens": int(stat.tokens or 0),
"cost": float(stat.cost or 0),
}
for stat in provider_stats
if stat.provider_name and stat.provider_name.lower() != "unknown"
]
return {