Release v0.1.30: improve daily workflows and mobile layout

This commit is contained in:
Codex
2026-10-04 20:37:14 +08:00
parent 693dd2a10a
commit a77fcc6671
19 changed files with 252 additions and 54 deletions
+6 -1
View File
@@ -13,6 +13,11 @@
...(state.assets||[]).map(x=>({...x,source:'camera',deviceType:'摄像机'})),
...(state.recorders||[]).map(x=>({...x,source:'recorder',deviceType:'录像机'})),
...(state.devices||[]).map(x=>({...x,source:'device'}))];}
function matches(device,query,sites){
const words=String(query||'').trim().toLowerCase().split(/\s+/).filter(Boolean);
const text=[device.name,device.deviceType,device.brand,device.model,device.serial,device.ownerName,device.managerName,...(device.tags||[]),...path(sites,device.siteId).map(s=>s.name)].join(' ').toLowerCase();
return words.every(word=>text.includes(word));
}
function groups(devices,dimensions,sites){
const result=new Map();
for(const device of devices){
@@ -31,5 +36,5 @@
}
return [...result.values()].sort((a,b)=>a.labels.join('/').localeCompare(b.labels.join('/'),'zh-CN'));
}
return {path,descendants,catalog,groups};
return {path,descendants,catalog,groups,matches};
});