mirror of
https://github.com/zyycn/codex-proxy-rs.git
synced 2026-11-06 08:06:19 +00:00
fix(usage): balance diagnostic column widths
Size diagnostic names by dimension and share available width across metric columns. Keep API key names compact. Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import type { TableColumnSize } from '@codex-proxy/ui'
|
||||
import type { getUsageRecordInsightsDiagnostics } from '@/api'
|
||||
import { BaseCard, BaseEmpty, BaseSegmented, BaseTable, defineTableColumns } from '@codex-proxy/ui'
|
||||
|
||||
@@ -37,12 +38,21 @@ const resultDimensionLabel = computed(
|
||||
() => dimensionOptions.find(option => option.value === resultDimension.value)?.label ?? '维度',
|
||||
)
|
||||
|
||||
const dimensionNameSizes: Record<string, TableColumnSize> = {
|
||||
model: 'xl',
|
||||
account: '2xl',
|
||||
apiKey: 'md',
|
||||
provider: 'lg',
|
||||
transport: 'sm',
|
||||
failureClass: 'xl',
|
||||
}
|
||||
|
||||
const diagnosticColumns = computed(() => defineTableColumns<DiagnosticDisplayItem>([
|
||||
{
|
||||
key: 'nameDisplay',
|
||||
label: '维度',
|
||||
kind: 'custom',
|
||||
size: 'xl',
|
||||
size: dimensionNameSizes[resultDimension.value] ?? 'xl',
|
||||
},
|
||||
...(resultDimension.value === 'account'
|
||||
? defineTableColumns<DiagnosticDisplayItem>([
|
||||
@@ -54,22 +64,19 @@ const diagnosticColumns = computed(() => defineTableColumns<DiagnosticDisplayIte
|
||||
label: '请求',
|
||||
kind: 'numeric',
|
||||
size: 'xs',
|
||||
fixedWidth: true,
|
||||
},
|
||||
{
|
||||
key: 'errorCount',
|
||||
label: '失败',
|
||||
kind: 'numeric',
|
||||
size: 'xs',
|
||||
fixedWidth: true,
|
||||
},
|
||||
{ key: 'firstTokenP95Ms', label: '性能', kind: 'numeric', size: 'lg', fixedWidth: true },
|
||||
{ key: 'firstTokenP95Ms', label: '性能', kind: 'numeric', size: 'lg' },
|
||||
{
|
||||
key: 'estimatedCost',
|
||||
label: '费用',
|
||||
kind: 'numeric',
|
||||
size: 'sm',
|
||||
fixedWidth: true,
|
||||
},
|
||||
]))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user