cc-viewer 1.6.295 → 1.6.296
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/assets/{App-Br-u2TKk.js → App-BeCGow-I.js} +1 -1
- package/dist/assets/{MdxEditorPanel-Cy4egsQx.js → MdxEditorPanel-D52b5qxi.js} +1 -1
- package/dist/assets/{Mobile-ZHF74GQs.js → Mobile-8fflztx7.js} +1 -1
- package/dist/assets/{index-DMuCrfTo.js → index-DtpelJc4.js} +2 -2
- package/dist/assets/seqResourceLoaders-DM-48tr-.js +2 -0
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/server/interceptor.js +2 -1
- package/server/lib/log-management.js +46 -99
- package/server/lib/log-stream.js +102 -8
- package/server/lib/log-watcher.js +18 -12
- package/server/routes/events.js +3 -3
- package/server/routes/logs.js +5 -5
- package/server/routes/workspaces.js +3 -3
- package/server/server.js +10 -5
- package/server/workspace-registry.js +18 -20
- package/dist/assets/seqResourceLoaders-C7X23dCJ.js +0 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Workspace Registry - 工作区持久化管理
|
|
2
|
-
import { readFileSync, writeFileSync, existsSync, mkdirSync,
|
|
2
|
+
import { readFileSync, writeFileSync, existsSync, mkdirSync, unlinkSync } from 'node:fs';
|
|
3
|
+
import { readdir, stat } from 'node:fs/promises';
|
|
3
4
|
import { renameSyncWithRetry } from './lib/file-api.js';
|
|
4
5
|
import { withFileLockAsync } from './lib/async-file-lock.js';
|
|
5
6
|
import { join, basename, resolve } from 'node:path';
|
|
@@ -88,25 +89,22 @@ export async function removeWorkspace(id) {
|
|
|
88
89
|
return result;
|
|
89
90
|
}
|
|
90
91
|
|
|
91
|
-
export function getWorkspaces() {
|
|
92
|
+
export async function getWorkspaces() {
|
|
92
93
|
const list = loadWorkspaces();
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
logCount++;
|
|
104
|
-
try { totalSize += statSync(join(logDir, f)).size; } catch { }
|
|
105
|
-
}
|
|
106
|
-
}
|
|
94
|
+
const enriched = await Promise.all(list.map(async (w) => {
|
|
95
|
+
let logCount = 0;
|
|
96
|
+
let totalSize = 0;
|
|
97
|
+
const logDir = join(LOG_DIR, w.projectName);
|
|
98
|
+
try {
|
|
99
|
+
const files = await readdir(logDir);
|
|
100
|
+
for (const f of files) {
|
|
101
|
+
if (f.endsWith('.jsonl')) {
|
|
102
|
+
logCount++;
|
|
103
|
+
try { totalSize += (await stat(join(logDir, f))).size; } catch { }
|
|
107
104
|
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
|
|
105
|
+
}
|
|
106
|
+
} catch { }
|
|
107
|
+
return { ...w, logCount, totalSize };
|
|
108
|
+
}));
|
|
109
|
+
return enriched.sort((a, b) => new Date(b.lastUsed) - new Date(a.lastUsed));
|
|
112
110
|
}
|