- topbar: Livewire LegacySyncButton next to 写文章 (moved from user menu) - view modes: add 图文(card) grid with cover fallback chain (cover → attachment → first content image → placeholder); list mode now title-only compact - archives: year/month/day index grid - page cache admin: size + expiry columns, total size, cache policy note - theme inject: stylevars switch from KeyValue to Repeater with multi-line HTML editing - import: html_entity_decode for category/post-title/link/keywords/comment author
73 lines
4.1 KiB
PHP
73 lines
4.1 KiB
PHP
<x-filament-panels::page>
|
|
<div class="grid gap-4 md:grid-cols-4">
|
|
<x-filament::section>
|
|
<div class="text-sm text-gray-500 dark:text-gray-400">当前缓存页</div>
|
|
<div class="mt-1 text-2xl font-semibold">{{ $this->stats['count'] }} 条</div>
|
|
</x-filament::section>
|
|
<x-filament::section>
|
|
<div class="text-sm text-gray-500 dark:text-gray-400">命中率</div>
|
|
<div class="mt-1 text-2xl font-semibold">{{ $this->stats['rate'] }}%</div>
|
|
</x-filament::section>
|
|
<x-filament::section>
|
|
<div class="text-sm text-gray-500 dark:text-gray-400">命中 / 未命中</div>
|
|
<div class="mt-1 text-2xl font-semibold">{{ $this->stats['hits'] }} / {{ $this->stats['misses'] }}</div>
|
|
</x-filament::section>
|
|
<x-filament::section>
|
|
<div class="text-sm text-gray-500 dark:text-gray-400">过期时间</div>
|
|
<div class="mt-1 text-2xl font-semibold">{{ $this->stats['ttl'] }} 秒</div>
|
|
</x-filament::section>
|
|
</div>
|
|
|
|
<x-filament::section heading="已缓存的前台页面" class="mt-6">
|
|
<p class="mb-4 text-sm text-gray-500 dark:text-gray-400">
|
|
只缓存未登录访客打开的页面。登录后看前台不会进缓存,所以这里可能暂时是空的。
|
|
</p>
|
|
|
|
@if(count($this->entries) === 0)
|
|
<p class="text-sm text-gray-500 dark:text-gray-400">当前没有前台页面缓存。</p>
|
|
@else
|
|
<div class="overflow-x-auto">
|
|
<table class="w-full text-sm">
|
|
<thead>
|
|
<tr class="border-b border-gray-200 text-left dark:border-white/10">
|
|
<th class="py-2 pr-4 font-medium">地址</th>
|
|
<th class="py-2 pr-4 font-medium">大小</th>
|
|
<th class="py-2 pr-4 font-medium">缓存时间</th>
|
|
<th class="py-2 pr-4 font-medium">过期时间</th>
|
|
<th class="py-2 font-medium">操作</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach($this->entries as $entry)
|
|
<tr class="border-b border-gray-100 dark:border-white/5" wire:key="cache-{{ $entry['key'] }}">
|
|
<td class="py-2 pr-4">
|
|
<a href="{{ $entry['url'] }}" target="_blank" rel="noopener noreferrer" class="text-primary-600 hover:underline">
|
|
{{ $entry['url'] }}
|
|
</a>
|
|
</td>
|
|
<td class="py-2 pr-4 whitespace-nowrap">{{ $entry['size'] ? number_format($entry['size'] / 1024, 1).' KB' : '—' }}</td>
|
|
<td class="py-2 pr-4 whitespace-nowrap">{{ $entry['cached_at'] ?: '—' }}</td>
|
|
<td class="py-2 pr-4 whitespace-nowrap">{{ $entry['expires_at'] ?: '—' }}</td>
|
|
<td class="py-2">
|
|
<x-filament::button
|
|
size="xs"
|
|
color="danger"
|
|
wire:click="forgetEntry('{{ $entry['key'] }}')"
|
|
wire:confirm="删除这条缓存?"
|
|
>
|
|
删除
|
|
</x-filament::button>
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
<p class="mt-3 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>
|
|
</div>
|
|
@endif
|
|
</x-filament::section>
|
|
</x-filament-panels::page>
|