完成性能日志和事务日志功能
Change-Id: Iec30043bc5b954a29fa0d8d18a84c1feed2a1696
diff --git a/Merge/front/src/components/LogsDashboard.js b/Merge/front/src/components/LogsDashboard.js
index 1bd6cb7..22047e2 100644
--- a/Merge/front/src/components/LogsDashboard.js
+++ b/Merge/front/src/components/LogsDashboard.js
@@ -1,4 +1,5 @@
import React, { useEffect, useState } from 'react';
+import { NavLink, Outlet } from 'react-router-dom';
import '../style/Admin.css';
function LogsDashboard() {
@@ -19,25 +20,17 @@
return (
<div className="admin-container">
<h2>运行日志 & 性能 Dashboard</h2>
- <section className="dashboard-stats">
- <pre>{JSON.stringify(stats, null, 2)}</pre>
- </section>
- <section className="dashboard-logs">
- <table className="admin-table">
- <thead>
- <tr><th>时间</th><th>级别</th><th>消息</th></tr>
- </thead>
- <tbody>
- {logs.map((log, i) => (
- <tr key={i}>
- <td>{new Date(log.time).toLocaleString()}</td>
- <td>{log.level}</td>
- <td>{log.message}</td>
- </tr>
- ))}
- </tbody>
- </table>
- </section>
+ <nav className="dashboard-nav">
+ <NavLink to="transactions" className={({ isActive }) => isActive ? 'active' : ''}>
+ 事务日志
+ </NavLink>
+ <NavLink to="performance" className={({ isActive }) => isActive ? 'active' : ''}>
+ 性能日志
+ </NavLink>
+ </nav>
+
+ {/* nested routes will render here */}
+ <Outlet />
</div>
);
}