mirror of
https://github.com/zyycn/codex-proxy-rs.git
synced 2026-11-29 16:00:51 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0db3c6a215 | ||
|
|
fe1c38aeb7 |
@@ -15,7 +15,6 @@ const provider = defineModel<string>({ required: true })
|
||||
<div class="min-w-0 overflow-x-auto">
|
||||
<ProviderSelect
|
||||
v-model="provider"
|
||||
class="[&_svg]:size-3.25"
|
||||
:aria-label="t('common.providers.filter')"
|
||||
:leading-option="{ label: t('common.providers.all'), value: '', icon: LayoutGrid }"
|
||||
:disabled="disabled"
|
||||
|
||||
@@ -22,7 +22,7 @@ const showAuthenticationKind = computed(() => props.authenticationKind !== undef
|
||||
const sizeClasses = {
|
||||
xs: { gap: 'gap-0.75', container: 'size-4.5 rounded-md', icon: 'size-2.5' },
|
||||
sm: { gap: 'gap-1', container: 'size-5 rounded-md', icon: 'size-3' },
|
||||
md: { gap: 'gap-2', container: 'size-7 rounded-lg', icon: 'size-3.5' },
|
||||
md: { gap: 'gap-2', container: 'size-7 rounded-lg', icon: 'size-3.25' },
|
||||
}
|
||||
const classes = computed(() => sizeClasses[props.size])
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ function selectProvider(value: string) {
|
||||
|
||||
<template>
|
||||
<ZSegmented
|
||||
:class="{ '[&_svg]:size-3.25': display === 'icon' }"
|
||||
:model-value="provider"
|
||||
:options="options"
|
||||
:display="display"
|
||||
|
||||
@@ -304,7 +304,6 @@ const {
|
||||
|
||||
<template #provider="{ row }">
|
||||
<ProviderIconGroup
|
||||
class="[&_svg]:size-3.25"
|
||||
:platform-icon="row.platformIcon" :provider="row.provider"
|
||||
:authentication-kind="row.authenticationKind"
|
||||
/>
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
<script setup lang="ts">
|
||||
import type { TableColumnSize } from '@codex-proxy/ui'
|
||||
|
||||
import type { getUsageRecordInsightsDiagnostics } from '@/api'
|
||||
import { defineTableColumns, ZCard, ZEmpty, ZSegmented, ZTable } from '@codex-proxy/ui'
|
||||
import { CornerDownRight } from '@lucide/vue'
|
||||
@@ -60,21 +58,12 @@ const resultDimensionLabel = computed(
|
||||
() => dimensionOptions.value.find(option => option.value === resultDimension.value)?.label ?? t('usage.diagnostics.dimensions'),
|
||||
)
|
||||
|
||||
const dimensionNameSizes: Record<string, TableColumnSize> = {
|
||||
model: 'md',
|
||||
account: 'sm',
|
||||
apiKey: 'md',
|
||||
provider: 'md',
|
||||
transport: 'sm',
|
||||
failureClass: 'xl',
|
||||
}
|
||||
|
||||
const diagnosticColumns = computed(() => defineTableColumns<DiagnosticDisplayItem>([
|
||||
{
|
||||
key: 'nameDisplay',
|
||||
label: t('usage.diagnostics.dimensions'),
|
||||
kind: 'custom',
|
||||
size: dimensionNameSizes[resultDimension.value] ?? 'xl',
|
||||
size: 'xl',
|
||||
},
|
||||
...(['model', 'account'].includes(resultDimension.value)
|
||||
? defineTableColumns<DiagnosticDisplayItem>([
|
||||
@@ -83,7 +72,7 @@ const diagnosticColumns = computed(() => defineTableColumns<DiagnosticDisplayIte
|
||||
label: t('usage.fields.platformType'),
|
||||
kind: 'custom',
|
||||
align: 'center',
|
||||
width: resultDimension.value === 'model'
|
||||
minWidth: resultDimension.value === 'model'
|
||||
? 72
|
||||
: 48,
|
||||
},
|
||||
@@ -95,7 +84,7 @@ const diagnosticColumns = computed(() => defineTableColumns<DiagnosticDisplayIte
|
||||
key: 'accountPlanType',
|
||||
label: t('usage.fields.subscription'),
|
||||
kind: 'status',
|
||||
minWidth: 50,
|
||||
minWidth: 80,
|
||||
},
|
||||
])
|
||||
: []),
|
||||
@@ -103,28 +92,27 @@ const diagnosticColumns = computed(() => defineTableColumns<DiagnosticDisplayIte
|
||||
key: 'requestCount',
|
||||
label: t('usage.diagnostics.request'),
|
||||
kind: 'numeric',
|
||||
width: 72,
|
||||
fixedWidth: true,
|
||||
minWidth: 72,
|
||||
},
|
||||
{
|
||||
key: 'errorCount',
|
||||
label: t('usage.health.errors'),
|
||||
kind: 'numeric',
|
||||
align: 'center',
|
||||
minWidth: 48,
|
||||
minWidth: 56,
|
||||
},
|
||||
{
|
||||
key: 'firstTokenP95Ms',
|
||||
label: t('usage.diagnostics.performance'),
|
||||
kind: 'numeric',
|
||||
minWidth: 140,
|
||||
fixedWidth: resultDimension.value === 'account',
|
||||
minWidth: 132,
|
||||
},
|
||||
{
|
||||
key: 'estimatedCost',
|
||||
label: t('usage.fields.cost'),
|
||||
kind: 'numeric',
|
||||
minWidth: 96,
|
||||
minWidth: 80,
|
||||
formatter: (_, row) => formatUsd(row.estimatedCost),
|
||||
},
|
||||
]))
|
||||
|
||||
@@ -290,9 +278,9 @@ function diagnosticNameDisplay(name: string) {
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #estimatedCost="{ row }">
|
||||
<span class="font-mono font-bold tabular-nums text-z-green-text">
|
||||
{{ formatUsd(row.estimatedCost) }}
|
||||
<template #estimatedCost="{ displayValue }">
|
||||
<span class="block truncate font-mono font-bold tabular-nums text-z-green-text" :title="String(displayValue)">
|
||||
{{ displayValue }}
|
||||
</span>
|
||||
</template>
|
||||
</ZTable>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
version: 3.60.1
|
||||
published:
|
||||
'3':
|
||||
stable: 3.60.0
|
||||
rc: 3.60.0
|
||||
beta: 3.60.0
|
||||
alpha: 3.60.0
|
||||
stable: 3.60.1
|
||||
rc: 3.60.1
|
||||
beta: 3.60.1
|
||||
alpha: 3.60.1
|
||||
|
||||
Reference in New Issue
Block a user