The HNU-TimeLetter admin panel lives atDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/HNU-himematsu/HNU-TimeLetter/llms.txt
Use this file to discover all available pages before exploring further.
/admin and provides a browser-based interface for all operational tasks: triggering Feishu data syncs, monitoring job execution, configuring the scheduler, browsing synced content, and managing the announcement popup. It is built into the Next.js application and does not require a separate service.
Accessing the Admin Panel
Navigate tohttps://your-domain.com/admin. Any request to a protected route under /admin automatically redirects to /admin/login if no valid session cookie is present.
Login
Enter the administrator password (configured via theADMIN_PASSWORD environment variable). On success, the server sets an admin_auth HttpOnly cookie with a 7-day expiry and redirects to the dashboard.
Logout
Click 退出登录 (Log Out) in the sidebar footer. This callsDELETE /api/admin/login, which clears the admin_auth cookie and redirects to the login page.
Dashboard (/admin/dashboard)
The dashboard is the primary operational view. It auto-refreshes every 5 seconds; you can also click the 刷新状态 (Refresh) button in the top-right corner.
The dashboard has four sections:
| Section | Description |
|---|---|
| 同步状态 (Sync Status) | Shows the most recent job: ID, status, last-run timestamp |
| 手动同步 (Manual Sync) | Configure and trigger an immediate sync |
| 定时任务配置 (Scheduler) | Set the cron schedule and default tables |
| 最近任务 (Recent Jobs) | Paginated history with step details and log access |
Manual Sync
Select tables to sync
In the 手动同步 card, check the tables you want to update:
Click 使用默认表 to restore the scheduler’s default table set, or 全选表 to select all five.
| Key | Source | Output File |
|---|---|---|
locations | Feishu location table | src/config/locations.json |
stories | Feishu stories table | src/data/content.json |
creation_headers | Creation board header table | src/data/creation-board-headers.json |
creation_board | Creation board main table | src/data/creation-board.json |
contributors | Contributors table | src/data/contributors.json |
Choose dependency mode
Select how to handle tables that other tables depend on:
| Mode | Behavior |
|---|---|
read_local | Use existing local JSON for dependencies (default, fastest) |
run_dependencies | Automatically sync dependency tables first |
strict | Fail immediately if any dependency is missing |
Configure options
- 包含附件 (Include Assets): When enabled, downloads Feishu attachments, uploads to OSS, and back-fills URLs. Disable for text-only updates to save time.
- 单表失败时继续 (Continue on Table Error): When enabled, a failure in one table does not abort the remaining tables.
- 备注 (Note): Optional label shown in the job history list (useful for auditing).
Trigger the sync
Click 同步数据 (Sync Data). The API returns
202 Accepted immediately with a jobId. The job runs asynchronously in the background.Only one sync job can run at a time. If a job is already running, the button is disabled and shows the active
jobId. Wait for the current job to finish before triggering a new one.Scheduler Configuration
The scheduler usesnode-schedule to trigger syncs automatically on a cron schedule.
The scheduler only works on self-hosted deployments where the Node.js process is long-lived (e.g. managed by PM2). It does not persist across Vercel serverless function invocations.
| Field | Description |
|---|---|
| 启用 (Enabled) | Toggle the scheduler on/off |
| Cron 表达式 (Cron Expression) | Standard 5-segment cron (e.g. 0 2 * * * = 2 AM daily) |
| 默认同步表 (Default Tables) | Table keys synced on each scheduled run; cannot be empty |
Job History and Logs
Click any job in the 最近任务 list to open its detail view. EachSyncJobRecord shows:
- Job metadata: jobId, kind, status, triggeredBy, note, timestamps, total duration
- Summary: totalRecords, successRecords, skippedRecords, failedRecords, filesWritten
- Steps: per-table step records with individual status, timing, and summary
- Warnings and errors: any per-record or per-step issues (e.g. missing attachments)
Viewing Raw Logs
Click 查看日志 (View Logs) on a job record to fetch the last 200 lines from the job’s log file. This is the fastest way to diagnose sync failures:SYNC_LOG_DIR (default: logs/sync).
Announcement Configuration (/admin/announcement)
The announcement popup shown on the frontend reads its configuration from this page.
| Field | Description |
|---|---|
| 文档链接 (docUrl) | Feishu document URL embedded in the popup (cannot be an empty string) |
| 功能配置 (featureConfig) | JSON object for Feishu SDK feature flags (extensions key) |
GET /api/announcement-config serves the updated config immediately — no sync or restart needed.
Content Viewer (/admin/content)
The content viewer at /admin/content reads the current JSON artifact files directly and displays them in a searchable, tabbed interface:
- 地点与故事 tab: all
LocationPointentries with nestedStoryarrays - 创作公示板 tab:
CreationIdeaandCardHeaderInforecords - 鸣谢名单 tab:
Contributorlist