From 1462d95dc251b8ed435f50c2f3058b5e7c99bfcc Mon Sep 17 00:00:00 2001 From: zeus Date: Wed, 24 Nov 2021 00:27:49 +0200 Subject: [PATCH] add webclient --- readmongo/swarmlab-app/src/run/app.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/readmongo/swarmlab-app/src/run/app.js b/readmongo/swarmlab-app/src/run/app.js index bece0c4..b2b3108 100644 --- a/readmongo/swarmlab-app/src/run/app.js +++ b/readmongo/swarmlab-app/src/run/app.js @@ -244,6 +244,9 @@ app.get("/test2", cors(corsOptions), (req, res) => { RES.data = await mydb.collection(COLLECTION).find({}).toArray() var jsonfinal = []; RES.data.forEach((value) => { + + + if (value.tailed_path == selected) { var tmp = { message: value.message, timestamp: value.time, @@ -251,7 +254,18 @@ app.get("/test2", cors(corsOptions), (req, res) => { process_id: '', app_name: value.tailed_path, }; - jsonfinal.push(tmp); + jsonfinal.push(tmp); + } else if (selected == "All") { + var tmp = { + message: value.message, + timestamp: value.time, + type: "
" + value._id+ "
", + process_id: '', + app_name: value.tailed_path, + }; + jsonfinal.push(tmp); + } + }); //Pagination