diff --git a/Front-end/src/pages/Admin/User.jsx b/Front-end/src/pages/Admin/User.jsx index 97e2553..6332299 100644 --- a/Front-end/src/pages/Admin/User.jsx +++ b/Front-end/src/pages/Admin/User.jsx @@ -129,21 +129,32 @@ function User() { }; const logAction = (name, action) => { - /*TODO*/ - /*Ajouter le suivi dans un journal de log*/ const timestamp = new Date().toLocaleString(); setLogs([...logs, { id: Date.now(), name, action, timestamp }]); }; + const downloadLogs = () => { + const logText = logs + .map((log) => `${log.timestamp} - ${log.name} - ${log.action}`) + .join("\n"); + const blob = new Blob([logText], { type: "text/plain;charset=utf-8" }); + const link = document.createElement("a"); + link.href = URL.createObjectURL(blob); + link.download = "logs.txt"; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + }; + return (

- User Management + Gestion des utilisateurs

-

Manage users from this panel.

+

Gérez les utilisateurs à partir de ce panneau.

{/* Formulaire d'ajout d'utilisateur */}
+
); } -export default User; \ No newline at end of file +export default User;