cacheService = app('admin.cache'); $this->adminService = app('admin.service'); } /** * 缓存管理首页 * * @param Content $content * @return Content */ public function index(Content $content): Content { return $content ->title($this->title) ->description('缓存状态管理') ->body($this->buildCacheManagement()); } /** * 构建缓存管理界面 * * @return Tab */ protected function buildCacheManagement(): Tab { $tab = new Tab(); // 缓存状态标签页 $tab->add('缓存状态', $this->buildCacheStatusCard()); // 缓存操作标签页 $tab->add('缓存操作', $this->buildCacheActionsCard()); // 缓存统计标签页 $tab->add('缓存统计', $this->buildCacheStatisticsCard()); return $tab; } /** * 构建缓存状态卡片 * * @return Card */ protected function buildCacheStatusCard(): Card { $status = $this->cacheService->getStatus(); $html = '
{$typeStatus['description']}
"; if (isset($typeStatus['ttl'])) { $html .= "TTL: {$typeStatus['ttl']}秒| 缓存驱动 | ' . ($statistics['driver'] ?? 'Unknown') . ' |
|---|---|
| 缓存类型总数 | ' . ($statistics['total_types'] ?? 0) . ' |
| 关键缓存类型 | ' . ($statistics['critical_types'] ?? 0) . ' |
| 安全清理类型 | ' . ($statistics['safe_to_clear'] ?? 0) . ' |