feat: 插件/主题管理卡片改用 Filament 原生组件+中文页面标题;注入点分三组管理(页面/侧边栏/文章);前台 sablog 主题全面语义化(header/nav/main/aside/section/footer)
This commit is contained in:
@@ -2,35 +2,33 @@
|
||||
<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 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">
|
||||
<x-filament::section :compact="true">
|
||||
<div class="flex flex-col">
|
||||
<div class="flex items-start justify-between gap-3">
|
||||
<x-filament::icon icon="heroicon-o-puzzle-piece" class="h-8 w-8 text-primary-600" />
|
||||
@if($plugin['enabled'])
|
||||
<x-filament::badge color="success">已启用</x-filament::badge>
|
||||
@else
|
||||
<x-filament::badge color="gray">已停用</x-filament::badge>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
<h3 class="mt-3 text-base 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-2 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
|
||||
<x-filament::button size="sm" color="success" wire:click="enablePlugin('{{ $plugin['key'] }}')">启用</x-filament::button>
|
||||
@endif
|
||||
@if(! in_array($plugin['key'], config('plugins.enabled', []), true))
|
||||
<x-filament::button size="sm" color="danger" wire:click="uninstallPlugin('{{ $plugin['key'] }}')" wire:confirm="确定卸载该插件?">卸载</x-filament::button>
|
||||
@endif
|
||||
<div class="mt-4 flex flex-wrap gap-2">
|
||||
@if($plugin['enabled'])
|
||||
<x-filament::button size="sm" color="gray" wire:click="disablePlugin('{{ $plugin['key'] }}')">停用</x-filament::button>
|
||||
@else
|
||||
<x-filament::button size="sm" color="success" wire:click="enablePlugin('{{ $plugin['key'] }}')">启用</x-filament::button>
|
||||
@endif
|
||||
@if(! in_array($plugin['key'], config('plugins.enabled', []), true))
|
||||
<x-filament::button size="sm" color="danger" wire:click="uninstallPlugin('{{ $plugin['key'] }}')" wire:confirm="确定卸载该插件?">卸载</x-filament::button>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</x-filament::section>
|
||||
@empty
|
||||
<p class="text-sm text-gray-500">暂无插件</p>
|
||||
@endforelse
|
||||
@@ -55,17 +53,17 @@
|
||||
</div>
|
||||
<div class="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
@forelse($marketItems as $index => $item)
|
||||
<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" />
|
||||
<x-filament::section :compact="true">
|
||||
<div class="flex flex-col">
|
||||
<x-filament::icon icon="heroicon-o-cloud-arrow-down" class="h-8 w-8 text-primary-600" />
|
||||
<h3 class="mt-3 text-base 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-2 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>
|
||||
</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>
|
||||
</div>
|
||||
</x-filament::section>
|
||||
@empty
|
||||
<p class="text-sm text-gray-500">点击「刷新市场」拉取可用插件/主题</p>
|
||||
@endforelse
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
<x-filament::section heading="主题列表">
|
||||
<div class="grid gap-5 sm:grid-cols-2 lg:grid-cols-3">
|
||||
@forelse($this->themes as $theme)
|
||||
<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">
|
||||
<x-filament::section :compact="true" class="!p-0">
|
||||
<div class="flex flex-col">
|
||||
{{-- 主题预览图 --}}
|
||||
<div class="relative aspect-[4/3] overflow-hidden bg-gray-100 dark:bg-white/5">
|
||||
<div class="relative aspect-[4/3] overflow-hidden rounded-t-lg bg-gray-100 dark:bg-white/5">
|
||||
@if($theme['screenshot'])
|
||||
<img src="{{ theme('asset', $theme['screenshot'], $theme['name']) }}"
|
||||
alt="{{ $theme['title'] }} 预览"
|
||||
@@ -44,7 +45,8 @@
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</x-filament::section>
|
||||
@empty
|
||||
<p class="text-sm text-gray-500">暂无主题</p>
|
||||
@endforelse
|
||||
|
||||
Reference in New Issue
Block a user