feat: 后台全中文(Filament zh_CN 语言包+资源中文label)+ 插件独立导航分组 + 插件/主题管理卡片化 + 主题预览图(无头浏览器生成)+ 两套主题移动端适配

This commit is contained in:
ak
2026-08-11 21:18:18 +08:00
parent d0ae0f60ad
commit 6c7562115f
332 changed files with 5455 additions and 39 deletions
@@ -1,22 +1,26 @@
<x-filament-panels::page>
<x-filament::section heading="插件列表">
<div class="space-y-4">
<x-filament::section heading="已安装插件">
<div class="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
@forelse($this->plugins as $plugin)
<div class="flex items-center justify-between gap-4 rounded-xl border border-gray-200 p-4 dark:border-white/10">
<div>
<div class="flex items-center gap-2">
<span class="font-semibold">{{ $plugin['title'] }}</span>
<span class="text-xs text-gray-500">{{ $plugin['version'] }}</span>
<div class="flex flex-col rounded-xl border border-gray-200 bg-white p-5 shadow-sm dark:border-white/10 dark:bg-white/5">
<div class="flex items-start justify-between gap-3">
<div class="flex h-11 w-11 shrink-0 items-center justify-center rounded-lg bg-primary-50 text-primary-600 dark:bg-primary-500/10">
<x-filament::icon icon="heroicon-o-puzzle-piece" class="h-6 w-6" />
</div>
<div class="text-right">
@if($plugin['enabled'])
<x-filament::badge color="success">已启用</x-filament::badge>
@else
<x-filament::badge color="gray">已停用</x-filament::badge>
@endif
</div>
<p class="mt-1 text-sm text-gray-500">{{ $plugin['description'] }}</p>
<p class="mt-0.5 text-xs text-gray-400">{{ $plugin['vendor'] }}.{{ $plugin['name'] }}</p>
</div>
<div class="flex shrink-0 gap-2">
<h3 class="mt-3 font-semibold">{{ $plugin['title'] }}</h3>
<p class="mt-1 flex-1 text-sm text-gray-500 dark:text-gray-400">{{ $plugin['description'] }}</p>
<p class="mt-1 text-xs text-gray-400">v{{ $plugin['version'] }} · {{ $plugin['vendor'] }}.{{ $plugin['name'] }}</p>
<div class="mt-4 flex gap-2">
@if($plugin['enabled'])
<x-filament::button size="sm" color="gray" wire:click="disablePlugin('{{ $plugin['key'] }}')">停用</x-filament::button>
@else
@@ -46,17 +50,21 @@
</x-filament::section>
<x-filament::section heading="插件市场" :description="config('market.url') ?: '未配置远程市场(config/market.php 的 MARKET_URL),仅支持本地 ZIP 安装'">
<div class="space-y-3">
<div class="mb-4">
<x-filament::button color="gray" wire:click="loadMarket">刷新市场</x-filament::button>
</div>
<div class="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
@forelse($marketItems as $index => $item)
<div class="flex items-center justify-between gap-4 rounded-xl border border-gray-200 p-4 dark:border-white/10">
<div>
<div class="font-semibold">{{ $item['title'] ?? $item['name'] }}</div>
<p class="text-sm text-gray-500">{{ $item['description'] ?? '' }}</p>
<p class="text-xs text-gray-400">{{ $item['version'] ?? '' }} · {{ $item['author'] ?? '' }}</p>
<div class="flex flex-col rounded-xl border border-gray-200 bg-white p-5 shadow-sm dark:border-white/10 dark:bg-white/5">
<div class="flex h-11 w-11 items-center justify-center rounded-lg bg-primary-50 text-primary-600 dark:bg-primary-500/10">
<x-filament::icon icon="heroicon-o-cloud-arrow-down" class="h-6 w-6" />
</div>
<h3 class="mt-3 font-semibold">{{ $item['title'] ?? $item['name'] }}</h3>
<p class="mt-1 flex-1 text-sm text-gray-500 dark:text-gray-400">{{ $item['description'] ?? '' }}</p>
<p class="mt-1 text-xs text-gray-400">{{ $item['version'] ?? '' }} · {{ $item['author'] ?? '' }}</p>
<div class="mt-4">
<x-filament::button size="sm" color="primary" wire:click="installFromMarket({{ $index }})">安装</x-filament::button>
</div>
<x-filament::button size="sm" color="primary" wire:click="installFromMarket({{ $index }})">安装</x-filament::button>
</div>
@empty
<p class="text-sm text-gray-500">点击「刷新市场」拉取可用插件/主题</p>
+32 -13
View File
@@ -1,21 +1,40 @@
<x-filament-panels::page>
<x-filament::section heading="主题列表">
<div class="grid gap-4 sm:grid-cols-2">
<div class="grid gap-5 sm:grid-cols-2 lg:grid-cols-3">
@forelse($this->themes as $theme)
<div class="rounded-xl border border-gray-200 p-5 dark:border-white/10">
<div class="flex items-center justify-between">
<span class="font-semibold text-lg">{{ $theme['title'] }}</span>
<span class="text-xs text-gray-500">v{{ $theme['version'] }}</span>
</div>
<p class="mt-1 text-sm text-gray-500">{{ $theme['description'] }}</p>
<p class="mt-0.5 text-xs text-gray-400">{{ $theme['author'] }}</p>
<div class="mt-3 flex gap-2">
@if($theme['active'])
<x-filament::badge color="success">当前使用</x-filament::badge>
<div class="flex flex-col overflow-hidden rounded-xl border border-gray-200 bg-white shadow-sm dark:border-white/10 dark:bg-white/5">
{{-- 主题预览图 --}}
<div class="relative aspect-[4/3] overflow-hidden bg-gray-100 dark:bg-white/5">
@if($theme['screenshot'])
<img src="{{ theme('asset', $theme['screenshot'], $theme['name']) }}"
alt="{{ $theme['title'] }} 预览"
class="h-full w-full object-cover object-top transition-transform duration-300 hover:scale-105">
@else
<x-filament::button size="sm" color="primary" wire:click="activateTheme('{{ $theme['name'] }}')">启用</x-filament::button>
<x-filament::button size="sm" color="danger" wire:click="uninstallTheme('{{ $theme['name'] }}')" wire:confirm="确定删除该主题?">删除</x-filament::button>
<div class="flex h-full items-center justify-center text-gray-400">
<x-filament::icon icon="heroicon-o-photo" class="h-10 w-10" />
</div>
@endif
@if($theme['active'])
<div class="absolute left-3 top-3">
<x-filament::badge color="success">使用中</x-filament::badge>
</div>
@endif
</div>
<div class="flex flex-1 flex-col p-5">
<div class="flex items-center justify-between">
<h3 class="font-semibold">{{ $theme['title'] }}</h3>
<span class="text-xs text-gray-400">v{{ $theme['version'] }}</span>
</div>
<p class="mt-1 flex-1 text-sm text-gray-500 dark:text-gray-400">{{ $theme['description'] }}</p>
<p class="mt-1 text-xs text-gray-400">{{ $theme['author'] }}</p>
<div class="mt-4 flex gap-2">
@if(! $theme['active'])
<x-filament::button size="sm" color="primary" wire:click="activateTheme('{{ $theme['name'] }}')">启用</x-filament::button>
<x-filament::button size="sm" color="danger" wire:click="uninstallTheme('{{ $theme['name'] }}')" wire:confirm="确定删除该主题?">删除</x-filament::button>
@endif
</div>
</div>
</div>
@empty