mirror of
https://github.com/OpenFactorioServerManager/factorio-server-manager.git
synced 2025-01-28 05:36:33 +02:00
29 lines
636 B
JavaScript
29 lines
636 B
JavaScript
import React, {useEffect, useState} from "react";
|
|
import Layout from "../components/Layout";
|
|
import log from "../../api/resources/log";
|
|
import Panel from "../components/Panel";
|
|
|
|
const Logs = () => {
|
|
|
|
const [logs, setLogs] = useState([])
|
|
|
|
useEffect(() => {
|
|
(async () => {
|
|
const logs = await log.tail()
|
|
setLogs(logs.data);
|
|
})();
|
|
}, [])
|
|
|
|
return (
|
|
<Panel
|
|
title="Logs"
|
|
content={
|
|
<ul>
|
|
{logs.map((log,index) => (<li key={index}>{log}</li>))}
|
|
</ul>
|
|
}
|
|
/>
|
|
);
|
|
}
|
|
|
|
export default Logs; |