feat: 自定义仪表板,添加知识库和终端统计组件

- 创建自定义 Dashboard 页面替换默认仪表板
- 新增 KnowledgeBaseStatsWidget 显示知识库统计信息
  - 文档总数、转换完成数、转换失败数、处理中数量
  - 知识库分组数量
  - 转换成功率计算
- 新增 TerminalStatsWidget 显示终端统计信息
  - 终端总数和激活状态
  - 知识库关联数、提示词配置数
  - 今日同步成功/失败统计
- 移除默认的 FilamentInfoWidget
- 统计卡片支持点击跳转到相关管理页面
This commit is contained in:
2026-03-12 16:24:03 +08:00
parent 578fc3be82
commit 6313181658
4 changed files with 152 additions and 2 deletions

View File

@@ -0,0 +1,25 @@
<?php
namespace App\Filament\Pages;
use Filament\Pages\Dashboard as BaseDashboard;
class Dashboard extends BaseDashboard
{
protected static ?string $navigationLabel = '仪表板';
protected static ?string $title = '仪表板';
public function getWidgets(): array
{
return [
\App\Filament\Widgets\KnowledgeBaseStatsWidget::class,
\App\Filament\Widgets\TerminalStatsWidget::class,
];
}
public function getColumns(): int | string | array
{
return 2;
}
}