Files
condor b46270264b init
2026-07-24 19:05:07 +08:00

19 lines
1.7 KiB
Markdown

# 2026-07-18 工作日志
## 1. 诊断:部分 .zip 文件不显示
- 现象:`Nginx-Fancyindex-Theme.zip` 不显示,`ServerStack.zip` 正常显示。
- 根因:`fancyindex.conf` 第 8 行 `fancyindex_ignore "theme";` 本意是隐藏 `/theme/` 资源目录,
`fancyindex_ignore` 在 PCRE 下是**不区分大小写 + 未锚定的子串正则**(`ngx_http_fancyindex_module.c`
`NGX_REGEX_CASELESS` 编译,且按裸文件名匹配、无 `^$` 锚点),因此也命中了文件名含 `Theme` 的 zip。
- 建议修复(尚未改动配置):改为 `fancyindex_ignore "^theme$";` 精确匹配目录名,避免误伤含 theme 的文件。
## 2. 修改:列标题改为 File Name / File Size / Date
- nginx 的 `ngx-fancyindex` 模块自行生成 `table#list``<thead>`,主题无法用静态 HTML 改表头文字;
`styles.css``thead th { text-transform: uppercase }` 会把标题强制大写。
- 方案:在 `theme/header.html` 的 IIFE 中新增 `renameHeaders()`,于 `onReady()` 调用,
用 JS 改写 `table#list``table.results``<th>` 文本为
`['File Name','File Size','Date','']`,并通过内联 `th.style.textTransform='none'` 覆盖大写(内联优先级高于外部 CDN 样式,无需改 CSS 文件)。
- 同步更新 `theme-preview.html` 的静态 thead 与脚本,保持预览一致。
- 注:`header.html:1` 仍引用外部 `https://repo.52or.com/fancyindex/styles.css?v=3`,本地 `theme/css/styles.css` 不一定线上生效;JS 内联方案不受此影响。
- **回退**:用户要求"回退到上一个版本",已将 `theme/header.html``theme-preview.html` 中本次的列标题改动全部撤销,恢复为 `Name / Size / Last modified`。主题文件当前回到改动前状态。