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