feat: 前端离线部署适配与在线模型测试延迟展示

- 移除 index.html 中 Google Fonts 外链,适配离线部署环境
- 侧边栏用户头像改为显示姓名首字母,去掉 picsum 占位图外链
- 在线模型测试补充 latency_ms 延迟字段展示
- api_key 为空时传空字符串避免校验报错

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
wuyongtao
2026-08-11 16:34:06 +08:00
parent b5d2cd7935
commit ae39c45a73
4 changed files with 16 additions and 7 deletions

View File

@@ -38,7 +38,13 @@ const form = reactive<ModelForm>({
// 在线模型测试
const testLoading = ref(false)
const testResult = ref<{ success: boolean; error?: string; model?: string; usage?: object } | null>(null)
const testResult = ref<{
success: boolean
error?: string
model?: string
usage?: object
latency_ms?: number
} | null>(null)
const rules: FormRules = {
name: [
@@ -149,7 +155,7 @@ async function handleTestOnline() {
const start = Date.now()
const res = await testOnlineModel({
api_url: form.api_url,
api_key: form.api_key,
api_key: form.api_key || '',
online_model_name: form.online_model_name,
})
const data = res as any