Files
laralog/resources/views/filament/pages/page-cache.blade.php
T
gouki d041622531
Build and Deploy / verify (push) Successful in 10s
Build and Deploy / deploy (push) Successful in 17s
feat: post cover filter + admin AI cover action, restyle page-cache admin
- 抽 CoverGenerator 服务(covers:generate 与后台共用),内部强制同步产出 card 转换
- 文章列表:新增封面状态图标列、「有/无封面/完全无图」筛选、行内「生成封面」AI 操作
- 页面缓存:统计改为原生 StatsOverviewWidget(缓存页数/总大小/命中率/时长),
  缓存明细表重排(表头、悬停、URL 截断、图标删除按钮、空状态)
2026-10-14 23:48:57 +00:00

62 lines
4.4 KiB
PHP

<x-filament-panels::page>
<x-filament::section>
<x-slot name="heading">已缓存的前台页面</x-slot>
<x-slot name="description">只缓存未登录访客打开的页面;登录后访问前台不会进缓存,所以这里可能暂时是空的。</x-slot>
@if(count($this->entries) === 0)
<div class="flex flex-col items-center gap-3 py-10 text-gray-400 dark:text-gray-500">
<x-filament::icon icon="heroicon-o-inbox" class="h-10 w-10" />
<p class="text-sm">当前没有前台页面缓存</p>
</div>
@else
<div class="overflow-hidden rounded-xl ring-1 ring-gray-950/5 dark:ring-white/10">
<div class="overflow-x-auto">
<table class="w-full divide-y divide-gray-200 text-sm dark:divide-white/5">
<thead class="bg-gray-50 dark:bg-white/5">
<tr>
<th class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500 dark:text-gray-400">地址</th>
<th class="px-4 py-3 text-right text-xs font-medium uppercase tracking-wider text-gray-500 dark:text-gray-400">大小</th>
<th class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500 dark:text-gray-400">缓存时间</th>
<th class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500 dark:text-gray-400">过期时间</th>
<th class="px-4 py-3 text-right text-xs font-medium uppercase tracking-wider text-gray-500 dark:text-gray-400">操作</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-100 bg-white dark:divide-white/5 dark:bg-transparent">
@foreach($this->entries as $entry)
<tr class="transition hover:bg-gray-50 dark:hover:bg-white/5" wire:key="cache-{{ $entry['key'] }}">
<td class="max-w-0 px-4 py-3">
<a href="{{ $entry['url'] }}" target="_blank" rel="noopener noreferrer"
title="{{ $entry['url'] }}"
class="block w-64 truncate text-primary-600 hover:underline sm:w-80 lg:w-[32rem] dark:text-primary-400">
{{ $entry['url'] }}
</a>
</td>
<td class="whitespace-nowrap px-4 py-3 text-right tabular-nums text-gray-600 dark:text-gray-300">
{{ $entry['size'] ? number_format($entry['size'] / 1024, 1).' KB' : '—' }}
</td>
<td class="whitespace-nowrap px-4 py-3 text-gray-600 dark:text-gray-300">{{ $entry['cached_at'] ?: '—' }}</td>
<td class="whitespace-nowrap px-4 py-3 text-gray-600 dark:text-gray-300">{{ $entry['expires_at'] ?: '—' }}</td>
<td class="whitespace-nowrap px-4 py-3 text-right">
<x-filament::icon-button
icon="heroicon-m-trash"
color="danger"
size="sm"
label="删除这条缓存"
wire:click="forgetEntry('{{ $entry['key'] }}')"
wire:confirm="删除这条缓存?"
/>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<p class="mt-4 text-xs text-gray-500 dark:text-gray-400">
共 {{ count($this->entries) }} 条 · 合计 {{ number_format(collect($this->entries)->sum('size') / 1024 / 1024, 2) }} MB
· 只缓存未登录访客 GET 的 200 页面,评论提交等动态请求不缓存,浏览量统计不受影响。
</p>
@endif
</x-filament::section>
</x-filament-panels::page>