groove-dev 0.12.7 → 0.12.8
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/node_modules/@groove-dev/daemon/src/api.js +18 -4
- package/node_modules/@groove-dev/gui/dist/assets/{index-D4-7VM-v.js → index-CeyNe9uc.js} +14 -14
- package/node_modules/@groove-dev/gui/dist/index.html +1 -1
- package/node_modules/@groove-dev/gui/src/components/DirPicker.jsx +165 -76
- package/node_modules/@groove-dev/gui/src/components/SpawnPanel.jsx +3 -3
- package/package.json +1 -1
- package/packages/daemon/src/api.js +18 -4
- package/packages/gui/dist/assets/{index-D4-7VM-v.js → index-CeyNe9uc.js} +14 -14
- package/packages/gui/dist/index.html +1 -1
- package/packages/gui/src/components/DirPicker.jsx +165 -76
- package/packages/gui/src/components/SpawnPanel.jsx +3 -3
|
@@ -392,19 +392,33 @@ export function createApi(app, daemon) {
|
|
|
392
392
|
.sort((a, b) => a.name.localeCompare(b.name))
|
|
393
393
|
.map((e) => {
|
|
394
394
|
const childPath = relPath ? `${relPath}/${e.name}` : e.name;
|
|
395
|
-
|
|
395
|
+
const childFull = resolve(fullPath, e.name);
|
|
396
396
|
let hasChildren = false;
|
|
397
|
+
let childCount = 0;
|
|
398
|
+
let fileCount = 0;
|
|
397
399
|
try {
|
|
398
|
-
|
|
399
|
-
|
|
400
|
+
const children = readdirSync(childFull, { withFileTypes: true });
|
|
401
|
+
for (const c of children) {
|
|
402
|
+
if (c.name.startsWith('.') || c.name === 'node_modules') continue;
|
|
403
|
+
if (c.isDirectory()) { childCount++; hasChildren = true; }
|
|
404
|
+
else fileCount++;
|
|
405
|
+
}
|
|
400
406
|
} catch { /* unreadable */ }
|
|
401
|
-
return { name: e.name, path: childPath, hasChildren };
|
|
407
|
+
return { name: e.name, path: childPath, hasChildren, childCount, fileCount };
|
|
402
408
|
});
|
|
403
409
|
|
|
410
|
+
// Count files in current dir
|
|
411
|
+
let currentFiles = 0;
|
|
412
|
+
try {
|
|
413
|
+
currentFiles = readdirSync(fullPath, { withFileTypes: true })
|
|
414
|
+
.filter((e) => e.isFile() && !e.name.startsWith('.')).length;
|
|
415
|
+
} catch { /* ignore */ }
|
|
416
|
+
|
|
404
417
|
res.json({
|
|
405
418
|
current: relPath || '.',
|
|
406
419
|
parent: relPath ? relPath.split('/').slice(0, -1).join('/') : null,
|
|
407
420
|
dirs: entries,
|
|
421
|
+
fileCount: currentFiles,
|
|
408
422
|
});
|
|
409
423
|
} catch (err) {
|
|
410
424
|
res.status(500).json({ error: err.message });
|