fix frontend openai responses alias display

This commit is contained in:
fawney19
2026-04-26 22:09:16 +08:00
parent 0ec4b4c8a4
commit 5cd2244bc2
7 changed files with 115 additions and 21 deletions

View File

@@ -287,7 +287,7 @@
:key="fmt"
class="text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground"
>
{{ API_FORMAT_SHORT[fmt] || fmt }}
{{ formatApiFormatShort(fmt) }}
</span>
</div>
<button
@@ -375,7 +375,7 @@ import {
type AllowedModels,
} from '@/api/endpoints'
import { useUpstreamModelsCache } from '../composables/useUpstreamModelsCache'
import { API_FORMAT_SHORT, type UpstreamModel } from '@/api/endpoints/types'
import { formatApiFormatShort, type UpstreamModel } from '@/api/endpoints/types'
interface AvailableModel {
name: string

View File

@@ -125,7 +125,7 @@
:key="fmt"
class="text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground whitespace-nowrap"
>
{{ API_FORMAT_SHORT[fmt] || fmt }}
{{ formatApiFormatShort(fmt) }}
</span>
</template>
</div>
@@ -472,8 +472,14 @@ import { updateProvider, updateProviderKey } from '@/api/endpoints'
import { getProvidersSummary, type ProviderWithEndpointsSummary } from '@/api/endpoints'
import { adminApi } from '@/api/admin'
import { batchQueryBalance, type ActionResultResponse, type BalanceInfo } from '@/api/providerOps'
import { API_FORMAT_SHORT } from '@/api/endpoints/types'
import { sortApiFormats, groupApiFormats, parseApiFormat, API_FORMAT_KIND_LABELS } from '@/api/endpoints/types/api-format'
import {
sortApiFormats,
groupApiFormats,
parseApiFormat,
API_FORMAT_KIND_LABELS,
formatApiFormatShort,
normalizeApiFormatAlias,
} from '@/api/endpoints/types/api-format'
import { log } from '@/utils/logger'
interface KeyWithMeta {
@@ -893,7 +899,7 @@ const groupedFormats = computed(() => {
// 获取格式的 kind 显示名称
function formatKind(format: string): string {
const { kind } = parseApiFormat(format)
const { kind } = parseApiFormat(normalizeApiFormatAlias(format))
return API_FORMAT_KIND_LABELS[kind] || kind || format
}

View File

@@ -861,7 +861,7 @@
class="text-muted-foreground/40"
>/</span>
<span :class="{ 'text-destructive': isFormatCircuitOpen(key, format) }">
{{ API_FORMAT_SHORT[format] || format }}
{{ formatApiFormatShort(format) }}
</span>
<span
v-if="editingMultiplierKey !== key.id || editingMultiplierFormat !== format"
@@ -1150,7 +1150,6 @@ import {
type EndpointAPIKey,
type Model,
API_FORMAT_ORDER,
API_FORMAT_SHORT,
sortApiFormats,
} from '@/api/endpoints'
import type {
@@ -1162,7 +1161,7 @@ import type {
QuotaStatusSnapshot,
QuotaWindowSnapshot,
} from '@/api/endpoints/types'
import { formatApiFormat } from '@/api/endpoints/types/api-format'
import { formatApiFormat, formatApiFormatShort } from '@/api/endpoints/types/api-format'
import { isOAuthAccountProviderType, isKeyManagedProviderType } from '../utils/providerTypeUtils'
import {
isProviderQuotaAutoRefreshCoolingDown,

View File

@@ -200,7 +200,7 @@
<!-- 上排缩写 + 百分比 -->
<div class="flex items-center justify-between text-[10px] leading-none">
<span class="font-medium text-muted-foreground/80">
{{ API_FORMAT_SHORT[endpoint.api_format] || endpoint.api_format.substring(0,2) }}
{{ formatApiFormatShort(endpoint.api_format) }}
</span>
<span class="font-medium text-muted-foreground/80">
{{ isEndpointAvailable(endpoint) ? `${(endpoint.health_score * 100).toFixed(0)}%` : '-' }}
@@ -236,7 +236,7 @@ import {
} from 'lucide-vue-next'
import Button from '@/components/ui/button.vue'
import Badge from '@/components/ui/badge.vue'
import { type ProviderWithEndpointsSummary, API_FORMAT_SHORT } from '@/api/endpoints'
import { type ProviderWithEndpointsSummary, formatApiFormatShort } from '@/api/endpoints'
import { formatBillingType } from '@/utils/format'
import { sortEndpoints, isEndpointAvailable, getEndpointDotColor, getEndpointTooltip } from '@/features/providers/composables/useEndpointStatus'
import { isKeyManagedProviderType } from '../utils/providerTypeUtils'

View File

@@ -106,7 +106,7 @@
<!-- 上排缩写 + 百分比 -->
<div class="flex items-center justify-between text-[10px] leading-none">
<span class="font-medium text-muted-foreground/80">
{{ API_FORMAT_SHORT[endpoint.api_format] || endpoint.api_format.substring(0,2) }}
{{ formatApiFormatShort(endpoint.api_format) }}
</span>
<span class="font-medium text-muted-foreground/80">
{{ isEndpointAvailable(endpoint) ? `${(endpoint.health_score * 100).toFixed(0)}%` : '-' }}
@@ -209,7 +209,7 @@ import Badge from '@/components/ui/badge.vue'
import TableRow from '@/components/ui/table-row.vue'
import TableCell from '@/components/ui/table-cell.vue'
import ProviderBalanceCell from './ProviderBalanceCell.vue'
import { type ProviderWithEndpointsSummary, API_FORMAT_SHORT } from '@/api/endpoints'
import { type ProviderWithEndpointsSummary, formatApiFormatShort } from '@/api/endpoints'
import { sortEndpoints, isEndpointAvailable, getEndpointDotColor, getEndpointTooltip } from '@/features/providers/composables/useEndpointStatus'
import type { BalanceExtraItem } from '@/features/providers/auth-templates'