refactor: 统一分页组件和UI优化

- 使用公共Pagination组件统一各页面的分页逻辑
- 优化exceptions页面异常列表展示
- 简化settings/rules页面规则管理
- 后端tasks.py增加分页参数支持
This commit is contained in:
freedakgmail
2026-07-07 13:53:54 +08:00
parent b93929eb1a
commit feebbb10ac
6 changed files with 101 additions and 92 deletions
+3 -3
View File
@@ -79,11 +79,11 @@ export default function DashboardPage() {
// 并行获取统计数据和任务列表
const [statsRes, tasksRes] = await Promise.all([
api.get<TaskStats>(ENDPOINTS.TASK.STATS),
api.get<Task[]>(ENDPOINTS.TASK.LIST, { params: { limit: 5 } }),
api.get<{ items: Task[] }>(ENDPOINTS.TASK.LIST, { params: { page: 1, page_size: 5 } }),
]);
setStats(statsRes.data);
setRecentTasks(tasksRes.data);
setRecentTasks(tasksRes.data.items || []);
} catch (error) {
console.error("加载数据失败:", error);
} finally {
@@ -101,7 +101,7 @@ export default function DashboardPage() {
};
return (
<div className="min-h-full p-6 lg:p-8 max-w-7xl mx-auto">
<div className="min-h-full p-6 lg:p-8 max-w-7xl mx-auto space-y-6">
{/* Header */}
<motion.div
initial={{ opacity: 0, y: -8 }}