素材图片在高分辨率屏幕上清晰显示;项目资源对话框点整行勾选
CI/CD / test (push) Canceled after 0s
CI/CD / deploy (push) Canceled after 0s

- 素材库每张图另外渲染一份两倍尺寸(name.2x.png),build-gallery.sh 把图片编号(原尺寸 PNG 的
  SHA-1,和运行器给图片的编号相同)和两倍图写进 index.json
- 网页认出素材图片(按编号或素材网址),图片框用 srcset、背景用 image-set,系统缩放 150%、200%
  的屏幕上不再发虚;学生程序读到的仍是原尺寸图片,宽高、评分都不变
- 素材清单 index.json 每次向服务器确认(不再缓存一小时),部署新素材后立即生效
- 项目资源对话框:点整行就能勾选(原来只能点复选框,"试听"不会勾选);缩略图用灰色棋盘格底,
  透明背景上的白色图片(ico_title)也看得见

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-10-25 18:49:34 +08:00
1 parent f304fc1ffc
commit c217eb5ca0
33 files changed
+98 -41

No files matched your search

+2 -1
View File
@@ -80,7 +80,8 @@ export function createApp(db: Database, gradingQueue: GradingQueue, aiQueue: AiQ
if (!/^[\w.-]+$/.test(name)) return c.notFound()
const file = Bun.file(`${dirname(config.runnerDll)}/Resources/gallery/${name}`)
if (!(await file.exists())) return c.notFound()
return new Response(file, { headers: { 'Cache-Control': 'public, max-age=3600' } })
// 清单随部署更新(新素材、图片编号),每次都向服务器确认;图片缓存一小时
return new Response(file, { headers: { 'Cache-Control': name === 'index.json' ? 'no-cache' : 'public, max-age=3600' } })
})
// 其余接口都要先登录(请求头 Authorization: Bearer <令牌>)