mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-13 06:30:20 +08:00
fix: 供应商统计排除 unknown 及表格列宽响应式优化
- 从 Dashboard 供应商成本统计中排除 unknown 提供商 - 优化供应商管理表格列宽为百分比宽度配合最小宽度 Closes #110 Co-authored-by: RWDai <27391645+RWDai@users.noreply.github.com>
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user