-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
198 lines (179 loc) · 9.61 KB
/
Copy pathindex.html
File metadata and controls
198 lines (179 loc) · 9.61 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
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>TimeLens VS Code Extension · VS Code 扩展</title>
<meta name="description" content="TimeLens 官方 VS Code 扩展,追踪编码会话并按项目、语言统计,同步到 TimeLens 桌面端。" />
<link rel="icon" type="image/png" href="../docs/assets/icon.png" />
<link rel="stylesheet" href="../docs/styles.css" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
</head>
<body>
<!-- Navbar -->
<nav class="navbar">
<div class="nav-container">
<a href="../docs/index.html" class="nav-brand">
<img src="../docs/assets/icon.svg" alt="TimeLens" class="nav-icon" />
<span class="nav-title">TimeLens</span>
</a>
<div class="nav-links">
<a href="../docs/index.html#features" class="nav-link">功能</a>
<a href="../docs/index.html#showcase" class="nav-link">展示</a>
<a href="../docs/index.html#ecosystem" class="nav-link">生态</a>
<a href="../docs/index.html#quickstart" class="nav-link">快速开始</a>
<a href="../docs/index.html#docs" class="nav-link">文档</a>
<a href="https://github.com/PythonSmall-Q/TimeLens" class="nav-link" target="_blank" rel="noopener">
<svg class="github-icon" viewBox="0 0 24 24" fill="currentColor"><path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/></svg>
GitHub
</a>
</div>
<button class="nav-toggle" id="navToggle" aria-label="切换导航">
<span></span><span></span><span></span>
</button>
</div>
</nav>
<div class="content-wrapper">
<aside class="sidebar">
<ul class="sidebar-nav">
<li><a href="../docs/index.html">← 返回首页</a></li>
<li><a href="../docs/DEVELOPMENT.html">开发指南</a></li>
<li><a href="../docs/ARCHITECTURE.html">架构文档</a></li>
<li><a href="../docs/API_REFERENCE.html">API 参考</a></li>
<li><a href="../browser-extension/index.html">浏览器扩展</a></li>
<li><a href="../docs/ADD_LANGUAGE.html">添加语言</a></li>
</ul>
</aside>
<main class="content-main">
<nav class="breadcrumb">
<a href="../docs/index.html">文档首页</a>
<span>/</span>
<span>VS Code 扩展</span>
</nav>
<h1>TimeLens VS Code Extension</h1>
<p>追踪 VS Code 编码会话,并将本地分析数据同步到 TimeLens 桌面端,按项目与语言维度洞察你的开发时间。</p>
<div style="margin: 24px 0;">
<a href="https://marketplace.visualstudio.com/items?itemName=ShanWenxiao.timelens-vscode-extension" class="btn btn-primary" target="_blank" rel="noopener">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="width:18px;height:18px"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>
Visual Studio Marketplace
</a>
<a href="https://github.com/PythonSmall-Q/TimeLens/tree/master/vscode-extension" class="btn btn-secondary" target="_blank" rel="noopener" style="margin-left:12px">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="width:18px;height:18px"><path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"/></svg>
浏览源码
</a>
</div>
<hr />
<h2 id="quickstart">快速开始</h2>
<ol>
<li><strong>获取 API 密钥</strong>:在 TimeLens 桌面端「设置 → 本地 API / Extension Bridge」复制 Extension Bridge Key。</li>
<li><strong>配置扩展</strong>:打开 VS Code,找到 TimeLens 侧边栏,点击「⚙️ 配置 API 密钥」按钮,或使用命令 <code>TimeLens: Set Extension Bridge Key</code>。</li>
<li><strong>开始追踪</strong>:VS Code 会话将自动同步到 TimeLens。</li>
</ol>
<blockquote>
<p>⚠️ <strong>注意</strong>:若未配置 API 密钥,数据会暂存本地,但无法同步到桌面端。</p>
</blockquote>
<h2 id="features">功能特性</h2>
<ul>
<li>按项目和语言追踪会话时长</li>
<li>本地优先上报到 <code>http://127.0.0.1:49152</code></li>
<li>桌面端临时不可用时使用内存队列重试</li>
<li>VS Code 侧边栏实时显示同步状态</li>
<li>命令支持:
<ul>
<li><code>TimeLens: Enable Tracking</code></li>
<li><code>TimeLens: Disable Tracking</code></li>
<li><code>TimeLens: Show Tracking Status</code></li>
<li><code>TimeLens: Set/Update Extension Bridge Key</code></li>
</ul>
</li>
</ul>
<h2 id="requirements">环境要求</h2>
<ul>
<li>TimeLens 桌面端正在本地运行</li>
<li>本地 API 服务器已启用(默认端口 <code>49152</code>)</li>
<li>在 TimeLens 设置中获取 Extension Bridge Key</li>
</ul>
<h2 id="settings">扩展设置</h2>
<table>
<thead>
<tr><th>设置项</th><th>说明</th></tr>
</thead>
<tbody>
<tr><td><code>timelens.enabled</code></td><td>启用/禁用追踪</td></tr>
<tr><td><code>timelens.apiBaseUrl</code></td><td>本地 API URL(默认 <code>http://127.0.0.1:49152</code>)</td></tr>
<tr><td><code>timelens.bridgeKey</code></td><td>来自 TimeLens 设置的 extension bridge key(同步必需)</td></tr>
<tr><td><code>timelens.trackingLevel</code></td><td>记录详细级别:basic / standard / detailed</td></tr>
<tr><td><code>timelens.flushIntervalSeconds</code></td><td>队列刷新间隔(默认 30 秒)</td></tr>
<tr><td><code>timelens.idleThresholdSeconds</code></td><td>空闲切分阈值(默认 120 秒)</td></tr>
</tbody>
</table>
<h2 id="troubleshooting">常见问题</h2>
<h4>"Extension bridge key authentication failed"</h4>
<ul>
<li>检查设置中的 API 密钥是否正确</li>
<li>确保 TimeLens 桌面端正在运行</li>
<li>重启 VS Code</li>
</ul>
<h4>"未连接到 TimeLens 桌面端"</h4>
<ul>
<li>启动 TimeLens 桌面端</li>
<li>检查设置中是否启用了 Local API</li>
<li>确认 <code>timelens.apiBaseUrl</code> 与实际情况一致</li>
</ul>
<h4>数据未同步</h4>
<ul>
<li>确认已配置 API 密钥(见快速开始)</li>
<li>检查侧边栏中追踪是否已启用</li>
<li>查看 VS Code 输出面板中的错误信息</li>
</ul>
<h2 id="build">构建与打包</h2>
<pre><code>npm install
npm run build
# 打包为 VSIX
npm run package
# 或在仓库根目录执行
npm run ext:package</code></pre>
<h2 id="privacy">隐私说明</h2>
<ul>
<li>不收集源代码内容</li>
<li>不在追踪负载中收集文件路径</li>
<li>数据仅发送至本地 TimeLens API</li>
<li>API 密钥仅存储在 VS Code 本地设置中</li>
</ul>
<h2 id="related">相关文档</h2>
<ul>
<li><a href="./VSCODE_EXTENSION_SETUP.md">VS Code 扩展详细安装指南</a></li>
<li><a href="../README.md">TimeLens 桌面端 README</a></li>
<li><a href="../docs/API_REFERENCE.html">API 参考</a></li>
</ul>
</main>
</div>
<!-- Footer -->
<footer class="footer">
<div class="footer-container">
<div class="footer-brand">
<img src="../docs/assets/icon.svg" alt="TimeLens" class="footer-icon" />
<span>TimeLens</span>
</div>
<p class="footer-copy">MIT License · Built with Tauri & React · 由社区驱动</p>
<div class="footer-links">
<a href="https://github.com/PythonSmall-Q/TimeLens" target="_blank" rel="noopener">GitHub</a>
<a href="https://github.com/PythonSmall-Q/TimeLens/releases" target="_blank" rel="noopener">Releases</a>
<a href="../README.md">README</a>
<a href="../CHANGELOG.md">Changelog</a>
<a href="../CONTRIBUTING.md">Contributing</a>
<a href="../PRIVACY_POLICY.md">Privacy</a>
</div>
</div>
</footer>
<script>
const navToggle = document.getElementById('navToggle');
const navLinks = document.querySelector('.nav-links');
navToggle.addEventListener('click', () => {
navLinks.classList.toggle('open');
});
</script>
</body>
</html>