refactor(frontend): 优化功能模块组件

- 更新 api-keys 模块: StandaloneKeyFormDialog
- 改进 auth 模块: LoginDialog
- 优化 models 模块: AliasDialog, GlobalModelFormDialog, ModelDetailDrawer, TieredPricingEditor
- 重构 providers 模块: 多个表单和对话框组件
- 更新 usage 模块: 时间线、表格和详情组件
- 调整 users 模块: UserFormDialog
This commit is contained in:
fawney19
2025-12-12 16:15:36 +08:00
parent e9a6233655
commit 06c0a47b21
29 changed files with 2572 additions and 1051 deletions

View File

@@ -1,8 +1,13 @@
<template>
<Card class="p-4">
<div class="flex items-center justify-between mb-3">
<p class="text-sm font-semibold">{{ title }}</p>
<div v-if="displayLegendItems.length > 0" class="flex items-center gap-2 flex-wrap justify-end text-[11px]">
<p class="text-sm font-semibold">
{{ title }}
</p>
<div
v-if="displayLegendItems.length > 0"
class="flex items-center gap-2 flex-wrap justify-end text-[11px]"
>
<div
v-for="item in displayLegendItems"
:key="item.id"
@@ -14,18 +19,35 @@
/>
<span class="text-muted-foreground">{{ item.name }}</span>
</div>
<span v-if="hiddenLegendCount > 0" class="text-muted-foreground">
<span
v-if="hiddenLegendCount > 0"
class="text-muted-foreground"
>
+{{ hiddenLegendCount }} 更多
</span>
</div>
</div>
<div v-if="loading" class="h-[160px] flex items-center justify-center">
<div class="text-sm text-muted-foreground">Loading...</div>
<div
v-if="loading"
class="h-[160px] flex items-center justify-center"
>
<div class="text-sm text-muted-foreground">
Loading...
</div>
</div>
<div v-else-if="hasData" class="h-[160px]">
<ScatterChart :data="chartData" :options="chartOptions" />
<div
v-else-if="hasData"
class="h-[160px]"
>
<ScatterChart
:data="chartData"
:options="chartOptions"
/>
</div>
<div v-else class="h-[160px] flex items-center justify-center text-sm text-muted-foreground">
<div
v-else
class="h-[160px] flex items-center justify-center text-sm text-muted-foreground"
>
暂无请求间隔数据
</div>
</Card>
@@ -147,7 +169,7 @@ function formatModelName(model: string): string {
}
}
// 其他模型保持原样但截断
return model.length > 20 ? model.slice(0, 17) + '...' : model
return model.length > 20 ? `${model.slice(0, 17) }...` : model
}
// 构建图表数据