index.html
23.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>项目文档导航 — llm-call-platform</title>
<style>
/* === Magic-Vision 设计系统 === */
:root {
--color-primary: #2563eb; --color-primary-light: #dbeafe; --color-primary-dark: #1e40af;
--color-success: #16a34a; --color-success-light: #dcfce7;
--color-warning: #d97706; --color-warning-light: #fef3c7;
--color-danger: #dc2626; --color-danger-light: #fee2e2;
--color-pending: #6b7280; --color-pending-light: #f3f4f6;
--color-bg: #ffffff; --color-bg-secondary: #f8fafc;
--color-border: #e2e8f0; --color-text: #1e293b;
--color-text-secondary: #64748b; --color-text-muted: #94a3b8;
--font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
--font-mono: "SF Mono", "Fira Code", Menlo, Consolas, monospace;
--radius: 8px; --radius-sm: 4px;
--shadow: 0 1px 3px rgba(0,0,0,0.1); --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-family); background: var(--color-bg-secondary); color: var(--color-text); line-height: 1.6; min-height: 100vh; }
.container { max-width: 1200px; margin: 0 auto; padding: 24px; }
/* 通用组件 */
.badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; }
.badge-confirmed { background: var(--color-success-light); color: var(--color-success); }
.badge-pending { background: var(--color-pending-light); color: var(--color-pending); }
.badge-doubt { background: var(--color-warning-light); color: var(--color-warning); }
.priority { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: 700; }
.priority-p0 { background: var(--color-danger-light); color: var(--color-danger); }
.priority-p1 { background: var(--color-warning-light); color: var(--color-warning); }
.priority-p2 { background: var(--color-primary-light); color: var(--color-primary); }
.card { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; background: var(--color-bg-secondary); border-bottom: 1px solid var(--color-border); }
.card-title { margin: 0; font-size: 1rem; font-weight: 600; }
.card-body { padding: 20px; }
.accordion { border: 1px solid var(--color-border); border-radius: var(--radius); margin-bottom: 12px; }
.accordion-summary { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; cursor: pointer; font-weight: 600; background: var(--color-bg-secondary); list-style: none; }
.accordion-summary::-webkit-details-marker { display: none; }
.accordion[open] .accordion-summary { border-bottom: 1px solid var(--color-border); }
.accordion-content { padding: 20px; }
.tabs { margin-bottom: 24px; }
.tab-nav { display: flex; gap: 0; border-bottom: 2px solid var(--color-border); margin-bottom: 20px; }
.tab-btn { padding: 10px 20px; border: none; background: none; cursor: pointer; font-size: 0.9rem; font-weight: 500; color: var(--color-text-secondary); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.2s; }
.tab-btn:hover { color: var(--color-text); }
.tab-btn.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th { padding: 12px 14px; text-align: left; font-weight: 600; background: var(--color-bg-secondary); border-bottom: 2px solid var(--color-border); font-size: 0.78rem; text-transform: uppercase; color: var(--color-text-secondary); }
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.data-table tbody tr:hover { background: var(--color-bg-secondary); }
.stack-tag { display: inline-block; padding: 2px 8px; margin: 2px; background: var(--color-primary-light); color: var(--color-primary-dark); border-radius: 4px; font-size: 0.75rem; font-weight: 500; }
.tree { font-family: var(--font-mono); font-size: 0.875rem; line-height: 2; }
.tree-node { padding: 2px 0; }
.tree-children { padding-left: 24px; border-left: 1px dashed var(--color-border); margin-left: 8px; }
.tree-icon { margin-right: 6px; }
.tree-comment { color: var(--color-text-muted); font-size: 0.8rem; font-family: var(--font-family); margin-left: 8px; }
/* 顶部导航栏 */
.top-nav { display: flex; align-items: center; justify-content: space-between; padding: 16px 28px; background: var(--color-bg); border-bottom: 1px solid var(--color-border); box-shadow: var(--shadow); position: sticky; top: 0; z-index: 100; }
.nav-left { display: flex; align-items: center; gap: 8px; }
.nav-title { margin: 0; font-size: 1.25rem; }
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-version { font-size: 0.85rem; color: var(--color-text-secondary); }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-label { font-size: 0.8rem; color: var(--color-text-muted); }
.nav-link { padding: 4px 12px; border-radius: var(--radius-sm); text-decoration: none; font-size: 0.85rem; font-weight: 500; color: var(--color-primary); border: 1px solid var(--color-primary-light); transition: all 0.2s; }
.nav-link:hover { background: var(--color-primary-light); }
.back-link { color: var(--color-text-secondary); text-decoration: none; font-size: 0.85rem; padding: 4px 10px; border-radius: var(--radius-sm); transition: all 0.2s; }
.back-link:hover { color: var(--color-primary); background: var(--color-primary-light); }
/* Hero 标题卡片 */
.hero-card { display: flex; align-items: center; justify-content: space-between; padding: 24px; background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-bg) 100%); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow-md); margin-bottom: 24px; }
.hero-title { margin: 0 0 8px; font-size: 1.5rem; }
.hero-goal { margin: 0; color: var(--color-text-secondary); font-size: 1rem; }
/* 页脚 */
.footer { text-align: center; padding: 32px; color: var(--color-text-muted); font-size: 0.8rem; }
/* 信息网格 */
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; margin-bottom: 24px; }
.info-item { display: flex; flex-direction: column; padding: 12px 16px; border-bottom: 1px solid var(--color-border); border-right: 1px solid var(--color-border); }
.info-item:nth-child(3n) { border-right: none; }
.info-full { grid-column: 1 / -1; border-right: none; }
.info-label { font-size: 0.72rem; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: 4px; font-weight: 600; letter-spacing: 0.05em; }
.info-value { font-size: 0.9rem; }
.info-value code { font-family: var(--font-mono); background: var(--color-bg-secondary); padding: 1px 6px; border-radius: 3px; font-size: 0.85rem; }
/* 导航中心 */
.nav-card { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; transition: box-shadow 0.2s; }
.nav-card:hover { box-shadow: var(--shadow-md); }
.nav-card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; background: var(--color-bg-secondary); border-bottom: 1px solid var(--color-border); }
.nav-card-title { display: flex; align-items: center; gap: 10px; font-size: 1rem; font-weight: 600; }
.nav-card-icon { font-size: 1.2rem; }
.nav-card-date { font-size: 0.75rem; color: var(--color-text-muted); }
.nav-card-body { padding: 8px 0; }
.nav-card-body.empty { padding: 20px 24px; color: var(--color-text-muted); font-style: italic; text-align: center; }
.nav-file-link { display: flex; align-items: center; padding: 8px 24px; text-decoration: none; color: var(--color-text); font-size: 0.9rem; transition: background 0.15s; }
.nav-file-link:hover { background: var(--color-primary-light); color: var(--color-primary); }
.nav-file-link .file-icon { margin-right: 10px; font-size: 0.85rem; flex-shrink: 0; }
.nav-file-link .file-desc { margin-left: auto; font-size: 0.78rem; color: var(--color-text-muted); }
/* Toast */
.toast { position: fixed; bottom: 20px; right: 20px; background: #1f2937; color: #fff; padding: 10px 18px; border-radius: 6px; font-size: 13px; opacity: 0; transition: opacity .2s; z-index: 200; }
.toast.show { opacity: 1; }
/* 交互图 */
.diagram-container { background: var(--color-bg-secondary); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; overflow-x: auto; }
.interaction-svg, .flow-svg, .dep-svg { width: 100%; height: auto; }
.node-box { fill: var(--color-bg); stroke-width: 2; }
.node-t01 { stroke: var(--color-primary); }
.node-t02 { stroke: var(--color-success); }
.node-db { stroke: var(--color-warning); }
.node-title { font-size: 0.85rem; font-weight: 700; fill: var(--color-text); }
.node-subtitle { font-size: 0.7rem; fill: var(--color-text-secondary); }
.edge { stroke: var(--color-text-muted); stroke-width: 2; }
.edge-label { font-size: 0.7rem; fill: var(--color-text-secondary); }
/* 技术栈卡片网格 */
.tech-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-bottom: 24px; }
.tech-card { position: relative; padding: 20px; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-bg); box-shadow: var(--shadow); border-top: 3px solid var(--color-pending); }
.tech-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.tech-card.dimension-frontend { border-top-color: var(--color-primary); }
.tech-card.dimension-backend { border-top-color: var(--color-success); }
.tech-card.dimension-database { border-top-color: var(--color-warning); }
.tech-card.dimension-cache { border-top-color: #e11d48; }
.tech-card.dimension-deploy { border-top-color: #7c3aed; }
.tech-card.dimension-disabled { opacity: 0.55; border-top-color: var(--color-border); }
.tech-card-icon { font-size: 1.5rem; margin-bottom: 8px; }
.tech-dimension { margin: 0 0 12px; font-size: 0.95rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-secondary); }
.tech-choice, .tech-reason, .tech-alt { font-size: 0.85rem; margin-bottom: 8px; color: var(--color-text); }
.tech-na { font-size: 0.85rem; color: var(--color-text-muted); font-style: italic; }
.tech-card .badge { position: absolute; top: 16px; right: 16px; }
.page-header { text-align: center; margin-bottom: 40px; }
.page-header h1 { font-size: 1.75rem; margin-bottom: 8px; }
.page-header .subtitle { color: var(--color-text-secondary); font-size: 0.95rem; }
.page-header .meta { margin-top: 12px; display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.page-header .meta-item { font-size: 0.8rem; color: var(--color-text-muted); background: var(--color-bg); padding: 4px 12px; border-radius: 12px; border: 1px solid var(--color-border); }
.rerender-btn { position: fixed; bottom: 24px; right: 24px; z-index: 999; padding: 10px 20px; background: #2563eb; color: #fff; border: none; border-radius: 8px; font-size: 0.9rem; cursor: pointer; box-shadow: 0 2px 8px rgba(37,99,235,0.3); transition: background 0.15s, transform 0.15s; }
.rerender-btn:hover { background: #1d4ed8; transform: translateY(-1px); }
.rerender-btn:disabled { background: #94a3b8; cursor: not-allowed; transform: none; }
.rerender-overlay { display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,0.5); align-items: center; justify-content: center; }
.rerender-overlay.active { display: flex; }
.rerender-modal { background: #fff; border-radius: 12px; padding: 24px; max-width: 600px; width: 90%; max-height: 80vh; display: flex; flex-direction: column; box-shadow: 0 8px 32px rgba(0,0,0,0.2); }
.rerender-modal h3 { margin-bottom: 12px; font-size: 1rem; }
.rerender-output { flex: 1; overflow-y: auto; background: #1e293b; color: #e2e8f0; padding: 12px; border-radius: 6px; font-size: 0.8rem; line-height: 1.5; white-space: pre-wrap; word-break: break-all; min-height: 120px; }
</style>
</head>
<body>
<div class="container">
<header class="page-header">
<h1>🧙 Magic-Vision-Spec — 项目文档导航</h1>
<p class="subtitle">llm-call-platform · 全流程开发规约可视化文档</p>
<div class="meta">
<span class="meta-item">📌 v1.0</span>
<span class="meta-item">🕐 更新:2026-06-11</span>
</div>
</header>
<div id="cards"></div>
</div>
<footer class="footer">Magic-Vision-Spec · 由 AI 生成的自包含可视化文档集</footer>
<button class="rerender-btn" onclick="rerender()" id="rerenderBtn">重新渲染</button>
<div class="rerender-overlay" id="rerenderOverlay">
<div class="rerender-modal">
<h3>正在重新渲染...</h3>
<pre id="rerenderOutput" class="rerender-output"></pre>
</div>
</div>
<script>
const CATEGORIES = [{"title": "1. 技术方案设计", "icon": "🏗️", "date": "2026-06-11", "files": [{"href": "1-tech-implementation-plan/overview.html", "name": "overview.html", "desc": "方案总览 + 交互关系 + 文件夹结构"}, {"href": "1-tech-implementation-plan/T-01-web-console.html", "name": "T-01-web-console.html", "desc": "Web 管理控制台详细方案"}, {"href": "1-tech-implementation-plan/T-02-core-api.html", "name": "T-02-core-api.html", "desc": "核心 API 服务详细方案"}, {"href": "1-tech-implementation-plan/T-03-llm-adapter.html", "name": "T-03-llm-adapter.html", "desc": "LLM 适配引擎详细方案"}, {"href": "1-tech-implementation-plan/T-04-async-scheduler.html", "name": "T-04-async-scheduler.html", "desc": "异步任务调度器详细方案"}, {"href": "1-tech-implementation-plan/T-05-data-storage.html", "name": "T-05-data-storage.html", "desc": "数据存储层详细方案"}]}, {"title": "2. 模块详细设计", "icon": "📦", "date": "2026-06-11", "files": [{"href": "2-detailed-design/planning-canvas.html", "name": "planning-canvas.html", "desc": "交互式功能看板"}, {"href": "2-detailed-design/F-01-model-providers-and-accounts.html", "name": "F-01-model-providers-and-accounts.html", "desc": "模型供应商与账号配置管理详情"}, {"href": "2-detailed-design/F-02-call-strategy-management.html", "name": "F-02-call-strategy-management.html", "desc": "调用策略管理详情"}, {"href": "2-detailed-design/F-03-prompt-templates.html", "name": "F-03-prompt-templates.html", "desc": "提示词模板管理详情"}, {"href": "2-detailed-design/F-04-call-and-task-records.html", "name": "F-04-call-and-task-records.html", "desc": "模型调用与任务记录详情"}, {"href": "2-detailed-design/F-05-call-statistics.html", "name": "F-05-call-statistics.html", "desc": "调用统计详情"}, {"href": "2-detailed-design/F-06-api-auth-users.html", "name": "F-06-api-auth-users.html", "desc": "API 认证与用户管理详情"}, {"href": "2-detailed-design/F-07-word-bank.html", "name": "F-07-word-bank.html", "desc": "敏感词库管理详情"}, {"href": "2-detailed-design/F-08-call-orchestration.html", "name": "F-08-call-orchestration.html", "desc": "LLM 调用编排服务详情"}, {"href": "2-detailed-design/F-09-llm-adapter.html", "name": "F-09-llm-adapter.html", "desc": "LLM 适配引擎详情"}, {"href": "2-detailed-design/F-10-async-task-worker.html", "name": "F-10-async-task-worker.html", "desc": "异步任务处理服务详情"}, {"href": "2-detailed-design/F-11-log-storage.html", "name": "F-11-log-storage.html", "desc": "原始日志存储服务详情"}]}, {"title": "3. 测试操作文档", "icon": "🧪", "date": "2026-06-11", "files": [{"href": "3-operation-flow/overview.html", "name": "overview.html", "desc": "测试环境 + OP 覆盖总览"}, {"href": "3-operation-flow/F-01-model-providers-and-accounts-operation.html", "name": "F-01-model-providers-and-accounts-operation.html", "desc": "模型供应商与账号配置管理测试"}, {"href": "3-operation-flow/F-02-call-strategy-management-operation.html", "name": "F-02-call-strategy-management-operation.html", "desc": "调用策略管理测试"}, {"href": "3-operation-flow/F-03-prompt-templates-operation.html", "name": "F-03-prompt-templates-operation.html", "desc": "提示词模板管理测试"}, {"href": "3-operation-flow/F-04-call-and-task-records-operation.html", "name": "F-04-call-and-task-records-operation.html", "desc": "模型调用与任务记录测试"}, {"href": "3-operation-flow/F-05-call-statistics-operation.html", "name": "F-05-call-statistics-operation.html", "desc": "调用统计测试"}, {"href": "3-operation-flow/F-06-api-auth-users-operation.html", "name": "F-06-api-auth-users-operation.html", "desc": "API 认证与用户管理测试"}, {"href": "3-operation-flow/F-07-word-bank-operation.html", "name": "F-07-word-bank-operation.html", "desc": "敏感词库管理测试"}, {"href": "3-operation-flow/F-08-call-orchestration-operation.html", "name": "F-08-call-orchestration-operation.html", "desc": "LLM 调用编排服务测试"}, {"href": "3-operation-flow/F-09-llm-adapter-operation.html", "name": "F-09-llm-adapter-operation.html", "desc": "LLM 适配引擎测试"}, {"href": "3-operation-flow/F-10-async-task-worker-operation.html", "name": "F-10-async-task-worker-operation.html", "desc": "异步任务处理服务测试"}, {"href": "3-operation-flow/F-11-log-storage-operation.html", "name": "F-11-log-storage-operation.html", "desc": "原始日志存储服务测试"}]}, {"title": "4. 数据库结构", "icon": "🗄️", "date": "2026-06-11", "files": [{"href": "4-database-schema/overview.html", "name": "overview.html", "desc": "表总览 + ER 关系图"}, {"href": "4-database-schema/M-01-ai_llmbase_model_providers.html", "name": "M-01-ai_llmbase_model_providers.html", "desc": "ai_llmbase_model_providers 表结构"}, {"href": "4-database-schema/M-02-ai_llmbase_model_account_config.html", "name": "M-02-ai_llmbase_model_account_config.html", "desc": "ai_llmbase_model_account_config 表结构"}, {"href": "4-database-schema/M-03-ai_llmbase_call_strategy_config.html", "name": "M-03-ai_llmbase_call_strategy_config.html", "desc": "ai_llmbase_call_strategy_config 表结构"}, {"href": "4-database-schema/M-04-ai_llmbase_prompt_templates.html", "name": "M-04-ai_llmbase_prompt_templates.html", "desc": "ai_llmbase_prompt_templates 表结构"}, {"href": "4-database-schema/M-05-ai_llmbase_call_records.html", "name": "M-05-ai_llmbase_call_records.html", "desc": "ai_llmbase_call_records 表结构"}, {"href": "4-database-schema/M-06-ai_llmbase_async_tasks.html", "name": "M-06-ai_llmbase_async_tasks.html", "desc": "ai_llmbase_async_tasks 表结构"}, {"href": "4-database-schema/M-07-ai_llmbase_call_statistics.html", "name": "M-07-ai_llmbase_call_statistics.html", "desc": "ai_llmbase_call_statistics 表结构"}, {"href": "4-database-schema/M-08-ai_llmbase_users.html", "name": "M-08-ai_llmbase_users.html", "desc": "ai_llmbase_users 表结构"}, {"href": "4-database-schema/M-09-ai_llmbase_api_tokens.html", "name": "M-09-ai_llmbase_api_tokens.html", "desc": "ai_llmbase_api_tokens 表结构"}, {"href": "4-database-schema/M-10-ai_llmbase_word_bank.html", "name": "M-10-ai_llmbase_word_bank.html", "desc": "ai_llmbase_word_bank 表结构"}]}, {"title": "5. API 接口文档", "icon": "🔌", "date": "2026-06-11", "files": [{"href": "5-api-spec/overview.html", "name": "overview.html", "desc": "接口总览 + 通用规范"}, {"href": "5-api-spec/M-01-model-providers-and-accounts.html", "name": "M-01-model-providers-and-accounts.html", "desc": "模型供应商与账号配置管理 API"}, {"href": "5-api-spec/M-02-call-strategy-management.html", "name": "M-02-call-strategy-management.html", "desc": "调用策略管理 API"}, {"href": "5-api-spec/M-03-prompt-templates.html", "name": "M-03-prompt-templates.html", "desc": "提示词模板管理 API"}, {"href": "5-api-spec/M-04-call-and-task-records.html", "name": "M-04-call-and-task-records.html", "desc": "模型调用与任务记录 API"}, {"href": "5-api-spec/M-05-call-statistics.html", "name": "M-05-call-statistics.html", "desc": "调用统计 API"}, {"href": "5-api-spec/M-06-api-auth-users.html", "name": "M-06-api-auth-users.html", "desc": "API 认证与用户管理 API"}, {"href": "5-api-spec/M-07-word-bank.html", "name": "M-07-word-bank.html", "desc": "敏感词库管理 API"}, {"href": "5-api-spec/M-08-call-orchestration.html", "name": "M-08-call-orchestration.html", "desc": "LLM 调用编排服务 API"}, {"href": "5-api-spec/M-09-llm-adapter.html", "name": "M-09-llm-adapter.html", "desc": "LLM 适配引擎 API"}, {"href": "5-api-spec/M-10-async-task-worker.html", "name": "M-10-async-task-worker.html", "desc": "异步任务处理服务 API"}, {"href": "5-api-spec/M-11-log-storage.html", "name": "M-11-log-storage.html", "desc": "原始日志存储服务 API"}]}];
function render() {
const container = document.getElementById('cards');
container.innerHTML = CATEGORIES.map(cat => {
const files = cat.files || [];
const hasFiles = files.length > 0;
const showFold = files.length > 5;
const visible = showFold ? files.slice(0, 5) : files;
const folded = showFold ? files.slice(5) : [];
return `<div class="nav-card">
<div class="nav-card-header">
<span class="nav-card-title"><span class="nav-card-icon">${cat.icon || '📄'}</span>${cat.title}</span>
<span class="nav-card-date">${cat.date || '—'}</span>
</div>
<div class="nav-card-body${hasFiles ? '' : ' empty'}">
${hasFiles
? visible.map(f => `<a href="${f.href}" class="nav-file-link">
<span class="file-icon">📄</span>${f.name || f.href.split('/').pop()}
${f.desc ? `<span class="file-desc">${f.desc}</span>` : ''}
</a>`).join('')
+ (folded.length ? `<details class="accordion" style="margin:0;border:none;border-top:1px solid var(--color-border)">
<summary class="accordion-summary" style="font-weight:400;font-size:0.82rem;color:var(--color-text-secondary)">展开全部 (${folded.length} 项)</summary>
<div class="accordion-content" style="padding:0">`
+ folded.map(f => `<a href="${f.href}" class="nav-file-link">
<span class="file-icon">📄</span>${f.name || f.href.split('/').pop()}
${f.desc ? `<span class="file-desc">${f.desc}</span>` : ''}
</a>`).join('')
+ `</div></details>` : '')
: '<div class="empty">尚未生成</div>'
}
</div>
</div>`;
}).join('');
}
render();
async function rerender() {
const btn = document.getElementById('rerenderBtn');
const overlay = document.getElementById('rerenderOverlay');
const output = document.getElementById('rerenderOutput');
btn.disabled = true;
overlay.classList.add('active');
output.textContent = '正在重新渲染,请稍候...\n';
try {
const resp = await fetch('/rerender', { method: 'POST' });
const text = await resp.text();
output.textContent = text;
output.textContent += '\n渲染完成!页面即将刷新...';
setTimeout(() => location.reload(), 1000);
} catch (e) {
output.textContent += '\n[ERROR] ' + e.message;
btn.disabled = false;
}
}
</script>
</body>
</html>