Loheide-eu-mitarbeiterplatt.../resources/views/filament/pages/plugins.blade.php
Friederich Loheide 64d9e0bbed
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m47s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 3m50s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 4m4s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 4m13s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 5m43s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 5m44s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 4m55s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m14s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 5m1s
Plugin-Updates über update_url (0.24.0)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-27 08:06:22 +00:00

160 lines
12 KiB
PHP
Raw 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>
@if ($key === 'custom' && $hasUpdateUrls && $uploadsAllowed)
<div class="mt-2 flex flex-wrap items-center gap-3">
<x-filament::button size="xs" color="gray" icon="heroicon-o-arrow-path" wire:click="checkUpdates" wire:loading.attr="disabled">Nach Updates suchen</x-filament::button>
<span class="text-xs text-gray-500">
@if ($updatesCheckedAt)
Zuletzt geprüft {{ \Illuminate\Support\Carbon::parse($updatesCheckedAt)->diffForHumans() }} · täglich automatisch
@else
Noch nicht geprüft · täglich automatisch
@endif
</span>
</div>
@endif
</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>
@php($update = $updates[$m->slug] ?? null)
@if ($update && ($update['available'] || isset($update['error'])))
<div class="mt-1.5 flex flex-wrap items-center gap-2 text-xs">
@if ($update['available'])
<span class="rounded-md bg-primary-50 px-2 py-0.5 font-medium text-primary-700 dark:bg-primary-500/10 dark:text-primary-400">Update auf {{ $update['version'] }} verfügbar</span>
@if (! $update['compatible'])
<span class="text-warning-700 dark:text-warning-400">benötigt Inhaus {{ $update['requires_core'] }}</span>
@elseif ($uploadsAllowed)
<x-filament::link tag="button" size="xs" icon="heroicon-o-arrow-down-tray" wire:click="updatePlugin('{{ $m->slug }}')" wire:confirm="„{{ $m->name }}“ auf {{ $update['version'] }} aktualisieren? Einstellungen und Daten bleiben erhalten.">Jetzt aktualisieren</x-filament::link>
@endif
@if (! empty($update['changelog']))
<details class="basis-full text-gray-500"><summary class="cursor-pointer">Was ist neu?</summary><p class="mt-1 whitespace-pre-line">{{ $update['changelog'] }}</p></details>
@endif
@else
<span class="text-gray-500" title="{{ $update['error'] }}">Update-Prüfung fehlgeschlagen: {{ \Illuminate\Support\Str::limit($update['error'], 90) }}</span>
@endif
</div>
@endif
@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>