设置页:外观、连接、关于、备份还原

主题用 <html> 的 data-theme 标记显式选择,tokens.css 新增两组选择器块,
权重压过 prefers-color-scheme;选「跟随系统」则不标记,交回媒体查询,
系统主题切换时界面仍跟着变。
顺带把 InboundForm 和 TokenGate 里硬编码的 #fff 换成 var(--c-bg):
深色主题的强调色是浅青,白字压在上面对比度不够,深色下会看不清。
This commit is contained in:
2026-08-11 18:35:04 +08:00
parent 6c8a1c4e0e
commit fb1dd401b2
7 changed files with 427 additions and 3 deletions
+16
View File
@@ -0,0 +1,16 @@
import { expect, test } from 'bun:test'
import { backupTime } from './backups.ts'
test('标准备份名排成可读时间', () => {
expect(backupTime('config.yaml.bak-20260811-031000')).toBe('2026-08-11 03:10:00')
})
test('配置文件名不同也能解析,只看结尾的时间戳', () => {
expect(backupTime('mihomo.yml.bak-20260101-235959')).toBe('2026-01-01 23:59:59')
})
test('不合预期的名字返回 null', () => {
expect(backupTime('config.yaml.bak')).toBeNull()
expect(backupTime('config.yaml.bak-2026081-031000')).toBeNull()
expect(backupTime('notes.txt')).toBeNull()
})