From e4f4f54dbbc88eabbfab5db69aa0c46a6c46f4f5 Mon Sep 17 00:00:00 2001 From: Joseph Le Date: Thu, 23 Nov 2023 20:37:11 +1100 Subject: [PATCH] update findValue --- manage-view/src/components/ListLog/ListLog.jsx | 2 +- start/routes.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/manage-view/src/components/ListLog/ListLog.jsx b/manage-view/src/components/ListLog/ListLog.jsx index 7e70f23..6720695 100644 --- a/manage-view/src/components/ListLog/ListLog.jsx +++ b/manage-view/src/components/ListLog/ListLog.jsx @@ -21,7 +21,7 @@ const ListLog = () => { const findValueInLog = async () =>{ try { - const res = await axios.post(findValue,{value: value}); + const res = await axios.post(findValue,{value: valueSearch}); setValue(res.data) } catch (error) { diff --git a/start/routes.ts b/start/routes.ts index 11d4529..ae423bc 100644 --- a/start/routes.ts +++ b/start/routes.ts @@ -183,9 +183,9 @@ Route.post("/api/find-value", async ({ request, response }) => { const { value } = request.all(); console.log(value) - const { stdout, stderr } = await exec(`grep -nr "${value}" /home/logs`); + const { stdout, stderr } = await exec(`grep -nr "${value}" /home/logs`,{maxBuffer: 1024 * 500}); - + // response.status(200).send("sdjkghs"); response.status(200).send(JSON.stringify(stdout)); } catch (error) { console.error(error);