update findValue

This commit is contained in:
Joseph Le 2023-11-23 20:37:11 +11:00
parent ecf5cc4ccf
commit e4f4f54dbb
2 changed files with 3 additions and 3 deletions

View File

@ -21,7 +21,7 @@ const ListLog = () => {
const findValueInLog = async () =>{ const findValueInLog = async () =>{
try { try {
const res = await axios.post(findValue,{value: value}); const res = await axios.post(findValue,{value: valueSearch});
setValue(res.data) setValue(res.data)
} catch (error) { } catch (error) {

View File

@ -183,9 +183,9 @@ Route.post("/api/find-value", async ({ request, response }) => {
const { value } = request.all(); const { value } = request.all();
console.log(value) 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)); response.status(200).send(JSON.stringify(stdout));
} catch (error) { } catch (error) {
console.error(error); console.error(error);