cc-viewer 1.4.30 → 1.4.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.html CHANGED
@@ -6,8 +6,8 @@
6
6
  <title>Claude Code Viewer</title>
7
7
  <link rel="icon" href="/favicon.ico?v=1">
8
8
  <link rel="shortcut icon" href="/favicon.ico?v=1">
9
- <script type="module" crossorigin src="/assets/index-DLV-mlQZ.js"></script>
10
- <link rel="stylesheet" crossorigin href="/assets/index-BTtdvNJL.css">
9
+ <script type="module" crossorigin src="/assets/index-RE99qLcb.js"></script>
10
+ <link rel="stylesheet" crossorigin href="/assets/index-Ce0Yg2Sf.css">
11
11
  </head>
12
12
  <body>
13
13
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-viewer",
3
- "version": "1.4.30",
3
+ "version": "1.4.31",
4
4
  "description": "Claude Code Logger visualization management tool",
5
5
  "license": "MIT",
6
6
  "main": "server.js",
package/server.js CHANGED
@@ -621,8 +621,18 @@ async function handleRequest(req, res) {
621
621
  }
622
622
 
623
623
  const entries = readLogFile();
624
- // 初始化时发送 full_reload 事件(而非逐条发送),让前端可以批量处理时间戳
625
- res.write(`event: full_reload\ndata: ${JSON.stringify(entries)}\n\n`);
624
+ // 分段发送:先告知总数,再分块传输,让前端能显示真实加载进度
625
+ const CHUNK_SIZE = 50;
626
+ if (entries.length > CHUNK_SIZE) {
627
+ res.write(`event: load_start\ndata: ${JSON.stringify({ total: entries.length })}\n\n`);
628
+ for (let i = 0; i < entries.length; i += CHUNK_SIZE) {
629
+ const chunk = entries.slice(i, i + CHUNK_SIZE);
630
+ res.write(`event: load_chunk\ndata: ${JSON.stringify(chunk)}\n\n`);
631
+ }
632
+ res.write(`event: load_end\ndata: {}\n\n`);
633
+ } else {
634
+ res.write(`event: full_reload\ndata: ${JSON.stringify(entries)}\n\n`);
635
+ }
626
636
 
627
637
  req.on('close', () => {
628
638
  clients = clients.filter(client => client !== res);