update findValue
This commit is contained in:
parent
3a377f9f25
commit
ecf5cc4ccf
|
|
@ -11,7 +11,7 @@ const ListLog = () => {
|
||||||
const [value, setValue] = useState("");
|
const [value, setValue] = useState("");
|
||||||
const getListFile = async () => {
|
const getListFile = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await axios.get(getListLog,{value: value});
|
const res = await axios.get(getListLog);
|
||||||
setListFile(res.data);
|
setListFile(res.data);
|
||||||
setStatus(res.status);
|
setStatus(res.status);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
@ -21,7 +21,7 @@ const ListLog = () => {
|
||||||
|
|
||||||
const findValueInLog = async () =>{
|
const findValueInLog = async () =>{
|
||||||
try {
|
try {
|
||||||
const res = await axios.post(findValue);
|
const res = await axios.post(findValue,{value: value});
|
||||||
|
|
||||||
setValue(res.data)
|
setValue(res.data)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
||||||
|
|
@ -182,6 +182,7 @@ Route.post("/api/find-value", async ({ request, response }) => {
|
||||||
try {
|
try {
|
||||||
const { value } = request.all();
|
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`);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue