蓝牙调试页面初步完成

This commit is contained in:
2026-01-16 12:00:49 +08:00
parent d9f8358191
commit bbc4f205a3
60 changed files with 2201 additions and 51331 deletions

View File

@@ -0,0 +1,47 @@
const fs = require('fs');
const path = require('path');
const root = path.resolve(__dirname, '..');
function walk(dir) {
const res = [];
const items = fs.readdirSync(dir, { withFileTypes: true });
for (const it of items) {
const full = path.join(dir, it.name);
if (it.isDirectory()) {
// skip virtual env and node_modules
if (['.venv', 'node_modules', '.git'].includes(it.name)) continue;
res.push(...walk(full));
} else {
res.push(full);
}
}
return res;
}
function isImage(f) {
return /\.(png|jpe?g|gif|svg|webp|ico)$/i.test(f);
}
function isTextFile(f) {
return /\.(js|jsx|ts|tsx|json|html|htm|wxml|wxss|css|md|vue|py|java|xml|txt|scss|less|styl|mdx|yaml|yml)$/i.test(f);
}
const all = walk(root);
const images = all.filter(isImage);
const textFiles = all.filter(isTextFile);
const unused = [];
for (const img of images) {
const name = path.basename(img);
let found = false;
for (const tf of textFiles) {
try {
const content = fs.readFileSync(tf, 'utf8');
if (content.indexOf(name) !== -1) { found = true; break; }
} catch (e) {
// ignore
}
}
if (!found) unused.push(img);
}
console.log(JSON.stringify({ images: images, unused: unused }, null, 2));