diff --git a/swarmlab-app/src/run/app.js b/swarmlab-app/src/run/app.js index f3d3cec..8362d56 100755 --- a/swarmlab-app/src/run/app.js +++ b/swarmlab-app/src/run/app.js @@ -389,14 +389,16 @@ cors(corsOptions), (req, res, next) => { var resdataarray = [] var resraw = {} + var reslab = '' db.collection('logs').find({}, {}).toArray() .then(item => { console.log(item) - for (let i in resdata.data) { - var resdataobj = {} - resdataobj.lab = resdata.data[i].res25swarmlabname - resdataarray.push(resdataobj) - resraw = resdata.data[i] + for (let i in item) { + reslab = item[i].message.app_name + if(resdata.filter(item1 => item1.res25swarmlabname.includes(reslab))({ + resdataarray.push(item[i]) + resraw = resdata.data[i] + } } RES.error_msg = "ok" RES.data = item