-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
318 lines (292 loc) · 15.8 KB
/
index.html
File metadata and controls
318 lines (292 loc) · 15.8 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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<title>每日计划与总结</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<!-- 侧边栏导航 -->
<div id="sidebar" class="sidebar">
<div class="sidebar-header">
<h3>📁 历史记录</h3>
<button id="sidebar-toggle" class="sidebar-toggle" onclick="toggleSidebar()">
<span></span>
<span></span>
<span></span>
</button>
</div>
<div class="sidebar-content">
<div class="tree-view" id="record-tree">
<div class="tree-loading">
<p>暂无历史记录</p>
<small>保存数据后将显示记录结构</small>
</div>
</div>
</div>
</div>
<!-- 主内容区域 -->
<div class="main-content">
<!-- 侧边栏触发按钮 -->
<button class="sidebar-trigger" onclick="toggleSidebar()">📁</button>
<h1 id="main-title">每日计划与总结</h1>
<!-- 设置按钮 -->
<div class="settings-trigger">
<button id="settings-btn" class="settings-button" onclick="toggleSettings()">
⚙️ 设置
</button>
</div>
<!-- 设置面板 -->
<div id="settings-panel" class="settings-panel">
<div class="settings-header">
<h3>⚙️ 系统设置</h3>
<button class="close-btn" onclick="toggleSettings()">✕</button>
</div>
<div class="settings-content">
<div class="setting-group">
<label for="save-directory">📁 JSON保存路径:</label>
<div class="path-input-group">
<input type="text" id="save-directory" placeholder="例如: /Users/username/Documents/DailyRecords">
<button onclick="selectDirectory()" class="browse-btn">浏览</button>
</div>
<small class="help-text">设置JSON文件的默认保存位置(浏览器下载目录的相对路径)</small>
</div>
<div class="setting-group">
<label for="auto-save">🔄 自动保存:</label>
<label class="switch">
<input type="checkbox" id="auto-save" checked>
<span class="slider"></span>
</label>
<small class="help-text">启用后会自动保存您的输入内容</small>
</div>
<div class="setting-group">
<label for="file-naming">📝 文件命名格式:</label>
<select id="file-naming">
<option value="每日记录_{date}">每日记录_日期</option>
<option value="daily_record_{date}">daily_record_日期</option>
<option value="{date}_记录">{日期}_记录</option>
<option value="custom">自定义</option>
</select>
<input type="text" id="custom-naming" placeholder="自定义格式,使用{date}代表日期" style="display:none;">
<small class="help-text">选择保存文件的命名方式</small>
</div>
<!-- AI功能配置 -->
<div class="setting-group">
<h4>🤖 AI智能助手设置</h4>
<label for="ai-enabled">🔄 启用AI功能:</label>
<label class="switch">
<input type="checkbox" id="ai-enabled">
<span class="slider"></span>
</label>
<small class="help-text">启用后可使用AI每周洞察功能</small>
</div>
<div class="setting-group">
<label for="openrouter-api-key">🔑 OpenRouter API密钥:</label>
<div class="api-input-group">
<input type="password" id="openrouter-api-key" placeholder="sk-or-v1-xxxxxxxxxxxxxxxx">
<button type="button" onclick="toggleApiKeyVisibility()" class="toggle-btn">👁️</button>
</div>
<small class="help-text">
获取API密钥: <a href="https://openrouter.ai/" target="_blank">openrouter.ai</a>
| 注册后在控制台获取免费API密钥
</small>
</div>
<div class="setting-group">
<label for="openrouter-base-url">🌐 API服务地址:</label>
<input type="text" id="openrouter-base-url" placeholder="https://openrouter.ai/api/v1">
<small class="help-text">通常无需修改,除非使用其他兼容服务</small>
</div>
<div class="setting-group">
<label for="openrouter-model">🤖 AI模型:</label>
<select id="openrouter-model">
<option value="deepseek/deepseek-r1-0528-qwen3-8b:free">DeepSeek R1 (免费)</option>
<option value="openai/gpt-3.5-turbo">GPT-3.5 Turbo</option>
<option value="openai/gpt-4o-mini">GPT-4o Mini</option>
<option value="anthropic/claude-3-haiku">Claude 3 Haiku</option>
<option value="google/gemini-flash-1.5">Gemini Flash 1.5</option>
<option value="meta-llama/llama-3.1-8b-instruct:free">Llama 3.1 8B (免费)</option>
<option value="microsoft/wizardlm-2-8x22b">WizardLM 2 8x22B</option>
<option value="custom">自定义模型</option>
</select>
<input type="text" id="custom-model" placeholder="输入自定义模型名称" style="display:none; margin-top: 0.5rem;">
<small class="help-text">选择要使用的AI模型,免费模型适合日常使用</small>
</div>
<div class="settings-actions">
<button onclick="saveSettings()" class="btn btn-success">💾 保存设置</button>
<button onclick="resetSettings()" class="btn btn-secondary">🔄 重置默认</button>
<button onclick="testAiConnection()" class="btn btn-info">🧪 测试AI连接</button>
</div>
</div>
</div>
<!-- 设置遮罩层 -->
<div id="settings-overlay" class="settings-overlay" onclick="toggleSettings()"></div>
<!-- 标签页导航 -->
<div class="tabs">
<button class="tab-button active" onclick="openTab(event, 'plan-tab')">👉今日计划</button>
<button class="tab-button" onclick="openTab(event, 'summary-tab')">👉今日总结反思</button>
</div>
<!-- 今日计划标签页 -->
<div id="plan-tab" class="tab-content active">
<!-- 添加计划表单 -->
<div class="form-section">
<h2>添加新计划</h2>
<form id="plan-form" class="plan-form">
<div class="form-row">
<div class="form-group">
<label for="event">计划事件:</label>
<input type="text" id="event" name="event" required>
</div>
<div class="form-group">
<label for="importance">重要等级:</label>
<select id="importance" name="importance">
<option value="十分重要">十分重要</option>
<option value="重要" selected>重要</option>
<option value="一般重要">一般重要</option>
<option value="不重要">不重要</option>
</select>
</div>
<div class="form-group">
<label for="urgency">紧急程度:</label>
<select id="urgency" name="urgency">
<option value="十分紧急">十分紧急</option>
<option value="紧急" selected>紧急</option>
<option value="不紧急">不紧急</option>
</select>
</div>
</div>
<div class="form-row">
<div class="form-group">
<label for="start_time">开始时间:</label>
<input type="time" id="start_time" name="start_time" value="07:00">
</div>
<div class="form-group">
<label for="duration">计划时长:</label>
<input type="text" id="duration" name="duration" value="1小时">
</div>
<div class="form-group">
<label> </label>
<button type="submit" class="btn btn-primary">添加计划</button>
</div>
</div>
</form>
</div>
<!-- 计划列表 -->
<div class="table-section">
<h2>今日计划列表</h2>
<div class="table-container">
<table id="plans-table">
<thead>
<tr>
<th>计划事件</th>
<th>重要等级</th>
<th>紧急程度</th>
<th>开始时间</th>
<th>计划时长</th>
<th>完成状态</th>
<th>操作</th>
</tr>
</thead>
<tbody id="plans-tbody">
</tbody>
</table>
</div>
</div>
</div>
<!-- 今日总结标签页 -->
<div id="summary-tab" class="tab-content">
<!-- 计划完成情况 -->
<div class="summary-section">
<h2>计划完成情况</h2>
<div class="completion-stats" id="completion-stats">
<!-- 统计信息将由JavaScript动态生成 -->
</div>
<div class="table-container">
<table id="completion-table">
<thead>
<tr>
<th>未完成计划</th>
<th>未完成原因</th>
<th>需要调整</th>
</tr>
</thead>
<tbody id="completion-tbody">
</tbody>
</table>
</div>
</div>
<!-- 感悟反思 -->
<div class="reflection-section">
<h2>感悟反思</h2>
<div class="reflection-group">
<h3>👍 相比昨天的进步之处:</h3>
<div class="input-group" id="progress-group">
<div class="input-row">
<input type="text" class="progress-input" placeholder="输入进步之处..." data-index="0">
<div class="row-controls">
<button type="button" class="btn btn-sm btn-success" onclick="addInputRow('progress')">+</button>
<button type="button" class="btn btn-sm btn-danger" onclick="removeInputRow(this, 'progress')">-</button>
</div>
</div>
</div>
</div>
<div class="reflection-group">
<h3>😊 那些事还可以做的更好:</h3>
<div class="input-group" id="improvement-group">
<div class="input-row">
<input type="text" class="improvement-input" placeholder="输入改进点..." data-index="0">
<div class="row-controls">
<button type="button" class="btn btn-sm btn-success" onclick="addInputRow('improvement')">+</button>
<button type="button" class="btn btn-sm btn-danger" onclick="removeInputRow(this, 'improvement')">-</button>
</div>
</div>
</div>
</div>
<div class="reflection-group">
<h3>❤️ 最感动/感恩的三个瞬间:</h3>
<div class="input-group" id="gratitude-group">
<div class="input-row">
<input type="text" class="gratitude-input" placeholder="感动/感恩的瞬间..." data-index="0">
<div class="row-controls">
<button type="button" class="btn btn-sm btn-success" onclick="addInputRow('gratitude')">+</button>
<button type="button" class="btn btn-sm btn-danger" onclick="removeInputRow(this, 'gratitude')">-</button>
</div>
</div>
</div>
</div>
<div class="reflection-group">
<h3>☕️ 每日思考:</h3>
<div class="markdown-editor">
<div class="editor-tabs">
<button type="button" class="editor-tab active" onclick="switchEditorTab('edit')">编辑</button>
<button type="button" class="editor-tab" onclick="switchEditorTab('preview')">预览</button>
</div>
<div class="editor-content">
<textarea id="daily-thoughts" class="markdown-textarea" placeholder="在这里记录您的每日思考... 支持Markdown语法"></textarea>
<div id="markdown-preview" class="markdown-preview" style="display: none;"></div>
</div>
<div class="markdown-help">
<small>支持Markdown语法:**粗体** *斜体* `代码` > 引用 - 列表</small>
</div>
</div>
</div>
</div>
</div>
<!-- 统一的操作按钮 -->
<div class="unified-actions">
<div class="button-group">
<button onclick="saveAllData()" class="btn btn-success">💾 保存数据</button>
<button onclick="exportToPDF()" class="btn btn-info">📄 导出PDF</button>
<button onclick="clearAllData()" class="btn btn-danger">🗑️ 清空记录</button>
</div>
</div>
</div> <!-- 结束 main-content -->
</div> <!-- 结束 container -->
<script src="script.js"></script>
<script src="notification.js"></script>
</body>
</html>