refactor: remove syncing
This commit is contained in:
@@ -5,7 +5,6 @@ namespace App\Filament\Widgets;
|
||||
use App\Models\Terminal;
|
||||
use App\Models\TerminalKnowledgeBase;
|
||||
use App\Models\TerminalPrompt;
|
||||
use App\Models\TerminalSyncLog;
|
||||
use Filament\Widgets\StatsOverviewWidget as BaseWidget;
|
||||
use Filament\Widgets\StatsOverviewWidget\Stat;
|
||||
|
||||
@@ -25,15 +24,6 @@ class TerminalStatsWidget extends BaseWidget
|
||||
// 统计提示词
|
||||
$totalPrompts = TerminalPrompt::count();
|
||||
|
||||
// 统计最近同步
|
||||
$recentSyncs = TerminalSyncLog::where('created_at', '>=', now()->subDay())
|
||||
->where('status', 'success')
|
||||
->count();
|
||||
|
||||
$failedSyncs = TerminalSyncLog::where('created_at', '>=', now()->subDay())
|
||||
->where('status', 'failed')
|
||||
->count();
|
||||
|
||||
return [
|
||||
Stat::make('终端总数', $totalTerminals)
|
||||
->description("{$onlineTerminals} 个在线")
|
||||
@@ -50,16 +40,6 @@ class TerminalStatsWidget extends BaseWidget
|
||||
->description('终端提示词总数')
|
||||
->descriptionIcon('heroicon-m-chat-bubble-left-right')
|
||||
->color('success'),
|
||||
|
||||
Stat::make('今日同步成功', $recentSyncs)
|
||||
->description('最近24小时')
|
||||
->descriptionIcon('heroicon-m-arrow-path')
|
||||
->color('success'),
|
||||
|
||||
Stat::make('今日同步失败', $failedSyncs)
|
||||
->description($failedSyncs > 0 ? '需要检查' : '运行正常')
|
||||
->descriptionIcon($failedSyncs > 0 ? 'heroicon-m-exclamation-triangle' : 'heroicon-m-check-circle')
|
||||
->color($failedSyncs > 0 ? 'danger' : 'success'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user