feat(ui): 优化缓存区布局并修复分段筛选问题
- 将工具栏分为上下两行布局,优化窄屏下的显示效果 - 增加元素间距和可点击区域,提升用户体验 - 修复切换CSS/JS/全部时未重置分页的问题 - 禁用首页和HTML文件的缓存,避免浏览器缓存旧版本 - 更新README文档说明布局优化细节
This commit is contained in:
10
server.js
10
server.js
@@ -41,8 +41,16 @@ function ensureCacheDirs() {
|
||||
*/
|
||||
function registerPublicHomepage(app) {
|
||||
if (!fs.existsSync(PUBLIC_DIR)) fs.mkdirSync(PUBLIC_DIR)
|
||||
app.use(express.static(PUBLIC_DIR, { maxAge: '1h' }))
|
||||
app.use(express.static(PUBLIC_DIR, {
|
||||
maxAge: '1h',
|
||||
setHeaders: (res, filePath) => {
|
||||
if (path.extname(filePath) === '.html') {
|
||||
res.setHeader('Cache-Control', 'no-cache')
|
||||
}
|
||||
}
|
||||
}))
|
||||
app.get('/', (req, res) => {
|
||||
res.set('Cache-Control', 'no-cache')
|
||||
res.sendFile(path.join(PUBLIC_DIR, 'index.html'))
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user