Files
codex-proxy-rs/frontend/src/components/usage/UsageModelCell.vue
T
ZyyandCodex 9c5fbdba70 refactor(frontend): clarify module boundaries and simplify state
Move shared components and helpers to their actual owners, standardize
component directory names, and use concise names for common utilities.
Remove redundant wrappers, copied API models, and duplicate state.

Separate API key editing from key usage, isolate settings drafts, reuse
paged queries, and tie debounced queries and requests to their scopes.

Validated with frontend lint, type checking and production build, local
import checks, and 15 temporary behavioral regression groups.

Co-authored-by: Codex <noreply@openai.com>
2026-10-05 10:34:10 +08:00

42 lines
1.1 KiB
Vue

<script setup lang="ts">
import type { UsageListRecord } from '@/api'
import { CornerDownRight } from '@lucide/vue'
import { computed } from 'vue'
import { usageModelDisplay } from './shared/presenter'
const props = defineProps<{
record: UsageListRecord
}>()
const modelDisplay = computed(() => usageModelDisplay(props.record))
</script>
<template>
<div class="inline-grid max-w-full gap-1">
<code
class="block max-w-full truncate font-mono text-cp-sm leading-none font-heavy text-cp-text"
:title="`请求模型:${modelDisplay.primary}`"
>
{{ modelDisplay.primary }}
</code>
<div
v-for="route in modelDisplay.routes"
:key="route.kind"
class="flex min-w-0 max-w-full items-center gap-1.25 text-cp-text-secondary"
:title="route.description"
>
<CornerDownRight
class="size-3.25 shrink-0"
:class="route.kind === 'returned' ? 'text-cp-orange-text' : 'text-cp-blue-text'"
stroke-width="2.4"
aria-hidden="true"
/>
<code class="block truncate font-mono text-cp-xs leading-none font-bold">
{{ route.model }}
</code>
</div>
</div>
</template>