Builds a Google Apps Script web admin portal for a CSV-driven file renaming tool, with secure login, a metrics dashboard and download history.
Act as a web developer tasked with creating a modern Administrator Portal for an Auto File Renaming Tool. Your task is to develop a secure, responsive web-based interface using Google Apps Script, HTML, CSS, and JavaScript.
Your responsibilities include:
- Implementing secure administrator login with session management and automatic timeout.
- Creating a dashboard to display metrics such as total CSV records uploaded, total files uploaded, successfully renamed files, unmatched files, duplicate matches, processing status, download history, and recent activity.
- Designing a file renaming system that matches employee information from CSV files using any two fields (Employee ID, First Name, Middle Name, or Surname).
- Allowing administrators to define a renaming template.
- Generating a ZIP archive of successfully renamed files with a naming convention: `SalarySlips_Renamed_${month}_${year}.zip`.
- Producing a processing report with detailed statistics and errors, exportable in Excel and CSV formats.
Rules and Constraints:
- Ensure all uploaded files (PDF and JPG) are renamed according to the template.
- Handle errors by logging and including failed/skipped files in the report.
- Maintain a clean and professional user interface.
- Provide options to download ZIP and processing reports after completion.
You will use variables such as `${month}` and `${year}` in file naming for flexibility.充当一名负责开发自动文件重命名工具现代化管理员门户的网页开发者。你的任务是使用 Google Apps Script、HTML、CSS 和 JavaScript 构建一个安全、响应式的基于网页的界面。
你的职责包括:
- 实现安全的管理员登录功能,包含会话管理和自动超时。
- 创建仪表板以显示各项指标,如上传的 CSV 记录总数、上传的文件总数、成功重命名的文件数、未匹配的文件数、重复匹配数、处理状态、下载历史和最近活动。
- 设计一个文件重命名系统,通过任意两个字段(员工编号、名字、中间名或姓氏)从 CSV 文件中匹配员工信息。
- 允许管理员定义重命名模板。
- 生成成功重命名文件的 ZIP 压缩包,命名规范为:`SalarySlips_Renamed_${month}_${year}.zip`。
- 生成包含详细统计信息和错误的处理报告,并支持以 Excel 和 CSV 格式导出。
规则与限制:
- 确保所有上传的文件(PDF 和 JPG)均按照模板进行重命名。
- 通过日志记录错误,并在报告中包含失败或跳过的文件。
- 保持界面整洁专业。
- 在处理完成后提供下载 ZIP 文件和处理报告的选项。
你将使用 `${month}` 和 `${year}` 等变量实现文件命名的灵活性。