feat: 前端离线部署适配与在线模型测试延迟展示
- 移除 index.html 中 Google Fonts 外链,适配离线部署环境 - 侧边栏用户头像改为显示姓名首字母,去掉 picsum 占位图外链 - 在线模型测试补充 latency_ms 延迟字段展示 - api_key 为空时传空字符串避免校验报错 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -4,9 +4,6 @@
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||
<title>远光软件微调平台</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -107,7 +107,13 @@ export const testOnlineModel = (data: {
|
||||
api_key: string
|
||||
online_model_name: string
|
||||
}) =>
|
||||
post<{ success: boolean; error?: string; model?: string; usage?: object }>(
|
||||
post<{
|
||||
success: boolean
|
||||
error?: string
|
||||
model?: string
|
||||
usage?: object
|
||||
latency_ms?: number
|
||||
}>(
|
||||
'/model-manage/test-online',
|
||||
data,
|
||||
)
|
||||
|
||||
@@ -180,7 +180,7 @@ async function handleLogout() {
|
||||
<!-- 底部信息 -->
|
||||
<div class="sidebar-footer">
|
||||
<div class="footer-user" v-if="auth.username">
|
||||
<el-avatar :size="36" src="https://picsum.photos/id/1005/36/36" class="user-avatar" />
|
||||
<el-avatar :size="36" class="user-avatar">{{ auth.displayName?.slice(0, 1) || '?' }}</el-avatar>
|
||||
<div class="user-info">
|
||||
<span class="user-name">{{ auth.displayName }}</span>
|
||||
<span class="user-role">{{ auth.roleLabel }}</span>
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user