refactor: kb & station & terminal

This commit is contained in:
2026-03-23 20:17:17 +08:00
parent 63ea2686e1
commit b74ba1a3f8
81 changed files with 1016 additions and 2492 deletions

View File

@@ -2,8 +2,8 @@
namespace App\Filament\Widgets;
use App\Models\Station;
use App\Models\Terminal;
use App\Models\TerminalPrompt;
use Filament\Widgets\StatsOverviewWidget as BaseWidget;
use Filament\Widgets\StatsOverviewWidget\Stat;
@@ -14,23 +14,20 @@ class TerminalStatsWidget extends BaseWidget
protected function getStats(): array
{
// 统计终端数据
$totalStations = Station::count();
$totalTerminals = Terminal::count();
$onlineTerminals = Terminal::where('is_online', true)->count();
// 统计提示词
$totalPrompts = TerminalPrompt::count();
return [
Stat::make('线站数量', $totalStations)
->description('线站')
->descriptionIcon('heroicon-m-building-office')
->color('info'),
Stat::make('终端总数', $totalTerminals)
->description("{$onlineTerminals} 个在线")
->descriptionIcon('heroicon-m-computer-desktop')
->color('primary')
->url(route('filament.admin.resources.terminals.index')),
Stat::make('提示词配置', $totalPrompts)
->description('终端提示词总数')
->descriptionIcon('heroicon-m-chat-bubble-left-right')
->color('success'),
->color('primary'),
];
}
}