Plugin-System; Neuigkeiten und Termine als mitgelieferte Plugins
- Plugins nach WordPress-Prinzip: plugin.json-Manifest mit Versions- und Abhängigkeitsprüfung, eigenes PSR-4-Autoloading, register()/boot(), activate()/deactivate()/uninstall(), Migrationen, Routen und Views je Plugin - plugins-core/ (mitgeliefert, aktiv bis zur Deaktivierung) und plugins/ (Kunden-Plugins, geschützt vor Updates, inaktiv bis zur Aktivierung) - Zustand in storage/app/plugins.json – Laden ohne Datenbankabfrage - Wiederherstellungsmodus: Ausnahmen und Fatal Errors beim Laden deaktivieren das Plugin, das Portal bleibt erreichbar - Hooks (Actions/Filter mit Prioritäten) und Registries für Navigation, Startseiten-Kacheln, Rechte und Admin-Seiten (Filament-Discovery) - Admin-Seite „Plugins“: aktivieren, deaktivieren, per ZIP installieren (ZIP-Slip-Schutz), löschen mit oder ohne Daten; abschaltbar per INHAUS_DISALLOW_FILE_MODS - Startseite komplett aus Kacheln; Plugin-Seiten als „slug::Seite“ - Version 0.3.0 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
cc0020458f
commit
28ef1e4a20
155 changed files with 2762 additions and 573 deletions
82
resources/views/filament/pages/plugins.blade.php
Normal file
82
resources/views/filament/pages/plugins.blade.php
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
<x-filament-panels::page>
|
||||
<style>
|
||||
.ih-plugins { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); }
|
||||
.ih-plugin { display: flex; flex-direction: column; gap: .75rem; height: 100%; }
|
||||
.ih-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
|
||||
.ih-name { font-weight: 600; }
|
||||
.ih-meta { font-size: .8125rem; color: rgb(107 114 128); }
|
||||
.ih-desc { font-size: .875rem; flex: 1; }
|
||||
.ih-problem { font-size: .8125rem; color: rgb(185 28 28); }
|
||||
.ih-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
|
||||
.ih-hint { font-size: .875rem; color: rgb(107 114 128); }
|
||||
.ih-error { font-size: .8125rem; color: rgb(220 38 38); margin-top: .5rem; }
|
||||
.dark .ih-meta, .dark .ih-hint { color: rgb(156 163 175); }
|
||||
.dark .ih-problem { color: rgb(248 113 113); }
|
||||
</style>
|
||||
|
||||
<div class="ih-plugins">
|
||||
@foreach ($plugins as $plugin)
|
||||
@php($m = $plugin['manifest'])
|
||||
<x-filament::section>
|
||||
<div class="ih-plugin">
|
||||
<div class="ih-head">
|
||||
<div>
|
||||
<div class="ih-name">{{ $m->name }}</div>
|
||||
<div class="ih-meta">Version {{ $m->version }}@if ($m->author) · {{ $m->author }}@endif</div>
|
||||
</div>
|
||||
<div style="display: flex; gap: .375rem; flex-wrap: wrap; justify-content: flex-end">
|
||||
@if ($m->core)
|
||||
<x-filament::badge color="gray">mitgeliefert</x-filament::badge>
|
||||
@endif
|
||||
<x-filament::badge :color="$plugin['enabled'] ? 'success' : 'gray'">{{ $plugin['enabled'] ? 'aktiv' : 'inaktiv' }}</x-filament::badge>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ih-desc">{{ $m->description }}</div>
|
||||
|
||||
@if ($plugin['problem'])
|
||||
<div class="ih-problem">{{ $plugin['problem'] }}</div>
|
||||
@endif
|
||||
|
||||
<div class="ih-actions">
|
||||
@if ($plugin['enabled'])
|
||||
<x-filament::button size="sm" color="gray" wire:click="deactivate('{{ $m->slug }}')" :disabled="$plugin['dependents'] !== []"
|
||||
wire:confirm="„{{ $m->name }}“ deaktivieren? Menüpunkte, Seiten und Kacheln verschwinden, die Daten bleiben erhalten.">
|
||||
Deaktivieren
|
||||
</x-filament::button>
|
||||
@if ($plugin['dependents'])
|
||||
<span class="ih-meta">benötigt von {{ implode(', ', $plugin['dependents']) }}</span>
|
||||
@endif
|
||||
@else
|
||||
<x-filament::button size="sm" wire:click="activate('{{ $m->slug }}')">Aktivieren</x-filament::button>
|
||||
@endif
|
||||
|
||||
@if (! $m->core && $uploadsAllowed)
|
||||
<x-filament::button size="sm" color="danger" outlined wire:click="delete('{{ $m->slug }}', false)"
|
||||
wire:confirm="„{{ $m->name }}“ löschen? Die Daten des Plugins bleiben in der Datenbank.">
|
||||
Löschen
|
||||
</x-filament::button>
|
||||
<x-filament::button size="sm" color="danger" outlined 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::button>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</x-filament::section>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<x-filament::section heading="Plugin installieren" description="ZIP-Archiv eines Plugins hochladen. Ein vorhandenes Plugin mit demselben Kürzel wird aktualisiert, seine Daten bleiben erhalten.">
|
||||
@if ($uploadsAllowed)
|
||||
<x-filament::callout color="warning" icon="heroicon-o-shield-exclamation" description="Plugins laufen mit vollen Rechten und haben Zugriff auf alle Daten des Portals. Installieren Sie nur Plugins aus vertrauenswürdiger Quelle." />
|
||||
<form wire:submit="upload" style="margin-top: 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem">
|
||||
<input type="file" wire:model="archive" accept=".zip,application/zip" />
|
||||
<x-filament::button type="submit" icon="heroicon-o-arrow-up-tray" wire:loading.attr="disabled" wire:target="archive,upload">Hochladen und installieren</x-filament::button>
|
||||
</form>
|
||||
@error('archive') <div class="ih-error">{{ $message }}</div> @enderror
|
||||
@else
|
||||
<p class="ih-hint">Das Installieren von Plugins ist in dieser Installation abgeschaltet (INHAUS_DISALLOW_FILE_MODS).</p>
|
||||
@endif
|
||||
</x-filament::section>
|
||||
</x-filament-panels::page>
|
||||
Loading…
Add table
Add a link
Reference in a new issue