fix(users): 资产卡片文字压叠 + 失效图片改为友好占位

- .asset-grid 由 flex(固定 150px) 改为 grid(minmax 170px),.asset-cell 加 min-width:0
- 缩略图 width:100% + aspect-ratio 4/3;元信息行加 ellipsis;下载按钮贴底
- el-image 加 #error 插槽:过期签名 CDN 链接显示「链接已失效」而非「加载失败」整块
- 版本 2.9.9 → 2.9.10
This commit is contained in:
jidekin committed 2026-10-23 15:41:52 +08:00
1 parent 3ecb8b8b97
commit bc599f924b
5 files changed
+49 -9

No files matched your search

+18
View File
@@ -1,5 +1,23 @@
# CHANGELOG # CHANGELOG
## 2026-10-23 · 用户管理资产卡片的文字压叠修复(2.9.9 → 2.9.10)
老板截图反馈:用户管理展开账号后,图像/视频资产的「标题 / 模型·时间 / 下载按钮」全都压叠在一起。
**根因**:`.asset-grid` 是 `display: flex` + `.asset-cell { width: 150px }` ——
flex 子项默认 `flex-shrink: 1`,卡片被挤压后宽度趋近于 0,卡片内的文字与按钮就**互相压叠**。
**修复**:
- 栅格改成 `display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr))`,
宽度由栅格决定,不再依赖固定 px。
- `.asset-cell` 加 `min-width: 0`(grid/flex 子项溢出压叠的经典解法);
改成纵向 flex,下载按钮 `margin-top: auto` 贴底对齐。
- 缩略图 `width: 100%; aspect-ratio: 4/3`(原来是固定 150×110)。
- 元信息行 `overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%`。
- **顺带修「加载失败」**:部分资产的 CDN 直链带过期签名(`?UCloudPublicKey=…`),
图源本身已失效 —— 给 `el-image` 加了 `#error` 插槽,显示「链接已失效」占位,
不再是一大块刺眼的「加载失败」。
## 2026-10-23 · 调用日志列表加「缓存命中」列(2.9.8 → 2.9.9) ## 2026-10-23 · 调用日志列表加「缓存命中」列(2.9.8 → 2.9.9)
老板:「调用日志的命中缓存率为什么一直都是 0」。 老板:「调用日志的命中缓存率为什么一直都是 0」。
+1 -1
View File
@@ -355,7 +355,7 @@ _docs_on = config.server.docs_enabled # 安全默认关(report: /docs、/ope
# 2026-09-30: 2.6.1 → 2.7.0(按老板要求整个删除「火山方舟 Coding Plan」供应商:配置/模型/代码/文档/前端下拉/环境变量全清)。 # 2026-09-30: 2.6.1 → 2.7.0(按老板要求整个删除「火山方舟 Coding Plan」供应商:配置/模型/代码/文档/前端下拉/环境变量全清)。
# 2026-09-30: 2.7.0 → 2.7.1(界面提示白话化:熔断器→供应商自动保护、引擎→运行环境、slug→标识;删 120 个未引用死键)。 # 2026-09-30: 2.7.0 → 2.7.1(界面提示白话化:熔断器→供应商自动保护、引擎→运行环境、slug→标识;删 120 个未引用死键)。
# ★ 版本号纪律:每次改动都要往上加,小改动加小版本号、大改动加大版本号(README 有专章)。 # ★ 版本号纪律:每次改动都要往上加,小改动加小版本号、大改动加大版本号(README 有专章)。
VERSION = "2.9.9" VERSION = "2.9.10"
app = FastAPI( app = FastAPI(
title="API Gateway", title="API Gateway",
+1
View File
@@ -258,6 +258,7 @@ export default {
dlOk: 'Download started', dlOk: 'Download started',
dlFail: 'Download failed: {msg}', dlFail: 'Download failed: {msg}',
dlNoSrc: 'This record has no downloadable URL yet', dlNoSrc: 'This record has no downloadable URL yet',
imgExpired: 'Link expired',
}, },
chat: { chat: {
newChat: 'New chat', newChat: 'New chat',
+1
View File
@@ -258,6 +258,7 @@ export default {
dlOk: '已开始下载', dlOk: '已开始下载',
dlFail: '下载失败:{msg}', dlFail: '下载失败:{msg}',
dlNoSrc: '这条记录还没有可下载的地址', dlNoSrc: '这条记录还没有可下载的地址',
imgExpired: '链接已失效',
}, },
chat: { chat: {
newChat: '新建对话', newChat: '新建对话',
+28 -8
View File
@@ -34,7 +34,11 @@
<div v-if="act(row.name).images.length" class="asset-grid"> <div v-if="act(row.name).images.length" class="asset-grid">
<div v-for="im in act(row.name).images" :key="im.id" class="asset-cell"> <div v-for="im in act(row.name).images" :key="im.id" class="asset-cell">
<el-image :src="im.src" fit="cover" class="asset-thumb" <el-image :src="im.src" fit="cover" class="asset-thumb"
:preview-src-list="act(row.name).images.map((x: any) => x.src).filter(Boolean)" :initial-index="0" preview-teleported /> :preview-src-list="act(row.name).images.map((x: any) => x.src).filter(Boolean)" :initial-index="0" preview-teleported>
<template #error>
<div class="asset-thumb asset-fail">{{ t('users.imgExpired') }}</div>
</template>
</el-image>
<div class="asset-cap ellip3" :title="im.prompt">{{ im.prompt || '—' }}</div> <div class="asset-cap ellip3" :title="im.prompt">{{ im.prompt || '—' }}</div>
<div class="asset-meta code ellip">{{ im.served || im.model || '' }} · {{ fmtClock((im.ts || 0) / 1000) }}</div> <div class="asset-meta code ellip">{{ im.served || im.model || '' }} · {{ fmtClock((im.ts || 0) / 1000) }}</div>
<!-- 管理员代下载他人资产:产物在跨域 CDN 上,直链 <a download> 不生效, <!-- 管理员代下载他人资产:产物在跨域 CDN 上,直链 <a download> 不生效,
@@ -394,17 +398,33 @@ onMounted(load)
display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
overflow: hidden; word-break: break-all; overflow: hidden; word-break: break-all;
} }
.asset-grid { display: flex; flex-wrap: wrap; gap: 12px; } /* 2026-10-23 修:原来 `.asset-cell { width: 150px }` 在 flex 里会被压扁(flex-shrink),
.asset-cell { width: 150px; } 卡片内容(标题/元信息/下载按钮)互相压叠。改成 grid + min-width:0,宽度由栅格决定。 */
.expand-row { padding: 12px 16px; }
.asset-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
gap: 14px;
align-items: start;
}
.asset-cell { min-width: 0; display: flex; flex-direction: column; }
.asset-thumb { .asset-thumb {
width: 150px; height: 110px; border-radius: 8px; display: block; width: 100%; aspect-ratio: 4 / 3; height: auto; border-radius: 8px; display: block;
background: var(--chip); border: 1px solid var(--line); object-fit: cover; background: var(--chip); border: 1px solid var(--line); object-fit: cover;
} }
.video-ph { display: flex; align-items: center; justify-content: center; } .asset-fail {
.asset-cap { margin-top: 4px; } display: flex; align-items: center; justify-content: center;
.asset-meta { color: var(--muted-2); margin-top: 2px; } font-size: 11.5px; color: var(--muted-2); text-align: center; padding: 0 6px;
}
.video-ph { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; }
.asset-cap { margin-top: 6px; min-width: 0; }
.asset-meta {
color: var(--muted-2); margin-top: 2px; min-width: 0; max-width: 100%;
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 下载按钮放卡片底部整行(与图像/视频页一致),不做缩略图上的浮层:手机端不会挤变形 */ /* 下载按钮放卡片底部整行(与图像/视频页一致),不做缩略图上的浮层:手机端不会挤变形 */
.asset-dl { width: 100%; margin-top: 6px; } .asset-dl { width: 100%; margin-top: auto; }
.asset-cell .asset-dl { margin-top: 8px; }
.dialog-f2 { margin-top: 12px; } .dialog-f2 { margin-top: 12px; }
.dialog-f2 + .hint { margin-top: 10px; } .dialog-f2 + .hint { margin-top: 10px; }