fix(admin-spa): 修复版本号显示位置,使其与网站名称在同一行显示

This commit is contained in:
shaw
2025-07-29 17:01:19 +08:00
parent 514d2f5377
commit a11e3909e0
4 changed files with 29 additions and 36 deletions

View File

@@ -556,17 +556,13 @@ const createApiKey = async () => {
tags: form.tags.length > 0 ? form.tags : undefined
}
// 模型限制
// 模型限制 - 始终提交这些字段
data.enableModelRestriction = form.enableModelRestriction
if (form.enableModelRestriction && form.restrictedModels.length > 0) {
data.restrictedModels = form.restrictedModels
}
data.restrictedModels = form.restrictedModels
// 客户端限制
// 客户端限制 - 始终提交这些字段
data.enableClientRestriction = form.enableClientRestriction
if (form.enableClientRestriction && form.allowedClients.length > 0) {
data.allowedClients = form.allowedClients
}
data.allowedClients = form.allowedClients
const result = await apiClient.post('/admin/api-keys', data)

View File

@@ -446,21 +446,13 @@ const updateApiKey = async () => {
tags: form.tags
}
// 模型限制
// 模型限制 - 始终提交这些字段
data.enableModelRestriction = form.enableModelRestriction
if (form.enableModelRestriction && form.restrictedModels.length > 0) {
data.restrictedModels = form.restrictedModels
} else {
data.restrictedModels = []
}
data.restrictedModels = form.restrictedModels
// 客户端限制
// 客户端限制 - 始终提交这些字段
data.enableClientRestriction = form.enableClientRestriction
if (form.enableClientRestriction && form.allowedClients.length > 0) {
data.allowedClients = form.allowedClients
} else {
data.allowedClients = []
}
data.allowedClients = form.allowedClients
const result = await apiClient.put(`/admin/api-keys/${props.apiKey.id}`, data)

View File

@@ -20,6 +20,8 @@
<h1 :class="['text-2xl font-bold header-title leading-tight', titleClass]">{{ title }}</h1>
</template>
<div v-else-if="loading" class="h-8 w-64 bg-gray-300/50 rounded animate-pulse"></div>
<!-- 插槽用于版本信息等额外内容 -->
<slot name="after-title"></slot>
</div>
<p v-if="subtitle" class="text-gray-600 text-sm leading-tight mt-0.5">{{ subtitle }}</p>
</div>

View File

@@ -9,22 +9,25 @@
subtitle="管理后台"
:logo-src="oemSettings.siteIconData || oemSettings.siteIcon"
title-class="text-white"
/>
<!-- 版本信息 -->
<div class="flex items-center gap-2">
<span class="text-sm text-gray-400 font-mono">v{{ versionInfo.current || '...' }}</span>
<!-- 更新提示 -->
<a
v-if="versionInfo.hasUpdate"
:href="versionInfo.releaseInfo?.htmlUrl || '#'"
target="_blank"
class="inline-flex items-center gap-1 px-2 py-0.5 bg-green-500 border border-green-600 rounded-full text-xs text-white hover:bg-green-600 transition-colors animate-pulse"
title="有新版本可用"
>
<i class="fas fa-arrow-up text-[10px]"></i>
<span>新版本</span>
</a>
</div>
>
<template #after-title>
<!-- 版本信息 -->
<div class="flex items-center gap-2">
<span class="text-sm text-gray-400 font-mono">v{{ versionInfo.current || '...' }}</span>
<!-- 更新提示 -->
<a
v-if="versionInfo.hasUpdate"
:href="versionInfo.releaseInfo?.htmlUrl || '#'"
target="_blank"
class="inline-flex items-center gap-1 px-2 py-0.5 bg-green-500 border border-green-600 rounded-full text-xs text-white hover:bg-green-600 transition-colors animate-pulse"
title="有新版本可用"
>
<i class="fas fa-arrow-up text-[10px]"></i>
<span>新版本</span>
</a>
</div>
</template>
</LogoTitle>
</div>
<!-- 用户菜单 -->
<div class="relative user-menu-container">