diff --git a/web/src/i18n/locales/zh.ts b/web/src/i18n/locales/zh.ts index 75e5520..df0155a 100644 --- a/web/src/i18n/locales/zh.ts +++ b/web/src/i18n/locales/zh.ts @@ -8,7 +8,7 @@ export const zh = { 'All Files': '全部文件', 'Manage': '管理', 'System': '系统', - 'Automation': '自动化', + 'Automation': '自动任务', 'My Shares': '我的分享', 'Offline Downloads': '离线下载', 'Adapters': '存储挂载', diff --git a/web/src/pages/FileExplorerPage/components/GridView.tsx b/web/src/pages/FileExplorerPage/components/GridView.tsx index 97db4bf..60443b0 100644 --- a/web/src/pages/FileExplorerPage/components/GridView.tsx +++ b/web/src/pages/FileExplorerPage/components/GridView.tsx @@ -49,6 +49,18 @@ export const GridView: React.FC = ({ entries, thumbs, selectedEntries, lo const toHex = (v: number) => v.toString(16).padStart(2, '0'); return `#${toHex(r)}${toHex(g)}${toHex(b)}`; }; + const toRgba = (hex: string, alpha: number) => { + const s = hex.replace('#', ''); + const normalized = s.length === 3 ? s.split('').map(c => c + c).join('') : s; + const num = parseInt(normalized, 16); + if (Number.isNaN(num) || normalized.length !== 6) { + return `rgba(22, 119, 255, ${alpha})`; + } + const r = (num >> 16) & 255; + const g = (num >> 8) & 255; + const b = num & 255; + return `rgba(${r}, ${g}, ${b}, ${alpha})`; + }; const containerRef = useRef(null); const itemRefs = useRef>({}); const startRef = useRef<{ x: number, y: number } | null>(null); @@ -168,7 +180,7 @@ export const GridView: React.FC = ({ entries, thumbs, selectedEntries, lo width: rect.width, height: rect.height, border: '1px dashed var(--ant-color-border, rgba(0,0,0,0.4))', - background: 'var(--ant-color-primary-bg, rgba(0, 120, 212, 0.08))', + background: toRgba(String(token.colorPrimary || '#1677ff'), 0.16), zIndex: 999 }} />