Merge branch 'fawney19:main' into main

This commit is contained in:
ZheFox
2026-05-18 13:13:37 +08:00
committed by GitHub
12 changed files with 321 additions and 286 deletions

View File

@@ -211,7 +211,6 @@
两次输入的密码不一致
</p>
</div>
</form>
<!-- 登录链接 -->

View File

@@ -17,6 +17,22 @@
<script setup lang="ts">
import { nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'
const props = withDefaults(defineProps<{
modelValue?: string
siteKey: string
action?: string
disabled?: boolean
}>(), {
modelValue: '',
action: undefined,
disabled: false,
})
const emit = defineEmits<{
'update:modelValue': [value: string]
error: [message: string]
}>()
const TURNSTILE_SCRIPT_URL = 'https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit'
type TurnstileWidgetId = string
@@ -46,22 +62,6 @@ declare global {
}
}
const props = withDefaults(defineProps<{
modelValue?: string
siteKey: string
action?: string
disabled?: boolean
}>(), {
modelValue: '',
action: undefined,
disabled: false,
})
const emit = defineEmits<{
'update:modelValue': [value: string]
error: [message: string]
}>()
const containerRef = ref<HTMLElement | null>(null)
const widgetId = ref<TurnstileWidgetId | null>(null)
const errorMessage = ref('')

View File

@@ -28,7 +28,10 @@
{{ manualGlobalModelMode ? '选择已有模型' : '手动添加' }}
</Button>
</div>
<div v-if="!manualGlobalModelMode" class="space-y-2">
<div
v-if="!manualGlobalModelMode"
class="space-y-2"
>
<Select
:model-value="form.global_model_id"
:disabled="loadingGlobalModels"
@@ -48,10 +51,16 @@
</SelectContent>
</Select>
</div>
<div v-else class="rounded-lg border border-border/60 bg-muted/20 p-3 space-y-3">
<div
v-else
class="rounded-lg border border-border/60 bg-muted/20 p-3 space-y-3"
>
<div class="grid grid-cols-2 gap-3">
<div class="space-y-1.5">
<Label for="manual-global-model-name" class="text-xs">模型ID *</Label>
<Label
for="manual-global-model-name"
class="text-xs"
>模型ID *</Label>
<Input
id="manual-global-model-name"
v-model="form.manual_global_model_name"
@@ -60,7 +69,10 @@
/>
</div>
<div class="space-y-1.5">
<Label for="manual-global-model-display-name" class="text-xs">显示名称</Label>
<Label
for="manual-global-model-display-name"
class="text-xs"
>显示名称</Label>
<Input
id="manual-global-model-display-name"
v-model="form.manual_global_model_display_name"
@@ -79,7 +91,10 @@
没有可选择的本地全局模型可以切换到手动添加继续保存
</p>
<div class="space-y-1.5">
<Label for="provider-model-name" class="text-xs">Provider 模型名 *</Label>
<Label
for="provider-model-name"
class="text-xs"
>Provider 模型名 *</Label>
<Input
id="provider-model-name"
v-model="form.provider_model_name"

View File

@@ -293,7 +293,10 @@
</div>
<!-- 桌面端表格视图 -->
<Table :class="['hidden md:table table-fixed w-full', isAdmin ? 'min-w-[1120px]' : 'min-w-[960px]']">
<Table
class="hidden md:table table-fixed w-full"
:class="[isAdmin ? 'min-w-[1120px]' : 'min-w-[960px]']"
>
<colgroup v-if="isAdmin">
<col class="w-[8%]">
<col class="w-[12%]">
@@ -346,7 +349,8 @@
密钥
</TableHead>
<SortableTableHead
:class="['h-12 font-semibold', isAdmin ? 'w-[14%]' : 'w-[22%]']"
class="h-12 font-semibold"
:class="[isAdmin ? 'w-[14%]' : 'w-[22%]']"
column-key="model"
:sortable="false"
:filter-active="filterModel !== '__all__'"
@@ -383,7 +387,8 @@
</template>
</SortableTableHead>
<SortableTableHead
:class="['h-12 font-semibold', isAdmin ? 'w-[15%]' : 'w-[14%]']"
class="h-12 font-semibold"
:class="[isAdmin ? 'w-[15%]' : 'w-[14%]']"
column-key="api_format"
:sortable="false"
:filter-active="filterApiFormat !== '__all__'"
@@ -495,7 +500,8 @@
</div>
</TableCell>
<TableCell
:class="['font-medium py-4', isAdmin ? 'w-[14%]' : 'w-[22%]']"
class="font-medium py-4"
:class="[isAdmin ? 'w-[14%]' : 'w-[22%]']"
:title="getModelTooltip(record)"
>
<div
@@ -582,7 +588,8 @@
</div>
</TableCell>
<TableCell
:class="['py-4', isAdmin ? 'w-[15%]' : 'w-[14%]']"
class="py-4"
:class="[isAdmin ? 'w-[15%]' : 'w-[14%]']"
:title="getApiFormatTooltip(record)"
>
<!-- 有格式转换或同族格式差异两行显示 -->
@@ -682,8 +689,8 @@
</div>
<div class="mt-0.5 grid w-full min-w-0 grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] gap-x-1 text-xs leading-tight tabular-nums text-muted-foreground">
<span
class="justify-self-end whitespace-nowrap text-right"
:class="[
'justify-self-end whitespace-nowrap text-right',
hasPositiveTokens(getRecordCacheReadTokens(record)) ? 'text-foreground/70' : ''
]"
>
@@ -693,8 +700,8 @@
/
</span>
<span
class="justify-self-start whitespace-nowrap text-left"
:class="[
'justify-self-start whitespace-nowrap text-left',
hasPositiveTokens(getRecordCacheCreationTokens(record)) ? 'text-foreground/70' : ''
]"
>