Create src/admin/Security.tsx
Browse files- src/admin/Security.tsx +21 -0
src/admin/Security.tsx
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { useEffect, useState } from "react";
|
| 2 |
+
import api from "../api";
|
| 3 |
+
|
| 4 |
+
export default function Security() {
|
| 5 |
+
const [logs, setLogs] = useState<any[]>([]);
|
| 6 |
+
|
| 7 |
+
useEffect(() => {
|
| 8 |
+
api.get("/admin/security/anomalies").then((r) => setLogs(r.data));
|
| 9 |
+
}, []);
|
| 10 |
+
|
| 11 |
+
return (
|
| 12 |
+
<div>
|
| 13 |
+
<h1 className="font-bold mb-4">Security</h1>
|
| 14 |
+
{logs.map((l) => (
|
| 15 |
+
<div key={l._id} className="bg-red-900/40 p-2 rounded mb-2">
|
| 16 |
+
🤖 {l.action} · {l.ip}
|
| 17 |
+
</div>
|
| 18 |
+
))}
|
| 19 |
+
</div>
|
| 20 |
+
);
|
| 21 |
+
}
|