update routes.ts

This commit is contained in:
joseph le 2023-09-13 15:30:35 +07:00
parent eaa86820cb
commit 527ac8ac54
2 changed files with 4 additions and 4 deletions

View File

@ -5,7 +5,7 @@ import { getListLog } from "../../api/apiLog";
import "./ListLog.css"; import "./ListLog.css";
const ListLog = () => { const ListLog = () => {
const [listFile, setListFile] = useState([]); const [listFile, setListFile] = useState([]);
const [status, setStatus] = useState(); const [status, setStatus] = useState(200);
const [nameSearch, setNameSearch] = useState(""); const [nameSearch, setNameSearch] = useState("");
const getListFile = async () => { const getListFile = async () => {
try { try {
@ -41,7 +41,7 @@ const ListLog = () => {
setNameSearch(e.target.value) setNameSearch(e.target.value)
}}></input> }}></input>
</div> </div>
{listFile?.filter((f)=>f.search(nameSearch)!==-1).map((file) => ( {listFile?.filter((f)=>f.toLocaleLowerCase().search(nameSearch.toLocaleLowerCase())!==-1).map((file) => (
<div> <div>
<Link to={"/logs/" + file}>{file}</Link> <Link to={"/logs/" + file}>{file}</Link>
<br></br> <br></br>

View File

@ -6,7 +6,7 @@ import "./ShowLog.css";
const ShowLog = () => { const ShowLog = () => {
let { name } = useParams(); let { name } = useParams();
const [log, setLog] = useState({}); const [log, setLog] = useState({});
const [status, setStatus] = useState(); const [status, setStatus] = useState(200);
const getContentLog = async () => { const getContentLog = async () => {
try { try {
const res = await axios.get(getLog + "/" + name); const res = await axios.get(getLog + "/" + name);
@ -131,7 +131,7 @@ const ShowLog = () => {
return ( return (
<div> <div>
<h1> <h1>
<i>The file was not found or no errors were found in the file.</i> <i>The file was not found.</i>
</h1> </h1>
</div> </div>
); );