Loheide-eu-mitarbeiterplatt.../resources/views/filament/pages/plugins.blade.php
Friederich Loheide c495dfa1cb
Some checks failed
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 3m29s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m31s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 3m56s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 4m2s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 5m20s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 5m22s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 4m42s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 4m41s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m18s
Backend: eigenes kompaktes Theme, Übersicht, Cluster mit Unterseiten, Plugin-Liste
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 20:50:17 +00:00

130 lines
9.7 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<x-filament-panels::page>
@php
$groups = [
'core' => ['Mitgeliefert', 'Teil von Inhaus – werden mit jeder Aktualisierung mitgeliefert.', $plugins->filter(fn ($p) => $p['manifest']->core)],
'custom' => ['Zusätzlich installiert', 'Eigene oder von Dritten bereitgestellte Plugins. Aktualisierungen von Inhaus lassen sie unverändert.', $plugins->reject(fn ($p) => $p['manifest']->core)],
];
@endphp
<div class="grid gap-8">
@foreach ($groups as $key => [$title, $hint, $items])
<section class="grid gap-3">
<header>
<h2 class="text-base font-semibold text-gray-950 dark:text-white">
{{ $title }}
<span class="ms-1 text-sm font-normal text-gray-500">{{ $items->where('enabled', true)->count() }} von {{ $items->count() }} aktiv</span>
</h2>
<p class="text-[13px] text-gray-500 dark:text-gray-400">{{ $hint }}</p>
</header>
<div class="overflow-hidden rounded-xl bg-white shadow-xs ring-1 ring-gray-950/5 dark:bg-gray-900 dark:ring-white/10">
@forelse ($items as $plugin)
@php($m = $plugin['manifest'])
<div @class([
'flex flex-wrap items-center gap-x-4 gap-y-2 px-4 py-3 sm:flex-nowrap',
'border-t border-gray-950/5 dark:border-white/10' => ! $loop->first,
])>
<div @class([
'grid size-9 shrink-0 place-items-center rounded-lg text-sm font-semibold',
'bg-primary-50 text-primary-700 dark:bg-primary-500/10 dark:text-primary-400' => $plugin['enabled'],
'bg-gray-100 text-gray-400 dark:bg-white/5' => ! $plugin['enabled'],
])>{{ mb_strtoupper(mb_substr($m->name, 0, 1)) }}</div>
<div class="min-w-0 flex-1">
<div class="flex flex-wrap items-baseline gap-x-2">
<span class="text-sm font-semibold text-gray-950 dark:text-white">{{ $m->name }}</span>
<span class="text-xs text-gray-500">{{ $m->version }}@if (! $m->core && $m->author) · {{ $m->author }}@endif</span>
</div>
<p class="line-clamp-1 text-[13px] text-gray-500 dark:text-gray-400" title="{{ $m->description }}">{{ $m->description }}</p>
@if ($plugin['problem'] || $plugin['excluded'] || ($plugin['dependents'] && $plugin['enabled']))
<div class="mt-1 flex flex-wrap gap-x-3 gap-y-1 text-xs">
@if ($plugin['problem'])
<span class="text-danger-600 dark:text-danger-400">{{ $plugin['problem'] }}</span>
@endif
@if ($plugin['excluded'])
<span class="text-warning-700 dark:text-warning-400">Ausgeschlossen: {{ implode(', ', $plugin['excluded']) }}</span>
@endif
@if ($plugin['dependents'] && $plugin['enabled'])
<span class="text-gray-500">benötigt von {{ implode(', ', $plugin['dependents']) }}</span>
@endif
</div>
@endif
</div>
<div class="flex shrink-0 items-center gap-2">
@if ($plugin['accessible'] && $plugin['enabled'])
{{ ($this->accessAction)(['slug' => $m->slug]) }}
@endif
@if (! $m->core && $uploadsAllowed)
<x-filament::dropdown placement="bottom-end">
<x-slot name="trigger">
<x-filament::icon-button icon="heroicon-o-ellipsis-vertical" color="gray" label="Weitere Aktionen" />
</x-slot>
<x-filament::dropdown.list>
<x-filament::dropdown.list.item icon="heroicon-o-trash" color="danger" wire:click="delete('{{ $m->slug }}', false)"
wire:confirm="„{{ $m->name }}“ löschen? Die Daten des Plugins bleiben in der Datenbank.">
Löschen
</x-filament::dropdown.list.item>
<x-filament::dropdown.list.item icon="heroicon-o-trash" color="danger" wire:click="delete('{{ $m->slug }}', true)"
wire:confirm="„{{ $m->name }}“ samt ALLEN Daten löschen? Das lässt sich nicht rückgängig machen.">
Mit Daten löschen
</x-filament::dropdown.list.item>
</x-filament::dropdown.list>
</x-filament::dropdown>
@endif
{{-- Schalter aktiv/inaktiv --}}
<button
type="button"
role="switch"
aria-checked="{{ $plugin['enabled'] ? 'true' : 'false' }}"
aria-label="{{ $m->name }} {{ $plugin['enabled'] ? 'deaktivieren' : 'aktivieren' }}"
title="{{ $plugin['enabled'] ? 'Aktiv – zum Deaktivieren klicken' : 'Inaktiv – zum Aktivieren klicken' }}"
@disabled($plugin['enabled'] && $plugin['dependents'])
@if ($plugin['enabled'])
wire:click="deactivate('{{ $m->slug }}')"
wire:confirm="„{{ $m->name }}“ deaktivieren? Menüpunkte, Seiten und Kacheln verschwinden, die Daten bleiben erhalten."
@else
wire:click="activate('{{ $m->slug }}')"
@endif
wire:loading.attr="disabled"
@class([
'relative inline-flex h-6 w-11 shrink-0 cursor-pointer rounded-full transition-colors duration-200 focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50',
'bg-primary-600' => $plugin['enabled'],
'bg-gray-200 dark:bg-white/15' => ! $plugin['enabled'],
])
>
<span @class([
'pointer-events-none mt-0.5 inline-block size-5 rounded-full bg-white shadow-sm transition-transform duration-200',
'translate-x-5.5' => $plugin['enabled'],
'translate-x-0.5' => ! $plugin['enabled'],
])></span>
</button>
</div>
</div>
@empty
<p class="px-4 py-6 text-center text-sm text-gray-500">Noch keine zusätzlichen Plugins installiert.</p>
@endforelse
</div>
@if ($key === 'custom')
@if ($uploadsAllowed)
<form wire:submit="installArchive" class="flex flex-wrap items-center gap-3 rounded-xl border border-dashed border-gray-300 px-4 py-3 dark:border-white/15">
<x-filament::icon icon="heroicon-o-arrow-up-tray" class="size-5 text-gray-400" />
<div class="min-w-0 flex-1">
<p class="text-sm font-medium text-gray-950 dark:text-white">Plugin installieren</p>
<p class="text-xs text-gray-500">ZIP-Archiv hochladen. Ein vorhandenes Plugin mit demselben Kürzel wird aktualisiert, seine Daten bleiben erhalten. Plugins laufen mit vollen Rechten – nur aus vertrauenswürdiger Quelle installieren.</p>
</div>
<input type="file" wire:model="archive" accept=".zip,application/zip" class="text-sm file:me-3 file:rounded-md file:border-0 file:bg-gray-100 file:px-3 file:py-1.5 file:text-sm file:font-medium dark:file:bg-white/10" />
<x-filament::button type="submit" size="sm" icon="heroicon-o-arrow-up-tray" wire:loading.attr="disabled" wire:target="archive,installArchive">Hochladen und installieren</x-filament::button>
@error('archive') <p class="w-full text-[13px] text-danger-600">{{ $message }}</p> @enderror
</form>
@else
<p class="text-[13px] text-gray-500">Das Installieren von Plugins ist in dieser Installation abgeschaltet (INHAUS_DISALLOW_FILE_MODS).</p>
@endif
@endif
</section>
@endforeach
</div>
</x-filament-panels::page>