Compare commits
3 commits
a36752e09a
...
cc0020458f
| Author | SHA1 | Date | |
|---|---|---|---|
| cc0020458f | |||
| 029dbd243d | |||
| 43244d751a |
120 changed files with 5816 additions and 201 deletions
|
|
@ -67,8 +67,9 @@ jobs:
|
|||
- name: vendor/ entspricht composer.lock (ohne Dev-Pakete)
|
||||
run: |
|
||||
composer install --no-dev --optimize-autoloader --no-interaction --no-progress --no-scripts
|
||||
git status --porcelain vendor
|
||||
test -z "$(git status --porcelain vendor)"
|
||||
# installed.php enthält den Git-Commit des Projekts selbst und ändert sich daher immer.
|
||||
git status --porcelain -- vendor ':!vendor/composer/installed.php'
|
||||
test -z "$(git status --porcelain -- vendor ':!vendor/composer/installed.php')"
|
||||
- name: public/build/ entspricht dem Quellcode
|
||||
run: |
|
||||
npm ci --no-audit --no-fund
|
||||
|
|
|
|||
18
.htaccess
Normal file
18
.htaccess
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# Nur nötig, wenn der Hoster das Installationsverzeichnis selbst als Webroot
|
||||
# verwendet und sich dieser nicht auf „public/“ umstellen lässt:
|
||||
# Alle Anfragen werden intern nach public/ geleitet – .env, storage/, vendor/
|
||||
# usw. sind so von außen nicht erreichbar.
|
||||
# Diese Datei wird von Aktualisierungen nicht überschrieben (geschützter Pfad).
|
||||
|
||||
Options -Indexes
|
||||
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_URI} !/public/
|
||||
RewriteRule ^(.*)$ public/$1 [L]
|
||||
</IfModule>
|
||||
|
||||
<IfModule !mod_rewrite.c>
|
||||
# Ohne mod_rewrite lieber gar nichts ausliefern als Konfigurationsdateien.
|
||||
Require all denied
|
||||
</IfModule>
|
||||
|
|
@ -4,6 +4,14 @@ Neueste Version oben. Jeder Abschnitt beginnt mit `## MAJOR.MINOR.PATCH` und
|
|||
enthält kurze Stichpunkte für Anwenderinnen und Anwender – keine Commit-Texte.
|
||||
Der Self-Updater zeigt diese Abschnitte bei neuen Versionen an.
|
||||
|
||||
## 0.2.0
|
||||
|
||||
- Aktualisierung per Klick im Admin-Bereich – ohne Serverzugang, mit Wartungsseite und Fortschrittsanzeige
|
||||
- Lizenz hinterlegen und prüfen, Laufzeit und belegte Geräteplätze einsehen
|
||||
- Update-Kanäle „Stabil“ und „Entwicklung“
|
||||
- Datenbank wird nach einem Update automatisch auf den neuen Stand gebracht
|
||||
- Änderungsprotokoll im Admin-Bereich
|
||||
|
||||
## 0.1.0
|
||||
|
||||
- Erste Fassung des Mitarbeiterportals
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ Webhosting. Laravel 13, Filament 5 (Admin), Inertia + Vue 3 + Tailwind CSS +
|
|||
shadcn-vue im Portal, MySQL/MariaDB, Apache.
|
||||
|
||||
- Projektplan: [`docs/PLAN.md`](docs/PLAN.md)
|
||||
- Installation beim Kunden (auch Shared Hosting): [`docs/INSTALLATION.md`](docs/INSTALLATION.md)
|
||||
- Mitarbeit, Entwicklungsumgebung und Release-Ablauf: [`CONTRIBUTING.md`](CONTRIBUTING.md)
|
||||
- Änderungen: [`CHANGELOG.md`](CHANGELOG.md)
|
||||
|
||||
|
|
|
|||
137
app/Filament/Pages/Feedback.php
Normal file
137
app/Filament/Pages/Feedback.php
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
<?php
|
||||
|
||||
namespace App\Filament\Pages;
|
||||
|
||||
use App\Models\VendorFeedback;
|
||||
use App\Support\Audit;
|
||||
use App\Support\Feedback\FeedbackChannels;
|
||||
use App\Support\Feedback\FeedbackOutbox;
|
||||
use App\Support\Feedback\FeedbackResult;
|
||||
use App\Support\Feedback\TechnicalInfo;
|
||||
use App\Support\License\LicenseStore;
|
||||
use BackedEnum;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Pages\Page;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use UnitEnum;
|
||||
|
||||
/**
|
||||
* „Hilfe → Rückmeldung geben“: Fehlerbericht oder Funktionswunsch an den
|
||||
* Hersteller (docs/specs/feedback.md).
|
||||
*/
|
||||
class Feedback extends Page
|
||||
{
|
||||
protected string $view = 'filament.pages.feedback';
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedChatBubbleLeftEllipsis;
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'Hilfe';
|
||||
|
||||
protected static ?string $navigationLabel = 'Rückmeldung geben';
|
||||
|
||||
protected static ?string $title = 'Rückmeldung geben';
|
||||
|
||||
protected static ?string $slug = 'rueckmeldung';
|
||||
|
||||
public string $type = '';
|
||||
|
||||
public string $subject = '';
|
||||
|
||||
public string $body = '';
|
||||
|
||||
public string $severity = 'normal';
|
||||
|
||||
public string $email = '';
|
||||
|
||||
public string $name = '';
|
||||
|
||||
public ?string $lastReference = null;
|
||||
|
||||
public ?string $notice = null;
|
||||
|
||||
public function mount(FeedbackChannels $channels): void
|
||||
{
|
||||
$this->type = (string) array_key_first($channels->available());
|
||||
}
|
||||
|
||||
public function submit(FeedbackChannels $channels, FeedbackOutbox $outbox, TechnicalInfo $info): void
|
||||
{
|
||||
$available = $channels->available();
|
||||
|
||||
$this->validate([
|
||||
'type' => ['required', 'in:'.implode(',', array_keys($available))],
|
||||
'subject' => ['required', 'string', 'max:255'],
|
||||
'body' => ['required', 'string', 'min:10', 'max:20000'],
|
||||
'severity' => ['required', 'in:low,normal,high,critical'],
|
||||
'email' => ['nullable', 'email', 'max:255'],
|
||||
'name' => ['nullable', 'string', 'max:255'],
|
||||
], attributes: [
|
||||
'type' => 'Art der Meldung', 'subject' => 'Betreff', 'body' => 'Beschreibung',
|
||||
'email' => 'E-Mail-Adresse', 'name' => 'Name',
|
||||
]);
|
||||
|
||||
$this->notice = null;
|
||||
$this->lastReference = null;
|
||||
|
||||
$payload = array_filter([
|
||||
'title' => $this->subject,
|
||||
'body' => $this->body,
|
||||
'email' => $this->email ?: null,
|
||||
'name' => $this->name ?: null,
|
||||
'severity' => $this->type === 'bugreport' ? $this->severity : null,
|
||||
...$info->collect(),
|
||||
], fn ($value) => $value !== null);
|
||||
|
||||
$result = $outbox->submit(auth()->user(), $this->type, $payload);
|
||||
|
||||
switch ($result->status) {
|
||||
case FeedbackResult::SENT:
|
||||
Audit::log('feedback.sent', ['type' => $this->type, 'reference' => $result->reference]);
|
||||
$this->lastReference = $result->reference;
|
||||
$this->reset(['subject', 'body', 'severity']);
|
||||
Notification::make()->success()->title('Vielen Dank – Ihre Meldung ist eingegangen')->body("Referenznummer: {$result->reference}")->persistent()->send();
|
||||
break;
|
||||
|
||||
case FeedbackResult::RETRY:
|
||||
$this->reset(['subject', 'body', 'severity']);
|
||||
$this->notice = 'Der Server ist gerade nicht erreichbar. Ihre Meldung ist gespeichert und wird automatisch gesendet, sobald es wieder geht. Die Referenznummer erscheint dann unten in der Liste.';
|
||||
break;
|
||||
|
||||
case FeedbackResult::INVALID:
|
||||
// Fehler direkt am betroffenen Feld anzeigen (API-Feld „title“ = Formularfeld „subject“).
|
||||
foreach ($result->errors as $field => $message) {
|
||||
$field = $field === 'title' ? 'subject' : $field;
|
||||
$this->addError(in_array($field, ['subject', 'body', 'email', 'name', 'severity'], true) ? $field : 'body', $message);
|
||||
}
|
||||
|
||||
if ($result->errors === []) {
|
||||
$this->addError('body', $result->message ?? 'Die Eingabe ist unvollständig.');
|
||||
}
|
||||
break;
|
||||
|
||||
case FeedbackResult::RATE_LIMITED:
|
||||
$minutes = $result->retryAfter ? max(1, (int) ceil($result->retryAfter / 60)) : null;
|
||||
$this->notice = 'Es wurden zu viele Meldungen in kurzer Zeit gesendet. Bitte versuchen Sie es '.($minutes ? "in etwa {$minutes} Minute(n)" : 'später').' noch einmal – Ihre Eingabe bleibt erhalten.';
|
||||
break;
|
||||
|
||||
case FeedbackResult::DISABLED:
|
||||
$channels->disable($this->type);
|
||||
$this->notice = 'Dieser Meldeweg steht nicht mehr zur Verfügung. Ihre Eingabe bleibt erhalten'.(count($channels->available()) ? ' – bitte wählen Sie eine andere Art der Meldung.' : '.');
|
||||
$this->type = (string) array_key_first($channels->available());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
protected function getViewData(): array
|
||||
{
|
||||
return [
|
||||
'types' => app(FeedbackChannels::class)->available(),
|
||||
'technical' => app(TechnicalInfo::class)->collect(),
|
||||
'hasLicense' => app(LicenseStore::class)->hasLicense(),
|
||||
'history' => VendorFeedback::query()->where('user_id', auth()->id())->latest()->limit(20)->get(),
|
||||
];
|
||||
}
|
||||
}
|
||||
39
app/Filament/Pages/SystemHealth.php
Normal file
39
app/Filament/Pages/SystemHealth.php
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
namespace App\Filament\Pages;
|
||||
|
||||
use App\Support\BackgroundTasks;
|
||||
use App\Support\SiteHealth;
|
||||
use BackedEnum;
|
||||
use Filament\Pages\Page;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use UnitEnum;
|
||||
|
||||
class SystemHealth extends Page
|
||||
{
|
||||
protected string $view = 'filament.pages.system-health';
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedHeart;
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'System';
|
||||
|
||||
protected static ?int $navigationSort = 20;
|
||||
|
||||
protected static ?string $navigationLabel = 'Systemzustand';
|
||||
|
||||
protected static ?string $title = 'Systemzustand';
|
||||
|
||||
protected static ?string $slug = 'systemzustand';
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
protected function getViewData(): array
|
||||
{
|
||||
return [
|
||||
'groups' => app(SiteHealth::class)->all(),
|
||||
'cronLine' => '* * * * * cd '.base_path().' && php artisan schedule:run >> /dev/null 2>&1',
|
||||
'webCronUrl' => url('/cron/'.app(BackgroundTasks::class)->webCronToken()),
|
||||
];
|
||||
}
|
||||
}
|
||||
131
app/Filament/Pages/Updates.php
Normal file
131
app/Filament/Pages/Updates.php
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
<?php
|
||||
|
||||
namespace App\Filament\Pages;
|
||||
|
||||
use App\Support\Audit;
|
||||
use App\Support\License\LicenseService;
|
||||
use App\Support\License\LicenseStore;
|
||||
use App\Support\License\ServerError;
|
||||
use App\Support\License\ServerMessages;
|
||||
use App\Support\Update\Changelog;
|
||||
use App\Support\Update\Channels;
|
||||
use App\Support\Update\InstalledVersion;
|
||||
use App\Support\Update\Migrations;
|
||||
use App\Support\Update\UpdateProgress;
|
||||
use BackedEnum;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Pages\Page;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Throwable;
|
||||
use UnitEnum;
|
||||
|
||||
/**
|
||||
* Seite „Aktualisierung“: Version, Kanal, Update-Suche und -Installation,
|
||||
* Migrationen, Änderungsprotokoll und Lizenz (docs/specs/self-updater.md).
|
||||
*/
|
||||
class Updates extends Page
|
||||
{
|
||||
protected string $view = 'filament.pages.updates';
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedArrowPathRoundedSquare;
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'System';
|
||||
|
||||
protected static ?int $navigationSort = 10;
|
||||
|
||||
protected static ?string $navigationLabel = 'Aktualisierung';
|
||||
|
||||
protected static ?string $title = 'Aktualisierung';
|
||||
|
||||
protected static ?string $slug = 'aktualisierung';
|
||||
|
||||
public string $licenseEmail = '';
|
||||
|
||||
public string $licenseKey = '';
|
||||
|
||||
public ?string $licenseError = null;
|
||||
|
||||
public function mount(LicenseStore $license): void
|
||||
{
|
||||
$this->licenseEmail = (string) $license->email();
|
||||
}
|
||||
|
||||
public function saveLicense(LicenseStore $license, LicenseService $service): void
|
||||
{
|
||||
$this->validate([
|
||||
'licenseEmail' => ['required', 'email', 'max:255'],
|
||||
'licenseKey' => [$license->hasLicense() ? 'nullable' : 'required', 'string', 'max:500'],
|
||||
], attributes: ['licenseEmail' => 'Lizenz-E-Mail', 'licenseKey' => 'Lizenzschlüssel']);
|
||||
|
||||
$license->setLicense($this->licenseEmail, filled($this->licenseKey) ? $this->licenseKey : (string) $license->key());
|
||||
$this->licenseKey = '';
|
||||
Audit::log('license.saved', ['email' => $this->licenseEmail]);
|
||||
|
||||
$this->checkLicense($service);
|
||||
}
|
||||
|
||||
public function checkLicense(LicenseService $service): void
|
||||
{
|
||||
$this->licenseError = null;
|
||||
|
||||
try {
|
||||
$service->check();
|
||||
|
||||
Notification::make()->success()->title('Lizenz geprüft')->send();
|
||||
} catch (ServerError $e) {
|
||||
$this->licenseError = ServerMessages::for($e);
|
||||
} catch (Throwable $e) {
|
||||
$this->licenseError = 'Die Lizenz konnte nicht geprüft werden: '.$e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
public function releaseDevice(LicenseService $service, LicenseStore $license): void
|
||||
{
|
||||
try {
|
||||
$service->releaseDevice();
|
||||
Audit::log('license.device_released', ['device_label' => $license->deviceLabel()]);
|
||||
|
||||
Notification::make()
|
||||
->success()
|
||||
->title('Installation abgemeldet')
|
||||
->body('Der Geräteplatz ist wieder frei. Updates sind erst nach erneuter Lizenzprüfung wieder möglich.')
|
||||
->send();
|
||||
} catch (ServerError $e) {
|
||||
Notification::make()->danger()->title('Abmelden fehlgeschlagen')->body(ServerMessages::for($e))->send();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
protected function getViewData(): array
|
||||
{
|
||||
$version = app(InstalledVersion::class);
|
||||
$license = app(LicenseStore::class);
|
||||
$channels = app(Channels::class);
|
||||
|
||||
try {
|
||||
$migrations = app(Migrations::class)->status();
|
||||
} catch (Throwable) {
|
||||
$migrations = [];
|
||||
}
|
||||
|
||||
return [
|
||||
'release' => $version->release(),
|
||||
'shortSha' => $version->short(),
|
||||
'channels' => $channels->all(),
|
||||
'activeChannel' => $channels->active(),
|
||||
'progress' => app(UpdateProgress::class)->get(),
|
||||
'migrations' => $migrations,
|
||||
'pendingMigrations' => count(array_filter($migrations, fn (array $m) => ! $m['ran'])),
|
||||
'changelog' => app(Changelog::class)->sections(),
|
||||
'hasLicense' => $license->hasLicense(),
|
||||
'maskedKey' => ($key = $license->key()) ? str_repeat('•', 8).substr($key, -4) : null,
|
||||
'licenseSummary' => app(LicenseService::class)->summary(),
|
||||
'licenseStatusError' => ($code = $license->lastStatus()['error_code'] ?? null)
|
||||
? ServerMessages::for(new ServerError($code, 0, $code))
|
||||
: null,
|
||||
'deviceLabel' => $license->deviceLabel(),
|
||||
];
|
||||
}
|
||||
}
|
||||
97
app/Http/Controllers/Admin/UpdateController.php
Normal file
97
app/Http/Controllers/Admin/UpdateController.php
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Support\Audit;
|
||||
use App\Support\License\ServerError;
|
||||
use App\Support\License\ServerMessages;
|
||||
use App\Support\Update\Channels;
|
||||
use App\Support\Update\Migrations;
|
||||
use App\Support\Update\UpdateCheck;
|
||||
use App\Support\Update\UpdateProgress;
|
||||
use App\Support\Update\Updater;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* Endpunkte der Seite „Aktualisierung“ – nur für Administratoren, CSRF-geschützt.
|
||||
*/
|
||||
class UpdateController extends Controller
|
||||
{
|
||||
public function check(Request $request, UpdateCheck $check): JsonResponse
|
||||
{
|
||||
try {
|
||||
return response()->json(['ok' => true, 'result' => $check->run()]);
|
||||
} catch (ServerError $e) {
|
||||
return $this->serverError($e);
|
||||
}
|
||||
}
|
||||
|
||||
public function install(Request $request, Updater $updater, UpdateProgress $progress): JsonResponse
|
||||
{
|
||||
if ($progress->isRunning()) {
|
||||
return response()->json(['ok' => false, 'message' => 'Es läuft bereits eine Aktualisierung.'], 409);
|
||||
}
|
||||
|
||||
// Der Ablauf läuft serverseitig zu Ende, auch wenn der Browser die Verbindung trennt.
|
||||
@set_time_limit(0);
|
||||
@ignore_user_abort(true);
|
||||
|
||||
try {
|
||||
$result = $updater->installUpdate($request->user()?->id);
|
||||
|
||||
return response()->json(['ok' => true, 'result' => $result]);
|
||||
} catch (ServerError $e) {
|
||||
return $this->serverError($e);
|
||||
} catch (Throwable $e) {
|
||||
return response()->json(['ok' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
}
|
||||
|
||||
public function progress(UpdateProgress $progress): JsonResponse
|
||||
{
|
||||
return response()->json($progress->get());
|
||||
}
|
||||
|
||||
public function channel(Request $request, Channels $channels): JsonResponse
|
||||
{
|
||||
$validated = $request->validate([
|
||||
'channel' => ['required', 'string', Rule::in(array_keys($channels->all()))],
|
||||
]);
|
||||
|
||||
$channels->setActive($validated['channel']);
|
||||
Audit::log('update.channel_changed', ['channel' => $validated['channel']]);
|
||||
|
||||
return response()->json(['ok' => true, 'channel' => $validated['channel']]);
|
||||
}
|
||||
|
||||
public function migrations(Migrations $migrations): JsonResponse
|
||||
{
|
||||
@set_time_limit(0);
|
||||
|
||||
try {
|
||||
$count = $migrations->run();
|
||||
@file_put_contents(storage_path('.migrations-fingerprint'), $migrations->fingerprint());
|
||||
Audit::log('update.migrations', ['migrations' => $count]);
|
||||
|
||||
return response()->json(['ok' => true, 'count' => $count, 'status' => $migrations->status()]);
|
||||
} catch (Throwable $e) {
|
||||
Audit::log('update.migrations_failed', ['error' => $e->getMessage()]);
|
||||
|
||||
return response()->json(['ok' => false, 'message' => 'Migrationen fehlgeschlagen: '.$e->getMessage()], 500);
|
||||
}
|
||||
}
|
||||
|
||||
private function serverError(ServerError $e): JsonResponse
|
||||
{
|
||||
return response()->json([
|
||||
'ok' => false,
|
||||
'code' => $e->errorCode,
|
||||
'message' => ServerMessages::for($e),
|
||||
'license_input' => $e->needsLicenseInput(),
|
||||
], 200);
|
||||
}
|
||||
}
|
||||
23
app/Http/Controllers/CronController.php
Normal file
23
app/Http/Controllers/CronController.php
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Support\BackgroundTasks;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
/**
|
||||
* Web-Cron für Hoster ohne Cron: ein externer Dienst ruft minütlich
|
||||
* /cron/{token} auf.
|
||||
*/
|
||||
class CronController extends Controller
|
||||
{
|
||||
public function __invoke(string $token, BackgroundTasks $tasks): Response
|
||||
{
|
||||
abort_unless(hash_equals($tasks->webCronToken(), $token), 404);
|
||||
|
||||
@ignore_user_abort(true);
|
||||
$tasks->run('webcron');
|
||||
|
||||
return response()->noContent();
|
||||
}
|
||||
}
|
||||
161
app/Http/Controllers/InstallController.php
Normal file
161
app/Http/Controllers/InstallController.php
Normal file
|
|
@ -0,0 +1,161 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Support\Audit;
|
||||
use App\Support\EnvFile;
|
||||
use App\Support\Installation;
|
||||
use App\Support\License\LicenseStore;
|
||||
use App\Support\Settings;
|
||||
use App\Support\SiteHealth;
|
||||
use App\Support\Update\Migrations;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Validation\Rules\Password;
|
||||
use Illuminate\View\View;
|
||||
use PDO;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* Web-Installer: Systemprüfung → Datenbank → Administrator. Nur erreichbar,
|
||||
* solange die Installation nicht eingerichtet ist.
|
||||
*/
|
||||
class InstallController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
abort_if(Installation::isInstalled(), 404);
|
||||
}
|
||||
|
||||
public function requirements(SiteHealth $health): View
|
||||
{
|
||||
$checks = $health->requirements();
|
||||
|
||||
return view('install.requirements', [
|
||||
'checks' => $checks,
|
||||
'canContinue' => collect($checks)->doesntContain('status', SiteHealth::ERROR) && is_file(app()->environmentFilePath()),
|
||||
'envWritable' => is_file(app()->environmentFilePath()) && is_writable(app()->environmentFilePath()),
|
||||
]);
|
||||
}
|
||||
|
||||
public function database(): View
|
||||
{
|
||||
return view('install.database', [
|
||||
'values' => [
|
||||
'host' => config('database.connections.mysql.host', 'localhost'),
|
||||
'port' => config('database.connections.mysql.port', 3306),
|
||||
'database' => config('database.connections.mysql.database'),
|
||||
'username' => config('database.connections.mysql.username'),
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
public function saveDatabase(Request $request): RedirectResponse
|
||||
{
|
||||
$data = $request->validate([
|
||||
'host' => ['required', 'string', 'max:255'],
|
||||
'port' => ['required', 'integer', 'between:1,65535'],
|
||||
'database' => ['required', 'string', 'max:64'],
|
||||
'username' => ['required', 'string', 'max:255'],
|
||||
'password' => ['nullable', 'string', 'max:255'],
|
||||
], attributes: ['host' => 'Server', 'port' => 'Port', 'database' => 'Datenbank', 'username' => 'Benutzer', 'password' => 'Passwort']);
|
||||
|
||||
try {
|
||||
$pdo = new PDO(
|
||||
"mysql:host={$data['host']};port={$data['port']};dbname={$data['database']};charset=utf8mb4",
|
||||
$data['username'],
|
||||
$data['password'] ?? '',
|
||||
[PDO::ATTR_TIMEOUT => 5, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION],
|
||||
);
|
||||
$version = (string) $pdo->query('select version()')->fetchColumn();
|
||||
} catch (Throwable $e) {
|
||||
return back()->withInput($request->except('password'))
|
||||
->withErrors(['host' => 'Verbindung fehlgeschlagen: '.$this->pdoMessage($e->getMessage())]);
|
||||
}
|
||||
|
||||
$mariadb = str_contains(strtolower($version), 'mariadb');
|
||||
$number = preg_replace('/^(\d+\.\d+\.\d+).*$/', '$1', $version);
|
||||
|
||||
if (! version_compare($number, $mariadb ? '10.6.0' : '8.0.0', '>=')) {
|
||||
return back()->withInput($request->except('password'))
|
||||
->withErrors(['host' => ($mariadb ? 'MariaDB ' : 'MySQL ').$number.' wird nicht unterstützt. Benötigt wird MySQL ab 8.0 oder MariaDB ab 10.6.']);
|
||||
}
|
||||
|
||||
EnvFile::set(app()->environmentFilePath(), [
|
||||
'APP_URL' => $request->getSchemeAndHttpHost().$request->getBaseUrl(),
|
||||
'DB_CONNECTION' => 'mysql',
|
||||
'DB_HOST' => $data['host'],
|
||||
'DB_PORT' => (string) $data['port'],
|
||||
'DB_DATABASE' => $data['database'],
|
||||
'DB_USERNAME' => $data['username'],
|
||||
'DB_PASSWORD' => $data['password'] ?? '',
|
||||
]);
|
||||
|
||||
return redirect('/install/konto');
|
||||
}
|
||||
|
||||
public function account(): View|RedirectResponse
|
||||
{
|
||||
return view('install.account');
|
||||
}
|
||||
|
||||
public function saveAccount(Request $request, Settings $settings, LicenseStore $license, Migrations $migrations): RedirectResponse
|
||||
{
|
||||
$data = $request->validate([
|
||||
'portal_name' => ['required', 'string', 'max:60'],
|
||||
'first_name' => ['required', 'string', 'max:100'],
|
||||
'last_name' => ['required', 'string', 'max:100'],
|
||||
'email' => ['required', 'email', 'max:255'],
|
||||
'password' => ['required', 'confirmed', Password::min(10)->letters()->numbers()],
|
||||
'license_email' => ['nullable', 'email', 'max:255', 'required_with:license_key'],
|
||||
'license_key' => ['nullable', 'string', 'max:500', 'required_with:license_email'],
|
||||
], attributes: [
|
||||
'portal_name' => 'Name des Portals', 'first_name' => 'Vorname', 'last_name' => 'Nachname',
|
||||
'email' => 'E-Mail-Adresse', 'password' => 'Passwort',
|
||||
'license_email' => 'Lizenz-E-Mail', 'license_key' => 'Lizenzschlüssel',
|
||||
]);
|
||||
|
||||
@set_time_limit(300);
|
||||
|
||||
try {
|
||||
Artisan::call('migrate', ['--force' => true]);
|
||||
} catch (Throwable $e) {
|
||||
return back()->withInput($request->except('password', 'password_confirmation', 'license_key'))
|
||||
->withErrors(['portal_name' => 'Die Datenbank konnte nicht eingerichtet werden: '.$e->getMessage()]);
|
||||
}
|
||||
|
||||
$admin = User::query()->updateOrCreate(['email' => strtolower($data['email'])], [
|
||||
'first_name' => $data['first_name'],
|
||||
'last_name' => $data['last_name'],
|
||||
'password' => $data['password'],
|
||||
'is_admin' => true,
|
||||
'is_active' => true,
|
||||
]);
|
||||
|
||||
$settings->set('branding.portal_name', $data['portal_name']);
|
||||
|
||||
if (filled($data['license_email'] ?? null)) {
|
||||
$license->setLicense($data['license_email'], $data['license_key']);
|
||||
}
|
||||
|
||||
$license->deviceId();
|
||||
file_put_contents(storage_path('.migrations-fingerprint'), $migrations->fingerprint());
|
||||
Installation::markInstalled();
|
||||
Audit::log('install.completed', ['portal_name' => $data['portal_name']], $admin->id);
|
||||
|
||||
// Kein Flash: Ab jetzt liegen die Sitzungen in der Datenbank, die bisherige Sitzung ist weg.
|
||||
return redirect('/login?eingerichtet=1');
|
||||
}
|
||||
|
||||
private function pdoMessage(string $message): string
|
||||
{
|
||||
return match (true) {
|
||||
str_contains($message, 'Access denied') => 'Benutzername oder Passwort sind falsch, oder der Benutzer hat keinen Zugriff auf diese Datenbank.',
|
||||
str_contains($message, 'Unknown database') => 'Die Datenbank existiert nicht. Bitte zuerst beim Hoster anlegen.',
|
||||
str_contains($message, 'getaddrinfo'), str_contains($message, 'Connection refused'), str_contains($message, 'timed out') => 'Der Datenbankserver ist nicht erreichbar. Bitte Server und Port prüfen.',
|
||||
default => $message,
|
||||
};
|
||||
}
|
||||
}
|
||||
35
app/Http/Middleware/EnsureNotInMaintenance.php
Normal file
35
app/Http/Middleware/EnsureNotInMaintenance.php
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Support\Update\MaintenanceFlag;
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
/**
|
||||
* Während eines Updates: 503 mit Wartungsseite. Ausgenommen sind die
|
||||
* Update-Endpunkte, die Seite „Aktualisierung“, die Anmeldung und der
|
||||
* Health-Check – sonst könnte niemand verfolgen, wie weit das Update ist.
|
||||
*/
|
||||
class EnsureNotInMaintenance
|
||||
{
|
||||
private const EXCEPT = ['admin/update/*', 'admin/aktualisierung', 'login', 'logout', 'up'];
|
||||
|
||||
public function __construct(private readonly MaintenanceFlag $maintenance) {}
|
||||
|
||||
public function handle(Request $request, Closure $next): Response
|
||||
{
|
||||
if (! $this->maintenance->isActive() || $request->is(...self::EXCEPT)) {
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
$retryAfter = $this->maintenance->retryAfter();
|
||||
|
||||
if ($request->expectsJson() || $request->header('X-Inertia')) {
|
||||
return response()->json(['message' => 'Das Portal wird gerade aktualisiert.'], 503, ['Retry-After' => $retryAfter]);
|
||||
}
|
||||
|
||||
return response()->view('maintenance', ['retryAfter' => $retryAfter], 503, ['Retry-After' => $retryAfter]);
|
||||
}
|
||||
}
|
||||
23
app/Http/Middleware/RedirectToInstaller.php
Normal file
23
app/Http/Middleware/RedirectToInstaller.php
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Support\Installation;
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
/**
|
||||
* Solange nicht eingerichtet, führt jede Seite zum Web-Installer.
|
||||
*/
|
||||
class RedirectToInstaller
|
||||
{
|
||||
public function handle(Request $request, Closure $next): Response
|
||||
{
|
||||
if (! Installation::isInstalled() && ! $request->is('install', 'install/*', 'up')) {
|
||||
return redirect('/install');
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
72
app/Http/Middleware/RunPendingMigrations.php
Normal file
72
app/Http/Middleware/RunPendingMigrations.php
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Support\Installation;
|
||||
use App\Support\Update\Migrations;
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* Führt nach einem Update beim ersten Seitenaufruf ausstehende Migrationen aus –
|
||||
* ohne SSH der einzige verlässliche Zeitpunkt.
|
||||
*
|
||||
* Migriert wird nur, wenn sich der Fingerabdruck der Migrationsdateien geändert
|
||||
* hat (sonst liefe der Migrator bei jedem Request), mit einer Sperre gegen
|
||||
* Parallellauf. Fehler werden protokolliert, nie geworfen.
|
||||
*/
|
||||
class RunPendingMigrations
|
||||
{
|
||||
public function __construct(private readonly Migrations $migrations) {}
|
||||
|
||||
public function handle(Request $request, Closure $next): Response
|
||||
{
|
||||
if (app()->runningUnitTests() || ! Installation::isInstalled()) {
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
$stored = @file_get_contents(storage_path('.migrations-fingerprint'));
|
||||
|
||||
try {
|
||||
$current = $this->migrations->fingerprint();
|
||||
|
||||
if ($stored !== $current) {
|
||||
$this->migrateWithLock($current);
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
Log::error('Automatische Migration fehlgeschlagen: '.$e->getMessage(), ['exception' => $e]);
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
private function migrateWithLock(string $fingerprint): void
|
||||
{
|
||||
$lock = @fopen(storage_path('.migrate.lock'), 'c');
|
||||
|
||||
if ($lock === false || ! flock($lock, LOCK_EX | LOCK_NB)) {
|
||||
return; // Läuft gerade in einer anderen Anfrage.
|
||||
}
|
||||
|
||||
try {
|
||||
// Nach dem Warten auf die Sperre erneut prüfen – vielleicht war jemand schneller.
|
||||
if (@file_get_contents(storage_path('.migrations-fingerprint')) === $fingerprint) {
|
||||
return;
|
||||
}
|
||||
|
||||
@set_time_limit(300);
|
||||
$count = $this->migrations->run();
|
||||
file_put_contents(storage_path('.migrations-fingerprint'), $fingerprint);
|
||||
|
||||
if ($count > 0) {
|
||||
Log::info("Automatische Migration: {$count} Migration(en) ausgeführt.");
|
||||
}
|
||||
} finally {
|
||||
flock($lock, LOCK_UN);
|
||||
fclose($lock);
|
||||
}
|
||||
}
|
||||
}
|
||||
33
app/Http/Middleware/RunPseudoCron.php
Normal file
33
app/Http/Middleware/RunPseudoCron.php
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Support\BackgroundTasks;
|
||||
use App\Support\Installation;
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
/**
|
||||
* Pseudo-Cron: Läuft weder echter Cron noch Web-Cron, werden fällige
|
||||
* Hintergrundaufgaben nach dem Ausliefern einer Seite erledigt – höchstens
|
||||
* einmal pro Minute.
|
||||
*/
|
||||
class RunPseudoCron
|
||||
{
|
||||
public function __construct(private readonly BackgroundTasks $tasks) {}
|
||||
|
||||
public function handle(Request $request, Closure $next): Response
|
||||
{
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
public function terminate(Request $request, Response $response): void
|
||||
{
|
||||
if (app()->runningUnitTests() || ! Installation::isInstalled() || ! $this->tasks->pseudoCronDue()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->tasks->run('pseudo');
|
||||
}
|
||||
}
|
||||
29
app/Models/AuditLog.php
Normal file
29
app/Models/AuditLog.php
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
#[Fillable(['user_id', 'action', 'data'])]
|
||||
class AuditLog extends Model
|
||||
{
|
||||
public const UPDATED_AT = null;
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'data' => 'array',
|
||||
'created_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
}
|
||||
40
app/Models/VendorFeedback.php
Normal file
40
app/Models/VendorFeedback.php
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
#[Fillable(['user_id', 'type', 'payload', 'idempotency_key', 'status', 'attempts', 'next_attempt_at', 'reference', 'last_error'])]
|
||||
class VendorFeedback extends Model
|
||||
{
|
||||
public const PENDING = 'pending';
|
||||
|
||||
public const SENT = 'sent';
|
||||
|
||||
public const DISCARDED = 'discarded';
|
||||
|
||||
public const TYPES = [
|
||||
'bugreport' => 'Fehlerbericht',
|
||||
'featurerequest' => 'Funktionswunsch',
|
||||
];
|
||||
|
||||
protected $table = 'vendor_feedback';
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'payload' => 'array',
|
||||
'next_attempt_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
}
|
||||
|
|
@ -2,12 +2,20 @@
|
|||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Support\Avatars;
|
||||
use App\Support\BackgroundTasks;
|
||||
use App\Support\Branding;
|
||||
use App\Support\Installation;
|
||||
use App\Support\License\LicenseStore;
|
||||
use App\Support\Navigation;
|
||||
use App\Support\QuickLinks;
|
||||
use App\Support\Settings;
|
||||
use App\Support\Update\InstalledVersion;
|
||||
use App\Support\Update\MaintenanceFlag;
|
||||
use App\Support\Update\UpdateProgress;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Validation\Rules\Password;
|
||||
|
||||
|
|
@ -15,11 +23,26 @@ class AppServiceProvider extends ServiceProvider
|
|||
{
|
||||
public function register(): void
|
||||
{
|
||||
// Frisch hochgeladen: .env und Schlüssel anlegen; bis zur Einrichtung ohne Datenbank
|
||||
// für Sitzungen, Cache und Queue auskommen (der Web-Installer braucht das).
|
||||
if (! $this->app->runningUnitTests()) {
|
||||
Installation::prepareEnvironment();
|
||||
}
|
||||
|
||||
if (! Installation::isInstalled()) {
|
||||
config(['session.driver' => 'file', 'cache.default' => 'file', 'queue.default' => 'sync']);
|
||||
}
|
||||
|
||||
$this->app->singleton(Settings::class);
|
||||
$this->app->singleton(Branding::class);
|
||||
$this->app->singleton(Avatars::class);
|
||||
$this->app->singleton(Navigation::class);
|
||||
$this->app->singleton(QuickLinks::class);
|
||||
$this->app->singleton(LicenseStore::class);
|
||||
$this->app->singleton(BackgroundTasks::class);
|
||||
$this->app->singleton(InstalledVersion::class);
|
||||
$this->app->singleton(UpdateProgress::class);
|
||||
$this->app->singleton(MaintenanceFlag::class);
|
||||
}
|
||||
|
||||
public function boot(): void
|
||||
|
|
@ -27,6 +50,9 @@ class AppServiceProvider extends ServiceProvider
|
|||
// N+1-Abfragen in Entwicklung und Tests sofort sichtbar machen (docs/PLAN.md, Performance).
|
||||
Model::preventLazyLoading(! $this->app->isProduction());
|
||||
|
||||
// Vorläufig: Administratoren über is_admin – wird in Phase 2 durch Rollen ersetzt.
|
||||
Gate::define('admin', fn (User $user) => $user->is_admin && $user->is_active);
|
||||
|
||||
Password::defaults(fn () => Password::min(10)->letters()->numbers());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,9 @@
|
|||
namespace App\Providers\Filament;
|
||||
|
||||
use App\Filament\AvatarProviders\InitialsAvatarProvider;
|
||||
use App\Filament\Pages\Feedback;
|
||||
use App\Support\Branding;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Http\Middleware\Authenticate;
|
||||
use Filament\Http\Middleware\AuthenticateSession;
|
||||
use Filament\Http\Middleware\DisableBladeIconComponents;
|
||||
|
|
@ -37,7 +39,14 @@ class AdminPanelProvider extends PanelProvider
|
|||
->colors(fn () => [
|
||||
'primary' => app(Branding::class)->palette(),
|
||||
])
|
||||
->navigationGroups(['Inhalte', 'Portal'])
|
||||
->navigationGroups(['Inhalte', 'Portal', 'System', 'Hilfe'])
|
||||
->databaseNotifications()
|
||||
->userMenuItems([
|
||||
Action::make('feedback')
|
||||
->label('Rückmeldung geben')
|
||||
->icon(Heroicon::OutlinedChatBubbleLeftEllipsis)
|
||||
->url(fn () => Feedback::getUrl()),
|
||||
])
|
||||
->navigationItems([
|
||||
NavigationItem::make('Zum Portal')
|
||||
->url('/')
|
||||
|
|
|
|||
|
|
@ -25,7 +25,9 @@ class FortifyServiceProvider extends ServiceProvider
|
|||
|
||||
Fortify::loginView(fn (Request $request) => Inertia::render('Auth/Login', [
|
||||
'canResetPassword' => true,
|
||||
'status' => $request->session()->get('status'),
|
||||
'status' => $request->boolean('eingerichtet')
|
||||
? 'Die Einrichtung ist abgeschlossen. Sie können sich jetzt mit Ihrem Administratorkonto anmelden.'
|
||||
: $request->session()->get('status'),
|
||||
]));
|
||||
|
||||
Fortify::requestPasswordResetLinkView(fn (Request $request) => Inertia::render('Auth/ForgotPassword', [
|
||||
|
|
|
|||
30
app/Support/Audit.php
Normal file
30
app/Support/Audit.php
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
namespace App\Support;
|
||||
|
||||
use App\Models\AuditLog;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* Protokoll für Admin-Aktionen. Schreibt zusätzlich ins Log – falls die
|
||||
* Datenbank gerade nicht erreichbar ist (z. B. mitten in einem Update).
|
||||
*/
|
||||
class Audit
|
||||
{
|
||||
/**
|
||||
* @param array<string, mixed> $data
|
||||
*/
|
||||
public static function log(string $action, array $data = [], ?int $userId = null): void
|
||||
{
|
||||
$userId ??= auth()->id();
|
||||
|
||||
Log::info("audit: {$action}", [...$data, 'user_id' => $userId]);
|
||||
|
||||
try {
|
||||
AuditLog::query()->create(['user_id' => $userId, 'action' => $action, 'data' => $data]);
|
||||
} catch (Throwable $e) {
|
||||
Log::warning('Audit-Eintrag konnte nicht gespeichert werden: '.$e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
80
app/Support/BackgroundTasks.php
Normal file
80
app/Support/BackgroundTasks.php
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
<?php
|
||||
|
||||
namespace App\Support;
|
||||
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* Hintergrundaufgaben ohne Dauerprozess (Shared Hosting):
|
||||
* 1. echter Cron: * * * * * php artisan schedule:run
|
||||
* 2. Web-Cron: externer Dienst ruft /cron/{token} auf
|
||||
* 3. Pseudo-Cron: nach Auslieferung einer Seite, wenn 1 und 2 fehlen (wie WP-Cron)
|
||||
* Jeder Lauf hinterlässt ein Lebenszeichen, das „Systemzustand“ anzeigt.
|
||||
*/
|
||||
class BackgroundTasks
|
||||
{
|
||||
/** Ohne Lebenszeichen von Cron/Web-Cron springt der Pseudo-Cron ein. */
|
||||
public const PSEUDO_CRON_AFTER_SECONDS = 300;
|
||||
|
||||
public function __construct(private readonly Settings $settings) {}
|
||||
|
||||
public function run(string $source): void
|
||||
{
|
||||
$lock = @fopen(storage_path('.background.lock'), 'c');
|
||||
|
||||
if ($lock === false || ! flock($lock, LOCK_EX | LOCK_NB)) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
@set_time_limit(55);
|
||||
$this->heartbeat($source);
|
||||
Artisan::call('schedule:run');
|
||||
} catch (Throwable $e) {
|
||||
Log::error('Hintergrundaufgaben fehlgeschlagen: '.$e->getMessage(), ['exception' => $e]);
|
||||
} finally {
|
||||
flock($lock, LOCK_UN);
|
||||
fclose($lock);
|
||||
}
|
||||
}
|
||||
|
||||
public function heartbeat(string $source): void
|
||||
{
|
||||
$beats = $this->heartbeats();
|
||||
$beats[$source] = now()->getTimestamp();
|
||||
@file_put_contents(storage_path('.background-heartbeat'), json_encode($beats));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, int> Quelle (cron, webcron, pseudo) => Zeitpunkt
|
||||
*/
|
||||
public function heartbeats(): array
|
||||
{
|
||||
$data = json_decode((string) @file_get_contents(storage_path('.background-heartbeat')), true);
|
||||
|
||||
return is_array($data) ? array_map('intval', $data) : [];
|
||||
}
|
||||
|
||||
public function pseudoCronDue(): bool
|
||||
{
|
||||
$beats = $this->heartbeats();
|
||||
$external = max($beats['cron'] ?? 0, $beats['webcron'] ?? 0);
|
||||
|
||||
return now()->getTimestamp() - $external > self::PSEUDO_CRON_AFTER_SECONDS
|
||||
&& now()->getTimestamp() - ($beats['pseudo'] ?? 0) >= 60;
|
||||
}
|
||||
|
||||
public function webCronToken(): string
|
||||
{
|
||||
$token = $this->settings->get('system.cron_token');
|
||||
|
||||
if (! is_string($token) || strlen($token) < 32) {
|
||||
$token = bin2hex(random_bytes(20));
|
||||
$this->settings->set('system.cron_token', $token);
|
||||
}
|
||||
|
||||
return $token;
|
||||
}
|
||||
}
|
||||
49
app/Support/EnvFile.php
Normal file
49
app/Support/EnvFile.php
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
namespace App\Support;
|
||||
|
||||
use App\Support\Update\AtomicFile;
|
||||
|
||||
/**
|
||||
* Setzt Werte in einer .env-Datei (vorhandene Zeilen ersetzen, neue anhängen).
|
||||
*/
|
||||
class EnvFile
|
||||
{
|
||||
/**
|
||||
* @param array<string, string|int|bool|null> $values
|
||||
*/
|
||||
public static function set(string $path, array $values): void
|
||||
{
|
||||
$content = is_file($path) ? (string) file_get_contents($path) : '';
|
||||
|
||||
foreach ($values as $key => $value) {
|
||||
$line = $key.'='.self::format($value);
|
||||
$pattern = '/^#?\s*'.preg_quote($key, '/').'=.*$/m';
|
||||
|
||||
$content = preg_match($pattern, $content)
|
||||
? preg_replace($pattern, str_replace(['\\', '$'], ['\\\\', '\\$'], $line), $content, 1)
|
||||
: rtrim($content, "\n")."\n".$line."\n";
|
||||
}
|
||||
|
||||
AtomicFile::write($path, $content);
|
||||
}
|
||||
|
||||
private static function format(string|int|bool|null $value): string
|
||||
{
|
||||
if ($value === null) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (is_bool($value)) {
|
||||
return $value ? 'true' : 'false';
|
||||
}
|
||||
|
||||
$value = (string) $value;
|
||||
|
||||
if ($value === '' || preg_match('/^[A-Za-z0-9_.:\/@+=-]+$/', $value)) {
|
||||
return $value;
|
||||
}
|
||||
|
||||
return '"'.str_replace(['\\', '"', '$'], ['\\\\', '\\"', '\\$'], $value).'"';
|
||||
}
|
||||
}
|
||||
58
app/Support/Feedback/FeedbackChannels.php
Normal file
58
app/Support/Feedback/FeedbackChannels.php
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
namespace App\Support\Feedback;
|
||||
|
||||
use App\Models\VendorFeedback;
|
||||
use App\Support\Settings;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* Welche Meldewege für dieses Programm freigeschaltet sind – einmal täglich über
|
||||
* GET /v1/software ermittelt. Ein 404 beim Senden blendet den Weg dauerhaft aus.
|
||||
*/
|
||||
class FeedbackChannels
|
||||
{
|
||||
public function __construct(private readonly Settings $settings) {}
|
||||
|
||||
/**
|
||||
* @return array<string, string> Schlüssel => Bezeichnung
|
||||
*/
|
||||
public function available(): array
|
||||
{
|
||||
$enabled = Cache::remember('feedback.endpoints', now()->addDay(), fn () => $this->fetch());
|
||||
$disabled = (array) $this->settings->get('feedback.disabled', []);
|
||||
|
||||
return collect(VendorFeedback::TYPES)
|
||||
->only($enabled ?? array_keys(VendorFeedback::TYPES))
|
||||
->except($disabled)
|
||||
->all();
|
||||
}
|
||||
|
||||
public function disable(string $type): void
|
||||
{
|
||||
$disabled = (array) $this->settings->get('feedback.disabled', []);
|
||||
$this->settings->set('feedback.disabled', array_values(array_unique([...$disabled, $type])));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<string>|null null = unbekannt (Server nicht erreichbar) – dann alle anbieten
|
||||
*/
|
||||
private function fetch(): ?array
|
||||
{
|
||||
try {
|
||||
$software = Http::timeout(5)->acceptJson()->get(rtrim(config('updater.api_url'), '/').'/software')->json('software');
|
||||
|
||||
foreach ((array) $software as $entry) {
|
||||
if (($entry['slug'] ?? null) === config('updater.software')) {
|
||||
return array_values(array_filter((array) ($entry['endpoints'] ?? []), 'is_string'));
|
||||
}
|
||||
}
|
||||
|
||||
return [];
|
||||
} catch (Throwable) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
80
app/Support/Feedback/FeedbackClient.php
Normal file
80
app/Support/Feedback/FeedbackClient.php
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
<?php
|
||||
|
||||
namespace App\Support\Feedback;
|
||||
|
||||
use App\Support\License\ServerError;
|
||||
use App\Support\License\VendorHttp;
|
||||
|
||||
/**
|
||||
* Sendet Rückmeldungen an api.loheide.cloud (docs/specs/feedback.md).
|
||||
* Lizenz-Kopfzeilen nur, wenn eine Lizenz hinterlegt ist; eine ungültige oder
|
||||
* abgelaufene Lizenz verhindert das Senden nicht.
|
||||
*/
|
||||
class FeedbackClient
|
||||
{
|
||||
public function __construct(private readonly VendorHttp $http) {}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $payload
|
||||
*/
|
||||
public function send(string $type, array $payload, string $idempotencyKey, int $timeout = 10): FeedbackResult
|
||||
{
|
||||
try {
|
||||
$response = VendorHttp::guard(fn () => $this->http->request($timeout, identifyDevice: false)
|
||||
->withHeaders(['Idempotency-Key' => $idempotencyKey])
|
||||
->post($this->url($type), $payload));
|
||||
} catch (ServerError $e) {
|
||||
return FeedbackResult::retry('Der Server ist nicht erreichbar.');
|
||||
}
|
||||
|
||||
$data = $response->json() ?? [];
|
||||
|
||||
return match (true) {
|
||||
$response->status() === 201 || ($response->successful() && isset($data['reference'])) => FeedbackResult::sent((string) ($data['reference'] ?? '')),
|
||||
$response->status() === 404 => FeedbackResult::disabled(),
|
||||
$response->status() === 422 => FeedbackResult::invalid($this->fieldErrors($data), $data['error'] ?? $data['message'] ?? null),
|
||||
$response->status() === 429 => FeedbackResult::rateLimited($this->retryAfter($response->header('Retry-After'), $data)),
|
||||
// 409: dieselbe Meldung wird gerade verarbeitet – kurz warten, dann erneut (kein Fehler).
|
||||
$response->status() === 409 => FeedbackResult::retry('Wird bereits verarbeitet.', 30),
|
||||
default => FeedbackResult::retry('Server antwortet mit HTTP '.$response->status().'.', $this->retryAfter($response->header('Retry-After'), $data)),
|
||||
};
|
||||
}
|
||||
|
||||
private function url(string $type): string
|
||||
{
|
||||
return rtrim(config('updater.api_url'), '/').'/software/'.config('updater.software').'/'.$type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unterstützt {"errors": {"feld": ["Grund"]}} und {"field": "feld", "error": "Grund"}.
|
||||
*
|
||||
* @param array<string, mixed> $data
|
||||
* @return array<string, string>
|
||||
*/
|
||||
private function fieldErrors(array $data): array
|
||||
{
|
||||
$errors = [];
|
||||
|
||||
if (is_array($data['errors'] ?? null)) {
|
||||
foreach ($data['errors'] as $field => $messages) {
|
||||
$errors[(string) $field] = is_array($messages) ? (string) reset($messages) : (string) $messages;
|
||||
}
|
||||
}
|
||||
|
||||
if (is_string($data['field'] ?? null)) {
|
||||
$errors[$data['field']] = (string) ($data['error'] ?? $data['message'] ?? 'Ungültige Eingabe.');
|
||||
}
|
||||
|
||||
return $errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $data
|
||||
*/
|
||||
private function retryAfter(?string $header, array $data): ?int
|
||||
{
|
||||
$value = $data['retry_after'] ?? $header;
|
||||
|
||||
return is_numeric($value) ? (int) $value : null;
|
||||
}
|
||||
}
|
||||
137
app/Support/Feedback/FeedbackOutbox.php
Normal file
137
app/Support/Feedback/FeedbackOutbox.php
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
<?php
|
||||
|
||||
namespace App\Support\Feedback;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Models\VendorFeedback;
|
||||
use Filament\Notifications\Notification;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
/**
|
||||
* Warteschlange für Rückmeldungen: Die Meldung wird sofort gespeichert (samt
|
||||
* Idempotency-Key) und dann zugestellt. Klappt das nicht, versucht es der
|
||||
* Hintergrundlauf erneut – höchstens fünfmal, danach wird verworfen und die
|
||||
* Person informiert.
|
||||
*/
|
||||
class FeedbackOutbox
|
||||
{
|
||||
public const MAX_ATTEMPTS = 5;
|
||||
|
||||
public function __construct(
|
||||
private readonly FeedbackClient $client,
|
||||
private readonly FeedbackChannels $channels,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Neue Meldung speichern und direkt einen ersten Zustellversuch machen.
|
||||
*
|
||||
* @param array<string, mixed> $payload
|
||||
*/
|
||||
public function submit(?User $user, string $type, array $payload): FeedbackResult
|
||||
{
|
||||
$feedback = VendorFeedback::query()->create([
|
||||
'user_id' => $user?->id,
|
||||
'type' => $type,
|
||||
'payload' => $payload,
|
||||
// Je Meldung EINMAL erzeugt und bei jedem Wiederholungsversuch mitgeschickt.
|
||||
'idempotency_key' => bin2hex(random_bytes(16)),
|
||||
'status' => VendorFeedback::PENDING,
|
||||
'next_attempt_at' => now(),
|
||||
]);
|
||||
|
||||
$result = $this->attempt($feedback, timeout: 8);
|
||||
|
||||
// Eingabe- und Mengenfehler klärt die Person im Formular – nicht die Warteschlange.
|
||||
// Die Eingabe bleibt im Formular erhalten; eine neue Meldung bekommt einen neuen Schlüssel.
|
||||
if (in_array($result->status, [FeedbackResult::INVALID, FeedbackResult::RATE_LIMITED, FeedbackResult::DISABLED], true)) {
|
||||
$feedback->delete();
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fällige Meldungen erneut senden (Hintergrundlauf). Nacheinander, damit das
|
||||
* Gerätetoken zwischen den Anfragen nachgeführt wird.
|
||||
*/
|
||||
public function processDue(): int
|
||||
{
|
||||
$processed = 0;
|
||||
|
||||
VendorFeedback::query()
|
||||
->where('status', VendorFeedback::PENDING)
|
||||
->where('next_attempt_at', '<=', now())
|
||||
->orderBy('id')
|
||||
->limit(20)
|
||||
->get()
|
||||
->each(function (VendorFeedback $feedback) use (&$processed) {
|
||||
$this->attempt($feedback);
|
||||
$processed++;
|
||||
});
|
||||
|
||||
return $processed;
|
||||
}
|
||||
|
||||
private function attempt(VendorFeedback $feedback, int $timeout = 15): FeedbackResult
|
||||
{
|
||||
$result = $this->client->send($feedback->type, $feedback->payload, $feedback->idempotency_key, $timeout);
|
||||
$attempts = $feedback->attempts + 1;
|
||||
|
||||
switch ($result->status) {
|
||||
case FeedbackResult::SENT:
|
||||
$feedback->update(['status' => VendorFeedback::SENT, 'attempts' => $attempts, 'reference' => $result->reference, 'last_error' => null]);
|
||||
Log::info("Rückmeldung zugestellt: {$result->reference}");
|
||||
break;
|
||||
|
||||
case FeedbackResult::DISABLED:
|
||||
$this->channels->disable($feedback->type);
|
||||
$this->discard($feedback, $attempts, 'Dieser Meldeweg ist für das Programm nicht freigeschaltet.');
|
||||
break;
|
||||
|
||||
case FeedbackResult::INVALID:
|
||||
case FeedbackResult::RATE_LIMITED:
|
||||
if ($feedback->attempts > 0) {
|
||||
// Nur im Hintergrund möglich (z. B. 429 bei Wiederholung): später erneut.
|
||||
$this->reschedule($feedback, $attempts, $result->message ?? 'Später erneut versuchen.', $result->retryAfter);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->reschedule($feedback, $attempts, $result->message ?? 'Nicht zugestellt.', $result->retryAfter);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
private function reschedule(VendorFeedback $feedback, int $attempts, string $error, ?int $retryAfter): void
|
||||
{
|
||||
if ($attempts >= self::MAX_ATTEMPTS) {
|
||||
$this->discard($feedback, $attempts, $error);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// 1, 5, 15, 60 Minuten – oder so lange, wie der Server es verlangt.
|
||||
$delay = $retryAfter ?? [60, 300, 900, 3600][min($attempts - 1, 3)];
|
||||
|
||||
$feedback->update([
|
||||
'attempts' => $attempts,
|
||||
'next_attempt_at' => now()->addSeconds(max(30, $delay)),
|
||||
'last_error' => mb_substr($error, 0, 500),
|
||||
]);
|
||||
}
|
||||
|
||||
private function discard(VendorFeedback $feedback, int $attempts, string $error): void
|
||||
{
|
||||
$feedback->update(['status' => VendorFeedback::DISCARDED, 'attempts' => $attempts, 'last_error' => mb_substr($error, 0, 500)]);
|
||||
Log::warning("Rückmeldung verworfen nach {$attempts} Versuchen: {$error}");
|
||||
|
||||
if ($feedback->user) {
|
||||
Notification::make()
|
||||
->danger()
|
||||
->title('Rückmeldung konnte nicht zugestellt werden')
|
||||
->body('„'.($feedback->payload['title'] ?? '').'“ wurde nach '.$attempts.' Versuchen verworfen. Bitte senden Sie die Meldung später erneut.')
|
||||
->sendToDatabase($feedback->user);
|
||||
}
|
||||
}
|
||||
}
|
||||
58
app/Support/Feedback/FeedbackResult.php
Normal file
58
app/Support/Feedback/FeedbackResult.php
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
namespace App\Support\Feedback;
|
||||
|
||||
/**
|
||||
* Ergebnis eines Zustellversuchs.
|
||||
*/
|
||||
final class FeedbackResult
|
||||
{
|
||||
public const SENT = 'sent';
|
||||
|
||||
public const INVALID = 'invalid';
|
||||
|
||||
public const RATE_LIMITED = 'rate_limited';
|
||||
|
||||
public const DISABLED = 'disabled';
|
||||
|
||||
public const RETRY = 'retry';
|
||||
|
||||
/**
|
||||
* @param array<string, string> $errors Feld => Meldung (bei 422)
|
||||
*/
|
||||
private function __construct(
|
||||
public readonly string $status,
|
||||
public readonly ?string $reference = null,
|
||||
public readonly array $errors = [],
|
||||
public readonly ?int $retryAfter = null,
|
||||
public readonly ?string $message = null,
|
||||
) {}
|
||||
|
||||
public static function sent(string $reference): self
|
||||
{
|
||||
return new self(self::SENT, reference: $reference);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $errors
|
||||
*/
|
||||
public static function invalid(array $errors, ?string $message = null): self
|
||||
{
|
||||
return new self(self::INVALID, errors: $errors, message: $message);
|
||||
}
|
||||
|
||||
public static function rateLimited(?int $retryAfter): self
|
||||
{
|
||||
return new self(self::RATE_LIMITED, retryAfter: $retryAfter);
|
||||
}
|
||||
|
||||
public static function disabled(): self
|
||||
{
|
||||
return new self(self::DISABLED);
|
||||
}
|
||||
|
||||
public static function retry(string $message, ?int $retryAfter = null): self
|
||||
{
|
||||
return new self(self::RETRY, retryAfter: $retryAfter, message: $message);
|
||||
}
|
||||
}
|
||||
64
app/Support/Feedback/TechnicalInfo.php
Normal file
64
app/Support/Feedback/TechnicalInfo.php
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
<?php
|
||||
|
||||
namespace App\Support\Feedback;
|
||||
|
||||
use App\Support\License\VendorHttp;
|
||||
use App\Support\Update\Channels;
|
||||
use App\Support\Update\InstalledVersion;
|
||||
use App\Version;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* Technische Angaben, die jede Meldung automatisch mitschickt – und die vor dem
|
||||
* Absenden sichtbar sind. Keine personenbezogenen Daten, keine Dateipfade,
|
||||
* keine Inhalte.
|
||||
*/
|
||||
class TechnicalInfo
|
||||
{
|
||||
public function __construct(
|
||||
private readonly InstalledVersion $version,
|
||||
private readonly Channels $channels,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @return array{app_version: string, current_sha: string|null, os: string, metadata: array<string, string|int>}
|
||||
*/
|
||||
public function collect(): array
|
||||
{
|
||||
return [
|
||||
'app_version' => Version::VERSION,
|
||||
'current_sha' => $this->version->current(),
|
||||
'os' => VendorHttp::operatingSystem(),
|
||||
'metadata' => array_filter([
|
||||
'php' => PHP_VERSION,
|
||||
'datenbank' => $this->database(),
|
||||
'webserver' => $this->webserver(),
|
||||
'update_kanal' => $this->channels->active(),
|
||||
'cache' => (string) config('cache.default'),
|
||||
'queue' => (string) config('queue.default'),
|
||||
'sprache' => app()->getLocale(),
|
||||
'opcache' => function_exists('opcache_get_status') && @opcache_get_status(false) ? 'an' : 'aus',
|
||||
], fn ($value) => $value !== null && $value !== ''),
|
||||
];
|
||||
}
|
||||
|
||||
private function database(): ?string
|
||||
{
|
||||
try {
|
||||
$version = (string) DB::selectOne('select version() as v')->v;
|
||||
|
||||
return (str_contains(strtolower($version), 'mariadb') ? 'MariaDB ' : 'MySQL ').preg_replace('/-.*$/', '', $version);
|
||||
} catch (Throwable) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private function webserver(): ?string
|
||||
{
|
||||
$software = (string) ($_SERVER['SERVER_SOFTWARE'] ?? '');
|
||||
|
||||
// Nur Produkt und Version, keine Modul-Liste.
|
||||
return $software !== '' ? strtok($software, ' ') : PHP_SAPI;
|
||||
}
|
||||
}
|
||||
50
app/Support/Installation.php
Normal file
50
app/Support/Installation.php
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
|
||||
namespace App\Support;
|
||||
|
||||
use Illuminate\Encryption\Encrypter;
|
||||
|
||||
/**
|
||||
* Installationsstatus und Vorbereitung für den Web-Installer.
|
||||
*/
|
||||
class Installation
|
||||
{
|
||||
public static function isInstalled(): bool
|
||||
{
|
||||
$forced = config('inhaus.installed');
|
||||
|
||||
if ($forced !== null && $forced !== '') {
|
||||
return filter_var($forced, FILTER_VALIDATE_BOOL);
|
||||
}
|
||||
|
||||
return is_file(storage_path('.installed')) || app()->environment('local');
|
||||
}
|
||||
|
||||
public static function markInstalled(): void
|
||||
{
|
||||
file_put_contents(storage_path('.installed'), date(DATE_ATOM));
|
||||
}
|
||||
|
||||
/**
|
||||
* Frisch hochgeladene Installation: .env aus der Vorlage anlegen und einen
|
||||
* Anwendungsschlüssel erzeugen – ohne Schlüssel funktionieren weder Sitzungen
|
||||
* noch Cookies, also auch der Installer nicht.
|
||||
*/
|
||||
public static function prepareEnvironment(): void
|
||||
{
|
||||
$env = app()->environmentFilePath();
|
||||
|
||||
if (! is_file($env) && is_file(base_path('.env.example')) && is_writable(base_path())) {
|
||||
$key = 'base64:'.base64_encode(Encrypter::generateKey(config('app.cipher', 'AES-256-CBC')));
|
||||
|
||||
copy(base_path('.env.example'), $env);
|
||||
EnvFile::set($env, [
|
||||
'APP_KEY' => $key,
|
||||
'APP_ENV' => 'production',
|
||||
'APP_DEBUG' => 'false',
|
||||
]);
|
||||
|
||||
config(['app.key' => $key, 'app.env' => 'production', 'app.debug' => false]);
|
||||
}
|
||||
}
|
||||
}
|
||||
84
app/Support/License/LicenseService.php
Normal file
84
app/Support/License/LicenseService.php
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
<?php
|
||||
|
||||
namespace App\Support\License;
|
||||
|
||||
use App\Support\Update\Channels;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
/**
|
||||
* Lizenzauskunft und Geräte-Abmeldung. Ein Lizenzfehler sperrt nie das Programm –
|
||||
* er wird angezeigt und protokolliert, mehr nicht.
|
||||
*/
|
||||
class LicenseService
|
||||
{
|
||||
public function __construct(
|
||||
private readonly LicenseStore $store,
|
||||
private readonly Channels $channels,
|
||||
private readonly VendorHttp $http,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed> Antwort von /license (zusätzlich gespeichert)
|
||||
*
|
||||
* @throws ServerError
|
||||
*/
|
||||
public function check(): array
|
||||
{
|
||||
try {
|
||||
$info = $this->channels->client()->license();
|
||||
$this->store->rememberStatus($info);
|
||||
|
||||
return $info;
|
||||
} catch (ServerError $e) {
|
||||
Log::notice("Lizenzprüfung: {$e->errorCode}");
|
||||
$this->store->rememberStatus(null, $e->errorCode);
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gibt den Geräteplatz dieser Installation frei.
|
||||
*
|
||||
* @throws ServerError
|
||||
*/
|
||||
public function releaseDevice(): void
|
||||
{
|
||||
$response = VendorHttp::guard(fn () => $this->http->request((int) config('updater.timeouts.json'), identifyDevice: false)
|
||||
->post(rtrim(config('updater.api_url'), '/').'/license/release-device?software='.config('updater.software')));
|
||||
|
||||
if (! $response->successful()) {
|
||||
throw VendorHttp::errorFrom($response);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Aufbereitete Lizenzdaten für die Anzeige (aus der letzten Prüfung).
|
||||
*
|
||||
* @return array<string, mixed>|null
|
||||
*/
|
||||
public function summary(): ?array
|
||||
{
|
||||
$info = $this->store->lastStatus()['info'] ?? null;
|
||||
|
||||
if (! is_array($info)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$license = $info['license'] ?? [];
|
||||
$unlimited = (bool) ($license['unlimited'] ?? false);
|
||||
$days = $license['days_remaining'] ?? null;
|
||||
|
||||
return [
|
||||
'status' => $license['status'] ?? null,
|
||||
// valid_until = null zusammen mit unlimited = true heißt UNBEFRISTET – kein Fehler.
|
||||
'unlimited' => $unlimited,
|
||||
'valid_until' => $license['valid_until'] ?? null,
|
||||
'days_remaining' => is_numeric($days) ? (int) $days : null,
|
||||
'expired' => ! $unlimited && (bool) ($license['expired'] ?? false),
|
||||
'expires_soon' => ! $unlimited && is_numeric($days) && (int) $days >= 0 && (int) $days < 30,
|
||||
'registered_to' => $info['registered_to'] ?? [],
|
||||
'devices' => $info['devices'] ?? [],
|
||||
];
|
||||
}
|
||||
}
|
||||
161
app/Support/License/LicenseStore.php
Normal file
161
app/Support/License/LicenseStore.php
Normal file
|
|
@ -0,0 +1,161 @@
|
|||
<?php
|
||||
|
||||
namespace App\Support\License;
|
||||
|
||||
use App\Support\Update\AtomicFile;
|
||||
use Illuminate\Support\Facades\Crypt;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* Lizenzdaten dieser Installation in storage/app/license.json – außerhalb der
|
||||
* Datenbank, damit Updater und Lizenzprüfung auch bei DB-Problemen funktionieren.
|
||||
*
|
||||
* Die Lizenz-E-Mail gehört zur Lizenz, nicht zu einem Benutzerkonto.
|
||||
* Die Geräte-ID ist eine einmalig erzeugte Zufallszahl (keine Hardwarekennung).
|
||||
* Ein „Gerät“ ist ein Installationsverzeichnis.
|
||||
*/
|
||||
class LicenseStore
|
||||
{
|
||||
/** @var array<string, mixed>|null */
|
||||
private ?array $data = null;
|
||||
|
||||
public function __construct(private readonly ?string $file = null) {}
|
||||
|
||||
public function email(): ?string
|
||||
{
|
||||
return $this->read()['email'] ?? null;
|
||||
}
|
||||
|
||||
public function key(): ?string
|
||||
{
|
||||
$encrypted = $this->read()['key'] ?? null;
|
||||
|
||||
if (! is_string($encrypted) || $encrypted === '') {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
return Crypt::decryptString($encrypted);
|
||||
} catch (Throwable) {
|
||||
// APP_KEY hat sich geändert – Schlüssel muss neu eingegeben werden.
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public function hasLicense(): bool
|
||||
{
|
||||
return filled($this->email()) && filled($this->key());
|
||||
}
|
||||
|
||||
public function setLicense(string $email, string $key): void
|
||||
{
|
||||
$this->write([
|
||||
'email' => trim($email),
|
||||
'key' => Crypt::encryptString(trim($key)),
|
||||
]);
|
||||
}
|
||||
|
||||
public function clearLicense(): void
|
||||
{
|
||||
$this->write(['email' => null, 'key' => null, 'device_token' => null]);
|
||||
}
|
||||
|
||||
public function deviceId(): string
|
||||
{
|
||||
$id = $this->read()['device_id'] ?? null;
|
||||
|
||||
if (! is_string($id) || ! preg_match('/^[0-9a-f]{32}$/', $id)) {
|
||||
$id = bin2hex(random_bytes(16));
|
||||
$this->write(['device_id' => $id]);
|
||||
}
|
||||
|
||||
return $id;
|
||||
}
|
||||
|
||||
public function deviceToken(): ?string
|
||||
{
|
||||
$token = $this->read()['device_token'] ?? null;
|
||||
|
||||
return is_string($token) && $token !== '' ? $token : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Neues Gerätetoken sofort speichern – auch wenn die Antwort ein Fehler war.
|
||||
*/
|
||||
public function saveDeviceToken(string $token): void
|
||||
{
|
||||
if ($token !== '' && $token !== $this->deviceToken()) {
|
||||
$this->write(['device_token' => $token]);
|
||||
}
|
||||
}
|
||||
|
||||
public function hostname(): string
|
||||
{
|
||||
return (string) (gethostname() ?: 'unbekannt');
|
||||
}
|
||||
|
||||
/**
|
||||
* „web01:/var/www/kunde“ – damit der Kunde im Portal erkennt, welcher Geräteplatz welcher ist.
|
||||
*/
|
||||
public function deviceLabel(): string
|
||||
{
|
||||
return $this->hostname().':'.base_path();
|
||||
}
|
||||
|
||||
/**
|
||||
* Letztes Ergebnis der Lizenzprüfung (für die Anzeige ohne erneute Anfrage).
|
||||
*
|
||||
* @param array<string, mixed>|null $info
|
||||
*/
|
||||
public function rememberStatus(?array $info, ?string $errorCode = null): void
|
||||
{
|
||||
$this->write(['last_status' => [
|
||||
'info' => $info,
|
||||
'error_code' => $errorCode,
|
||||
'checked_at' => time(),
|
||||
]]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array{info: array<string, mixed>|null, error_code: string|null, checked_at: int}|null
|
||||
*/
|
||||
public function lastStatus(): ?array
|
||||
{
|
||||
$status = $this->read()['last_status'] ?? null;
|
||||
|
||||
return is_array($status) ? $status : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
private function read(): array
|
||||
{
|
||||
if ($this->data === null) {
|
||||
$decoded = json_decode((string) @file_get_contents($this->path()), true);
|
||||
$this->data = is_array($decoded) ? $decoded : [];
|
||||
}
|
||||
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $changes
|
||||
*/
|
||||
private function write(array $changes): void
|
||||
{
|
||||
// Immer frisch von der Platte lesen: parallele Anfragen können das Token rotiert haben.
|
||||
$this->data = null;
|
||||
$data = array_merge($this->read(), $changes);
|
||||
|
||||
AtomicFile::write($this->path(), json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
|
||||
@chmod($this->path(), 0600);
|
||||
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
private function path(): string
|
||||
{
|
||||
return $this->file ?? storage_path('app/license.json');
|
||||
}
|
||||
}
|
||||
38
app/Support/License/ServerError.php
Normal file
38
app/Support/License/ServerError.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
namespace App\Support\License;
|
||||
|
||||
use RuntimeException;
|
||||
|
||||
/**
|
||||
* Fehlerantwort eines Hersteller-Servers (Update-Proxy oder API) mit stabilem `code`.
|
||||
* Ausgewertet wird immer der Code, nie der Meldungstext.
|
||||
*/
|
||||
class ServerError extends RuntimeException
|
||||
{
|
||||
/**
|
||||
* @param array<string, mixed> $payload
|
||||
*/
|
||||
public function __construct(
|
||||
public readonly string $errorCode,
|
||||
public readonly int $status,
|
||||
string $message,
|
||||
public readonly array $payload = [],
|
||||
public readonly ?int $retryAfter = null,
|
||||
) {
|
||||
parent::__construct($message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Lizenzfehler, bei denen die Eingabemaske die richtige Reaktion ist.
|
||||
*/
|
||||
public function needsLicenseInput(): bool
|
||||
{
|
||||
return in_array($this->errorCode, ['license_required', 'invalid_key', 'email_mismatch'], true);
|
||||
}
|
||||
|
||||
public function isTemporary(): bool
|
||||
{
|
||||
return in_array($this->errorCode, ['mirror_pending', 'not_released', 'rate_limited', 'maintenance', 'upstream_unavailable', 'unreachable'], true);
|
||||
}
|
||||
}
|
||||
44
app/Support/License/ServerMessages.php
Normal file
44
app/Support/License/ServerMessages.php
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
namespace App\Support\License;
|
||||
|
||||
/**
|
||||
* Verständliche deutsche Meldungen zu den Fehlercodes der Hersteller-Server.
|
||||
* Lizenzfehler sperren nie das Programm – sie verhindern nur den Update-Bezug.
|
||||
*/
|
||||
final class ServerMessages
|
||||
{
|
||||
public static function for(ServerError $error): string
|
||||
{
|
||||
$wait = $error->retryAfter ? ' Bitte in etwa '.self::duration($error->retryAfter).' erneut versuchen.' : ' Bitte später erneut versuchen.';
|
||||
|
||||
return match ($error->errorCode) {
|
||||
'license_required' => 'Für Updates ist eine Lizenz nötig. Bitte Lizenz-E-Mail und Lizenzschlüssel hinterlegen.',
|
||||
'invalid_key' => 'Der Lizenzschlüssel ist unbekannt. Bitte die Eingabe prüfen.',
|
||||
'email_mismatch' => 'Die E-Mail-Adresse passt nicht zu diesem Lizenzschlüssel. Bitte die auf der Lizenz hinterlegte Adresse verwenden.',
|
||||
'license_expired' => 'Die Lizenz ist abgelaufen. Updates sind erst nach einer Verlängerung wieder verfügbar – das Portal läuft unverändert weiter.',
|
||||
'license_revoked' => 'Die Lizenz wurde gesperrt. Bitte wenden Sie sich an den Support.',
|
||||
'device_limit_reached' => sprintf(
|
||||
'Alle Geräteplätze der Lizenz sind belegt (%s von %s). Geben Sie im Kundenportal einen Platz frei oder erweitern Sie die Lizenz.',
|
||||
$error->payload['devices_used'] ?? '?',
|
||||
$error->payload['devices_max'] ?? '?',
|
||||
),
|
||||
'device_cloned' => 'Die Lizenz wird offenbar in einer kopierten Installation mehrfach genutzt. Bitte wenden Sie sich an den Support.',
|
||||
'device_id_required' => 'Die Lizenz ist gerätegebunden, es wurde aber keine Gerätekennung übermittelt. Bitte wenden Sie sich an den Support.',
|
||||
'rate_limited' => 'Zu viele Anfragen in kurzer Zeit.'.$wait,
|
||||
'maintenance' => 'Der Update-Server wird gerade gewartet.'.$wait,
|
||||
'upstream_unavailable' => 'Der Update-Server ist vorübergehend nicht erreichbar. Die installierte Version bleibt unverändert.'.$wait,
|
||||
'mirror_pending' => 'Die neue Version wird gerade bereitgestellt.'.$wait,
|
||||
'not_released' => 'Es ist noch keine Version zur Auslieferung freigegeben.'.$wait,
|
||||
'unknown_tool' => 'Dieser Update-Kanal ist beim Hersteller noch nicht eingerichtet. Bitte den Kanal „Stabil“ verwenden.',
|
||||
'unreachable' => 'Der Update-Server ist nicht erreichbar. Bitte die Internetverbindung des Servers prüfen (ausgehende HTTPS-Verbindungen müssen erlaubt sein).',
|
||||
'invalid_response' => 'Der Update-Server hat eine unerwartete Antwort geliefert.'.$wait,
|
||||
default => 'Der Update-Server meldet einen Fehler ('.$error->errorCode.').'.$wait,
|
||||
};
|
||||
}
|
||||
|
||||
private static function duration(int $seconds): string
|
||||
{
|
||||
return $seconds < 90 ? "{$seconds} Sekunden" : (int) ceil($seconds / 60).' Minuten';
|
||||
}
|
||||
}
|
||||
136
app/Support/License/VendorHttp.php
Normal file
136
app/Support/License/VendorHttp.php
Normal file
|
|
@ -0,0 +1,136 @@
|
|||
<?php
|
||||
|
||||
namespace App\Support\License;
|
||||
|
||||
use App\Support\Update\InstalledVersion;
|
||||
use App\Version;
|
||||
use GuzzleHttp\Exception\ConnectException;
|
||||
use Illuminate\Http\Client\ConnectionException;
|
||||
use Illuminate\Http\Client\PendingRequest;
|
||||
use Illuminate\Http\Client\Response;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
/**
|
||||
* HTTP-Zugang zu den Hersteller-Servern (Update-Proxy und API) mit Lizenzdaten.
|
||||
*
|
||||
* Kernpunkt ist das rotierende Gerätetoken: JEDE Antwort kann ein neues liefern
|
||||
* (Kopfzeile X-Device-Token oder JSON-Feld device_token) – auch Fehlerantworten
|
||||
* und Datei-Downloads. Es wird in der Antwort-Middleware gespeichert, bevor
|
||||
* irgendetwas anderes mit der Antwort passiert.
|
||||
*/
|
||||
class VendorHttp
|
||||
{
|
||||
public function __construct(
|
||||
private readonly LicenseStore $license,
|
||||
private readonly InstalledVersion $version,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @param bool $identifyDevice Rechnername, Installationspfad, Betriebssystem und
|
||||
* Version mitsenden (Update-Endpunkte). Für Meldungen
|
||||
* nicht nötig – dort stehen die Angaben im Körper.
|
||||
*/
|
||||
public function request(int $timeout, bool $identifyDevice = true): PendingRequest
|
||||
{
|
||||
$request = Http::timeout($timeout)
|
||||
->connectTimeout(10)
|
||||
->acceptJson()
|
||||
->withUserAgent('Inhaus/'.Version::VERSION.' (PHP '.PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION.'; '.PHP_OS_FAMILY.')')
|
||||
->withOptions([
|
||||
'allow_redirects' => [
|
||||
'max' => (int) config('updater.max_redirects', 3),
|
||||
'protocols' => ['https'],
|
||||
'strict' => true,
|
||||
],
|
||||
])
|
||||
->withResponseMiddleware(fn (ResponseInterface $response) => $this->captureDeviceToken($response));
|
||||
|
||||
// Ohne hinterlegte Lizenz gar keine Lizenz-Kopfzeilen – nie leere oder erfundene Werte.
|
||||
if ($this->license->hasLicense()) {
|
||||
$headers = [
|
||||
'X-License-Email' => $this->license->email(),
|
||||
'X-Device-Id' => $this->license->deviceId(),
|
||||
];
|
||||
|
||||
if ($token = $this->license->deviceToken()) {
|
||||
$headers['X-Device-Token'] = $token;
|
||||
}
|
||||
|
||||
$request->withToken($this->license->key())->withHeaders($headers);
|
||||
}
|
||||
|
||||
if ($identifyDevice) {
|
||||
$request->withQueryParameters(array_filter([
|
||||
'hostname' => $this->license->hostname(),
|
||||
'device_label' => $this->license->deviceLabel(),
|
||||
'os' => self::operatingSystem(),
|
||||
'app_version' => Version::VERSION,
|
||||
]));
|
||||
}
|
||||
|
||||
return $request;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wandelt Verbindungsfehler in einen ServerError mit Code „unreachable“ um.
|
||||
*
|
||||
* @template T
|
||||
*
|
||||
* @param callable(): T $callback
|
||||
* @return T
|
||||
*/
|
||||
public static function guard(callable $callback): mixed
|
||||
{
|
||||
try {
|
||||
return $callback();
|
||||
} catch (ConnectionException|ConnectException $e) {
|
||||
throw new ServerError('unreachable', 0, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fehlerantwort in einen ServerError übersetzen (Code aus dem JSON, nie aus dem Text).
|
||||
*/
|
||||
public static function errorFrom(Response $response, ?string $body = null): ServerError
|
||||
{
|
||||
$data = json_decode($body ?? $response->body(), true);
|
||||
$data = is_array($data) ? $data : [];
|
||||
$retryAfter = $data['retry_after'] ?? $response->header('Retry-After');
|
||||
|
||||
return new ServerError(
|
||||
errorCode: (string) ($data['code'] ?? 'http_'.$response->status()),
|
||||
status: $response->status(),
|
||||
message: (string) ($data['error'] ?? $data['message'] ?? 'HTTP '.$response->status()),
|
||||
payload: $data,
|
||||
retryAfter: is_numeric($retryAfter) ? (int) $retryAfter : null,
|
||||
);
|
||||
}
|
||||
|
||||
public static function operatingSystem(): string
|
||||
{
|
||||
return trim(php_uname('s').' '.php_uname('r'));
|
||||
}
|
||||
|
||||
private function captureDeviceToken(ResponseInterface $response): ResponseInterface
|
||||
{
|
||||
$token = $response->getHeaderLine('X-Device-Token');
|
||||
|
||||
if ($token === '' && str_contains($response->getHeaderLine('Content-Type'), 'json')) {
|
||||
$body = $response->getBody();
|
||||
$data = json_decode((string) $body, true);
|
||||
|
||||
if ($body->isSeekable()) {
|
||||
$body->rewind();
|
||||
}
|
||||
|
||||
$token = is_array($data) && is_string($data['device_token'] ?? null) ? $data['device_token'] : '';
|
||||
}
|
||||
|
||||
if ($token !== '') {
|
||||
$this->license->saveDeviceToken($token);
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@ namespace App\Support;
|
|||
|
||||
use App\Models\Setting;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* Systemweite Einstellungen als Schlüssel/Wert-Paare.
|
||||
|
|
@ -47,10 +48,15 @@ class Settings
|
|||
*/
|
||||
public function all(): array
|
||||
{
|
||||
return $this->values ??= Cache::rememberForever(
|
||||
self::CACHE_KEY,
|
||||
fn () => Setting::query()->pluck('value', 'key')->all(),
|
||||
);
|
||||
try {
|
||||
return $this->values ??= Cache::rememberForever(
|
||||
self::CACHE_KEY,
|
||||
fn () => Setting::query()->pluck('value', 'key')->all(),
|
||||
);
|
||||
} catch (Throwable) {
|
||||
// Noch keine Datenbank (Web-Installer) oder vorübergehend nicht erreichbar.
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
public function flush(): void
|
||||
|
|
|
|||
262
app/Support/SiteHealth.php
Normal file
262
app/Support/SiteHealth.php
Normal file
|
|
@ -0,0 +1,262 @@
|
|||
<?php
|
||||
|
||||
namespace App\Support;
|
||||
|
||||
use App\Support\License\LicenseStore;
|
||||
use App\Support\License\ServerError;
|
||||
use App\Support\License\ServerMessages;
|
||||
use App\Support\Update\MaintenanceFlag;
|
||||
use App\Support\Update\Migrations;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* Systemzustand: prüft Voraussetzungen und Betrieb. Wird im Admin-Bereich
|
||||
* angezeigt und vom Web-Installer für die Systemprüfung genutzt.
|
||||
*/
|
||||
class SiteHealth
|
||||
{
|
||||
public const OK = 'ok';
|
||||
|
||||
public const WARNING = 'warning';
|
||||
|
||||
public const ERROR = 'error';
|
||||
|
||||
public const MIN_PHP = '8.3.0';
|
||||
|
||||
public const REQUIRED_EXTENSIONS = ['pdo_mysql', 'mbstring', 'openssl', 'intl', 'gd', 'zip', 'fileinfo', 'tokenizer', 'ctype', 'xml', 'dom'];
|
||||
|
||||
/**
|
||||
* Voraussetzungen, die schon vor der Installation erfüllt sein müssen.
|
||||
*
|
||||
* @return list<array{label: string, status: string, message: string}>
|
||||
*/
|
||||
public function requirements(): array
|
||||
{
|
||||
$checks = [];
|
||||
|
||||
$checks[] = $this->check(
|
||||
'PHP-Version',
|
||||
version_compare(PHP_VERSION, self::MIN_PHP, '>='),
|
||||
'PHP '.PHP_VERSION,
|
||||
'Benötigt wird mindestens PHP '.self::MIN_PHP.'. Die Version lässt sich meist in der Verwaltung des Hosters umstellen.',
|
||||
);
|
||||
|
||||
$missing = array_values(array_filter(self::REQUIRED_EXTENSIONS, fn (string $ext) => ! extension_loaded($ext)));
|
||||
$checks[] = $this->check(
|
||||
'PHP-Erweiterungen',
|
||||
$missing === [],
|
||||
'Alle vorhanden',
|
||||
'Es fehlen: '.implode(', ', $missing).'. Bitte beim Hoster aktivieren.',
|
||||
);
|
||||
|
||||
$checks[] = [
|
||||
'label' => 'Ausgehende Verbindungen',
|
||||
'status' => function_exists('curl_init') || ini_get('allow_url_fopen') ? self::OK : self::WARNING,
|
||||
'message' => function_exists('curl_init') ? 'cURL verfügbar' : 'Weder cURL noch allow_url_fopen – Updates sind so nicht möglich.',
|
||||
];
|
||||
|
||||
foreach (['storage' => storage_path(), 'bootstrap/cache' => base_path('bootstrap/cache'), 'public/uploads' => public_path('uploads')] as $label => $path) {
|
||||
$checks[] = $this->check(
|
||||
"Schreibrechte: {$label}",
|
||||
$this->writable($path),
|
||||
'Beschreibbar',
|
||||
"Das Verzeichnis {$label} muss für den Webserver beschreibbar sein.",
|
||||
);
|
||||
}
|
||||
|
||||
$checks[] = [
|
||||
'label' => 'Schreibrechte für Updates',
|
||||
'status' => $this->writable(base_path('app')) && $this->writable(base_path('vendor')) && $this->writable(public_path('build')) ? self::OK : self::WARNING,
|
||||
'message' => $this->writable(base_path('app'))
|
||||
? 'Programmdateien sind beschreibbar – Aktualisierungen per Klick funktionieren.'
|
||||
: 'Programmdateien sind nicht beschreibbar – Aktualisierungen per Klick sind so nicht möglich.',
|
||||
];
|
||||
|
||||
return $checks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Alle Prüfungen für die Seite „Systemzustand“.
|
||||
*
|
||||
* @return array<string, list<array{label: string, status: string, message: string}>>
|
||||
*/
|
||||
public function all(): array
|
||||
{
|
||||
return [
|
||||
'Voraussetzungen' => $this->requirements(),
|
||||
'Leistung und Grenzen' => $this->performance(),
|
||||
'Betrieb' => $this->operations(),
|
||||
'Sicherheit' => $this->security(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<array{label: string, status: string, message: string}>
|
||||
*/
|
||||
private function performance(): array
|
||||
{
|
||||
$opcache = function_exists('opcache_get_status') && @opcache_get_status(false);
|
||||
$memory = self::bytes((string) ini_get('memory_limit'));
|
||||
$upload = min(self::bytes((string) ini_get('upload_max_filesize')), self::bytes((string) ini_get('post_max_size')));
|
||||
|
||||
return [
|
||||
[
|
||||
'label' => 'OPcache',
|
||||
'status' => $opcache ? self::OK : self::WARNING,
|
||||
'message' => $opcache ? 'Aktiv' : 'Nicht aktiv – das Portal läuft deutlich langsamer. Bitte beim Hoster aktivieren.',
|
||||
],
|
||||
[
|
||||
'label' => 'Arbeitsspeicher (memory_limit)',
|
||||
'status' => $memory === -1 || $memory >= 128 * 1024 ** 2 ? self::OK : self::WARNING,
|
||||
'message' => ini_get('memory_limit').($memory !== -1 && $memory < 128 * 1024 ** 2 ? ' – empfohlen sind mindestens 128M.' : ''),
|
||||
],
|
||||
[
|
||||
'label' => 'Maximale Upload-Größe',
|
||||
'status' => $upload === -1 || $upload >= 8 * 1024 ** 2 ? self::OK : self::WARNING,
|
||||
'message' => ini_get('upload_max_filesize').' / '.ini_get('post_max_size').($upload !== -1 && $upload < 8 * 1024 ** 2 ? ' – für Fotos sind mindestens 8M empfohlen.' : ''),
|
||||
],
|
||||
$this->databaseCheck(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<array{label: string, status: string, message: string}>
|
||||
*/
|
||||
private function operations(): array
|
||||
{
|
||||
$beats = app(BackgroundTasks::class)->heartbeats();
|
||||
$cron = max($beats['cron'] ?? 0, $beats['webcron'] ?? 0);
|
||||
$pseudo = $beats['pseudo'] ?? 0;
|
||||
|
||||
$background = match (true) {
|
||||
now()->getTimestamp() - $cron < 600 => ['status' => self::OK, 'message' => 'Läuft per '.(($beats['cron'] ?? 0) >= ($beats['webcron'] ?? 0) ? 'Cron' : 'Web-Cron').', zuletzt '.$this->ago($cron).'.'],
|
||||
$pseudo > 0 => ['status' => self::WARNING, 'message' => 'Läuft nur beim Seitenaufruf (Pseudo-Cron), zuletzt '.$this->ago($pseudo).'. Zuverlässiger ist ein Cronjob.'],
|
||||
default => ['status' => self::WARNING, 'message' => 'Noch kein Lauf erkannt. Bitte einen Cronjob einrichten (siehe unten).'],
|
||||
};
|
||||
|
||||
try {
|
||||
$pending = count(app(Migrations::class)->pending());
|
||||
} catch (Throwable) {
|
||||
$pending = null;
|
||||
}
|
||||
|
||||
$license = app(LicenseStore::class);
|
||||
$code = $license->lastStatus()['error_code'] ?? null;
|
||||
|
||||
return [
|
||||
['label' => 'Hintergrundaufgaben', ...$background],
|
||||
[
|
||||
'label' => 'Datenbank-Migrationen',
|
||||
'status' => $pending === 0 ? self::OK : ($pending === null ? self::ERROR : self::WARNING),
|
||||
'message' => match (true) {
|
||||
$pending === null => 'Status kann nicht gelesen werden.',
|
||||
$pending === 0 => 'Alle angewendet.',
|
||||
default => "{$pending} ausstehend – unter „Aktualisierung“ ausführen.",
|
||||
},
|
||||
],
|
||||
[
|
||||
'label' => 'Lizenz',
|
||||
'status' => ! $license->hasLicense() || $code ? self::WARNING : self::OK,
|
||||
'message' => match (true) {
|
||||
! $license->hasLicense() => 'Keine Lizenz hinterlegt – Updates sind nicht möglich.',
|
||||
$code !== null => ServerMessages::for(new ServerError($code, 0, $code)),
|
||||
default => 'Hinterlegt.',
|
||||
},
|
||||
],
|
||||
[
|
||||
'label' => 'Wartungsmodus',
|
||||
'status' => app(MaintenanceFlag::class)->isActive() ? self::WARNING : self::OK,
|
||||
'message' => app(MaintenanceFlag::class)->isActive() ? 'Aktiv – es läuft gerade eine Aktualisierung.' : 'Aus',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<array{label: string, status: string, message: string}>
|
||||
*/
|
||||
private function security(): array
|
||||
{
|
||||
$https = str_starts_with((string) config('app.url'), 'https://');
|
||||
|
||||
return [
|
||||
[
|
||||
'label' => 'Fehlerdetails (APP_DEBUG)',
|
||||
'status' => match (true) {
|
||||
config('app.debug') && app()->isProduction() => self::ERROR,
|
||||
(bool) config('app.debug') => self::WARNING,
|
||||
default => self::OK,
|
||||
},
|
||||
'message' => config('app.debug') ? 'Eingeschaltet – im Betrieb unbedingt ausschalten, sonst werden interne Details angezeigt.' : 'Ausgeschaltet',
|
||||
],
|
||||
[
|
||||
'label' => 'Verschlüsselte Verbindung',
|
||||
'status' => $https ? self::OK : self::WARNING,
|
||||
'message' => $https ? 'Das Portal läuft über HTTPS.' : 'APP_URL beginnt nicht mit https:// – Anmeldedaten würden unverschlüsselt übertragen.',
|
||||
],
|
||||
[
|
||||
'label' => 'Anwendungsschlüssel',
|
||||
'status' => filled(config('app.key')) ? self::OK : self::ERROR,
|
||||
'message' => filled(config('app.key')) ? 'Gesetzt' : 'APP_KEY fehlt.',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array{label: string, status: string, message: string}
|
||||
*/
|
||||
private function databaseCheck(): array
|
||||
{
|
||||
try {
|
||||
$version = (string) DB::selectOne('select version() as v')->v;
|
||||
$mariadb = str_contains(strtolower($version), 'mariadb');
|
||||
$number = preg_replace('/^(\d+\.\d+\.\d+).*$/', '$1', $version);
|
||||
$ok = version_compare($number, $mariadb ? '10.6.0' : '8.0.0', '>=');
|
||||
|
||||
return [
|
||||
'label' => 'Datenbank',
|
||||
'status' => $ok ? self::OK : self::WARNING,
|
||||
'message' => ($mariadb ? 'MariaDB ' : 'MySQL ').$number.($ok ? '' : ' – unterstützt werden MySQL ab 8.0 und MariaDB ab 10.6.'),
|
||||
];
|
||||
} catch (Throwable) {
|
||||
return ['label' => 'Datenbank', 'status' => self::ERROR, 'message' => 'Keine Verbindung.'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array{label: string, status: string, message: string}
|
||||
*/
|
||||
private function check(string $label, bool $ok, string $okMessage, string $errorMessage): array
|
||||
{
|
||||
return ['label' => $label, 'status' => $ok ? self::OK : self::ERROR, 'message' => $ok ? $okMessage : $errorMessage];
|
||||
}
|
||||
|
||||
private function writable(string $path): bool
|
||||
{
|
||||
return is_dir($path) ? is_writable($path) : is_writable(dirname($path));
|
||||
}
|
||||
|
||||
private function ago(int $timestamp): string
|
||||
{
|
||||
return Carbon::createFromTimestamp($timestamp)->locale('de')->diffForHumans();
|
||||
}
|
||||
|
||||
public static function bytes(string $value): int
|
||||
{
|
||||
$value = trim($value);
|
||||
|
||||
if ($value === '' || $value === '-1') {
|
||||
return -1;
|
||||
}
|
||||
|
||||
$number = (int) $value;
|
||||
|
||||
return match (strtolower(substr($value, -1))) {
|
||||
'g' => $number * 1024 ** 3,
|
||||
'm' => $number * 1024 ** 2,
|
||||
'k' => $number * 1024,
|
||||
default => $number,
|
||||
};
|
||||
}
|
||||
}
|
||||
33
app/Support/Update/AtomicFile.php
Normal file
33
app/Support/Update/AtomicFile.php
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
namespace App\Support\Update;
|
||||
|
||||
use RuntimeException;
|
||||
|
||||
/**
|
||||
* Schreibt Dateien erst daneben und benennt sie dann um – ein Abbruch mittendrin
|
||||
* hinterlässt so nie eine halbe Datei.
|
||||
*/
|
||||
final class AtomicFile
|
||||
{
|
||||
public static function write(string $path, string $contents): void
|
||||
{
|
||||
$directory = dirname($path);
|
||||
|
||||
if (! is_dir($directory) && ! @mkdir($directory, 0775, true) && ! is_dir($directory)) {
|
||||
throw new RuntimeException("Verzeichnis {$directory} kann nicht angelegt werden. Bitte Schreibrechte prüfen.");
|
||||
}
|
||||
|
||||
$temporary = $path.'.tmp-'.bin2hex(random_bytes(4));
|
||||
|
||||
if (@file_put_contents($temporary, $contents, LOCK_EX) === false) {
|
||||
throw new RuntimeException("Datei {$path} ist nicht schreibbar. Bitte Schreibrechte für {$directory} prüfen.");
|
||||
}
|
||||
|
||||
if (! @rename($temporary, $path)) {
|
||||
@unlink($temporary);
|
||||
|
||||
throw new RuntimeException("Datei {$path} kann nicht ersetzt werden. Bitte Schreibrechte prüfen.");
|
||||
}
|
||||
}
|
||||
}
|
||||
45
app/Support/Update/Changelog.php
Normal file
45
app/Support/Update/Changelog.php
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
|
||||
namespace App\Support\Update;
|
||||
|
||||
use League\CommonMark\GithubFlavoredMarkdownConverter;
|
||||
|
||||
/**
|
||||
* Zerlegt CHANGELOG.md an „## <version>“-Abschnitten und rendert Markdown
|
||||
* sicher (kein Roh-HTML, keine unsicheren Links).
|
||||
*/
|
||||
class Changelog
|
||||
{
|
||||
/**
|
||||
* @return list<array{version: string, heading: string, html: string}>
|
||||
*/
|
||||
public function sections(?string $markdown = null): array
|
||||
{
|
||||
$markdown ??= (string) @file_get_contents(base_path('CHANGELOG.md'));
|
||||
$parts = preg_split('/^## +/m', $markdown) ?: [];
|
||||
array_shift($parts); // Einleitung vor dem ersten Abschnitt
|
||||
|
||||
return array_values(array_map(function (string $part) {
|
||||
[$heading, $body] = array_pad(explode("\n", $part, 2), 2, '');
|
||||
$heading = trim($heading);
|
||||
preg_match('/\d+\.\d+\.\d+(?:[-+][\w.]+)?/', $heading, $m);
|
||||
|
||||
return [
|
||||
'version' => $m[0] ?? $heading,
|
||||
'heading' => $heading,
|
||||
'html' => $this->toHtml(trim($body)),
|
||||
];
|
||||
}, $parts));
|
||||
}
|
||||
|
||||
public function toHtml(string $markdown): string
|
||||
{
|
||||
$converter = new GithubFlavoredMarkdownConverter([
|
||||
'html_input' => 'strip',
|
||||
'allow_unsafe_links' => false,
|
||||
'max_nesting_level' => 20,
|
||||
]);
|
||||
|
||||
return (string) $converter->convert($markdown);
|
||||
}
|
||||
}
|
||||
65
app/Support/Update/Channels.php
Normal file
65
app/Support/Update/Channels.php
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
|
||||
namespace App\Support\Update;
|
||||
|
||||
use App\Support\License\VendorHttp;
|
||||
use App\Support\Settings;
|
||||
use InvalidArgumentException;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* Update-Kanäle: Auswahl persistiert in den Einstellungen (Standard „stable“),
|
||||
* Factory für den Client des aktiven oder eines übergebenen Kanals.
|
||||
*/
|
||||
class Channels
|
||||
{
|
||||
public function __construct(
|
||||
private readonly Settings $settings,
|
||||
private readonly VendorHttp $http,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @return array<string, string> Schlüssel => Bezeichnung
|
||||
*/
|
||||
public function all(): array
|
||||
{
|
||||
return collect(config('updater.channels'))->map(fn (array $c) => $c['label'])->all();
|
||||
}
|
||||
|
||||
public function active(): string
|
||||
{
|
||||
try {
|
||||
$channel = $this->settings->get('updater.channel');
|
||||
} catch (Throwable) {
|
||||
$channel = null; // Datenbank nicht erreichbar – Standardkanal.
|
||||
}
|
||||
|
||||
return is_string($channel) && $this->exists($channel) ? $channel : config('updater.default_channel', 'stable');
|
||||
}
|
||||
|
||||
public function setActive(string $channel): void
|
||||
{
|
||||
$this->assertExists($channel);
|
||||
$this->settings->set('updater.channel', $channel);
|
||||
}
|
||||
|
||||
public function client(?string $channel = null): UpdateClient
|
||||
{
|
||||
$channel ??= $this->active();
|
||||
$this->assertExists($channel);
|
||||
|
||||
return new UpdateClient($this->http, config("updater.channels.{$channel}.url"));
|
||||
}
|
||||
|
||||
public function exists(string $channel): bool
|
||||
{
|
||||
return is_array(config("updater.channels.{$channel}"));
|
||||
}
|
||||
|
||||
private function assertExists(string $channel): void
|
||||
{
|
||||
if (! $this->exists($channel)) {
|
||||
throw new InvalidArgumentException("Unbekannter Update-Kanal: {$channel}");
|
||||
}
|
||||
}
|
||||
}
|
||||
28
app/Support/Update/Filesystem.php
Normal file
28
app/Support/Update/Filesystem.php
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
namespace App\Support\Update;
|
||||
|
||||
use FilesystemIterator;
|
||||
use RecursiveDirectoryIterator;
|
||||
use RecursiveIteratorIterator;
|
||||
|
||||
final class Filesystem
|
||||
{
|
||||
public static function deleteDirectory(string $dir): void
|
||||
{
|
||||
if (! is_dir($dir)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$items = new RecursiveIteratorIterator(
|
||||
new RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS),
|
||||
RecursiveIteratorIterator::CHILD_FIRST,
|
||||
);
|
||||
|
||||
foreach ($items as $item) {
|
||||
$item->isDir() && ! $item->isLink() ? @rmdir($item->getPathname()) : @unlink($item->getPathname());
|
||||
}
|
||||
|
||||
@rmdir($dir);
|
||||
}
|
||||
}
|
||||
60
app/Support/Update/InstalledVersion.php
Normal file
60
app/Support/Update/InstalledVersion.php
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
<?php
|
||||
|
||||
namespace App\Support\Update;
|
||||
|
||||
use App\Version;
|
||||
use InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* Installierter Stand als Git-Commit-SHA – bewusst in einer Datei, nicht in der
|
||||
* Datenbank, damit der Updater ihn auch lesen kann, wenn die DB hängt.
|
||||
* storage/ ist ein geschützter Pfad: ein Update überschreibt die Datei nie.
|
||||
*/
|
||||
class InstalledVersion
|
||||
{
|
||||
public function __construct(private readonly ?string $file = null) {}
|
||||
|
||||
public function current(): ?string
|
||||
{
|
||||
$sha = @file_get_contents($this->path());
|
||||
|
||||
return is_string($sha) && self::isSha(trim($sha)) ? strtolower(trim($sha)) : null;
|
||||
}
|
||||
|
||||
public function save(string $sha): void
|
||||
{
|
||||
if (! self::isSha($sha)) {
|
||||
throw new InvalidArgumentException('Ungültiger Commit-Stand: erwartet werden 40 Hex-Zeichen.');
|
||||
}
|
||||
|
||||
AtomicFile::write($this->path(), strtolower($sha));
|
||||
}
|
||||
|
||||
public function short(): ?string
|
||||
{
|
||||
return ($sha = $this->current()) ? substr($sha, 0, 7) : null;
|
||||
}
|
||||
|
||||
public function release(): string
|
||||
{
|
||||
return Version::VERSION;
|
||||
}
|
||||
|
||||
/**
|
||||
* „1.4.2 (a1b2c3d)“ bzw. nur „1.4.2“, solange kein Stand bekannt ist.
|
||||
*/
|
||||
public function full(): string
|
||||
{
|
||||
return $this->release().(($short = $this->short()) ? " ({$short})" : '');
|
||||
}
|
||||
|
||||
public static function isSha(string $value): bool
|
||||
{
|
||||
return (bool) preg_match('/^[0-9a-f]{40}$/i', $value);
|
||||
}
|
||||
|
||||
private function path(): string
|
||||
{
|
||||
return $this->file ?? storage_path('.version');
|
||||
}
|
||||
}
|
||||
59
app/Support/Update/MaintenanceFlag.php
Normal file
59
app/Support/Update/MaintenanceFlag.php
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
<?php
|
||||
|
||||
namespace App\Support\Update;
|
||||
|
||||
/**
|
||||
* Wartungsmodus während eines Updates als Flag-Datei storage/.maintenance.
|
||||
*
|
||||
* Selbstheilend: Ein abgelaufenes „until“ wird beim Prüfen entfernt. Ohne das
|
||||
* würde ein Absturz mitten im Update die Installation dauerhaft sperren – und
|
||||
* niemand käme mehr an die Oberfläche, um den Modus abzuschalten.
|
||||
*/
|
||||
class MaintenanceFlag
|
||||
{
|
||||
public function __construct(private readonly ?string $file = null) {}
|
||||
|
||||
public function activate(int $maxSeconds = 600): void
|
||||
{
|
||||
AtomicFile::write($this->path(), json_encode([
|
||||
'since' => time(),
|
||||
'until' => time() + $maxSeconds,
|
||||
]));
|
||||
}
|
||||
|
||||
public function deactivate(): void
|
||||
{
|
||||
@unlink($this->path());
|
||||
}
|
||||
|
||||
public function isActive(): bool
|
||||
{
|
||||
if (! is_file($this->path())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$data = json_decode((string) @file_get_contents($this->path()), true);
|
||||
$until = is_array($data) ? (int) ($data['until'] ?? 0) : 0;
|
||||
|
||||
if ($until <= time()) {
|
||||
$this->deactivate();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function retryAfter(): int
|
||||
{
|
||||
$data = json_decode((string) @file_get_contents($this->path()), true);
|
||||
$remaining = is_array($data) ? (int) ($data['until'] ?? 0) - time() : 0;
|
||||
|
||||
return max(5, min(60, $remaining));
|
||||
}
|
||||
|
||||
private function path(): string
|
||||
{
|
||||
return $this->file ?? storage_path('.maintenance');
|
||||
}
|
||||
}
|
||||
81
app/Support/Update/Migrations.php
Normal file
81
app/Support/Update/Migrations.php
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
<?php
|
||||
|
||||
namespace App\Support\Update;
|
||||
|
||||
use Illuminate\Database\Migrations\Migrator;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
|
||||
/**
|
||||
* Migrationen ohne Shell: Status, Ausführen und Fingerabdruck über die Dateien.
|
||||
*/
|
||||
class Migrations
|
||||
{
|
||||
public function __construct(private readonly Migrator $migrator) {}
|
||||
|
||||
/**
|
||||
* @return list<array{name: string, ran: bool}>
|
||||
*/
|
||||
public function status(): array
|
||||
{
|
||||
$ran = $this->ran();
|
||||
|
||||
return array_map(fn (string $name) => [
|
||||
'name' => $name,
|
||||
'ran' => in_array($name, $ran, true),
|
||||
], array_keys($this->files()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<string>
|
||||
*/
|
||||
public function pending(): array
|
||||
{
|
||||
return array_values(array_diff(array_keys($this->files()), $this->ran()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Führt ausstehende Migrationen aus und gibt deren Anzahl zurück.
|
||||
*/
|
||||
public function run(): int
|
||||
{
|
||||
$before = count($this->ran());
|
||||
|
||||
Artisan::call('migrate', ['--force' => true]);
|
||||
|
||||
return count($this->ran()) - $before;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fingerabdruck über die Liste der Migrationsdateien. Ändert sich nur, wenn
|
||||
* Migrationen dazukommen – dann lohnt sich ein Blick auf die Datenbank.
|
||||
*/
|
||||
public function fingerprint(): string
|
||||
{
|
||||
return sha1(implode("\n", array_keys($this->files())));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string> Name => Pfad
|
||||
*/
|
||||
private function files(): array
|
||||
{
|
||||
$files = $this->migrator->getMigrationFiles(array_merge(
|
||||
[database_path('migrations')],
|
||||
$this->migrator->paths(),
|
||||
));
|
||||
|
||||
ksort($files);
|
||||
|
||||
return $files;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<string>
|
||||
*/
|
||||
private function ran(): array
|
||||
{
|
||||
$repository = $this->migrator->getRepository();
|
||||
|
||||
return $repository->repositoryExists() ? $repository->getRan() : [];
|
||||
}
|
||||
}
|
||||
37
app/Support/Update/ProtectedPaths.php
Normal file
37
app/Support/Update/ProtectedPaths.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
namespace App\Support\Update;
|
||||
|
||||
/**
|
||||
* Pfade, die ein Update nie überschreibt. Verzeichnisse enden mit „/“ und
|
||||
* schützen alles darunter; Dateien werden exakt verglichen.
|
||||
*/
|
||||
class ProtectedPaths
|
||||
{
|
||||
/**
|
||||
* @param list<string> $paths
|
||||
*/
|
||||
public function __construct(private readonly array $paths) {}
|
||||
|
||||
public static function fromConfig(): self
|
||||
{
|
||||
return new self(config('updater.protected_paths', []));
|
||||
}
|
||||
|
||||
public function isProtected(string $relativePath): bool
|
||||
{
|
||||
$path = ltrim(str_replace('\\', '/', $relativePath), '/');
|
||||
|
||||
foreach ($this->paths as $protected) {
|
||||
if (str_ends_with($protected, '/')) {
|
||||
if (str_starts_with($path.'/', $protected)) {
|
||||
return true;
|
||||
}
|
||||
} elseif ($path === $protected) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
77
app/Support/Update/StagingApplier.php
Normal file
77
app/Support/Update/StagingApplier.php
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
<?php
|
||||
|
||||
namespace App\Support\Update;
|
||||
|
||||
use FilesystemIterator;
|
||||
use RecursiveDirectoryIterator;
|
||||
use RecursiveIteratorIterator;
|
||||
use RuntimeException;
|
||||
|
||||
/**
|
||||
* Legt den entpackten Stand über die Produktion.
|
||||
*
|
||||
* - Geschützte Pfade werden übersprungen.
|
||||
* - Jede Datei wird erst daneben geschrieben und dann umbenannt – ein Abbruch
|
||||
* hinterlässt keine halbe PHP-Datei, die den nächsten Aufruf abwürgt.
|
||||
* - Nur überschreiben und ergänzen, NIE löschen: Ein Fehler in der
|
||||
* Pfadberechnung nimmt so keine Nutzdaten mit.
|
||||
*/
|
||||
class StagingApplier
|
||||
{
|
||||
public function __construct(private readonly ProtectedPaths $protected) {}
|
||||
|
||||
/**
|
||||
* @return array{copied: int, skipped: int}
|
||||
*/
|
||||
public function apply(string $stagingDir, string $targetDir): array
|
||||
{
|
||||
$copied = 0;
|
||||
$skipped = 0;
|
||||
$stagingDir = rtrim((string) realpath($stagingDir), DIRECTORY_SEPARATOR);
|
||||
|
||||
$files = new RecursiveIteratorIterator(
|
||||
new RecursiveDirectoryIterator($stagingDir, FilesystemIterator::SKIP_DOTS),
|
||||
);
|
||||
|
||||
foreach ($files as $file) {
|
||||
if ($file->isDir() || $file->isLink()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$relative = ltrim(str_replace('\\', '/', substr($file->getPathname(), strlen($stagingDir))), '/');
|
||||
|
||||
if ($this->protected->isProtected($relative)) {
|
||||
$skipped++;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$destination = rtrim($targetDir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.$relative;
|
||||
$directory = dirname($destination);
|
||||
|
||||
if (! is_dir($directory) && ! @mkdir($directory, 0775, true) && ! is_dir($directory)) {
|
||||
throw new RuntimeException("Verzeichnis {$directory} kann nicht angelegt werden. Bitte Schreibrechte für das Installationsverzeichnis prüfen.");
|
||||
}
|
||||
|
||||
$temporary = $destination.'.update-'.bin2hex(random_bytes(3));
|
||||
|
||||
if (! @copy($file->getPathname(), $temporary)) {
|
||||
throw new RuntimeException("Datei {$relative} ist nicht schreibbar. Bitte Schreibrechte für {$directory} prüfen.");
|
||||
}
|
||||
|
||||
if (is_file($destination)) {
|
||||
@chmod($temporary, fileperms($destination) & 0777);
|
||||
}
|
||||
|
||||
if (! @rename($temporary, $destination)) {
|
||||
@unlink($temporary);
|
||||
|
||||
throw new RuntimeException("Datei {$relative} kann nicht ersetzt werden. Bitte Schreibrechte für {$directory} prüfen.");
|
||||
}
|
||||
|
||||
$copied++;
|
||||
}
|
||||
|
||||
return ['copied' => $copied, 'skipped' => $skipped];
|
||||
}
|
||||
}
|
||||
53
app/Support/Update/UpdateCheck.php
Normal file
53
app/Support/Update/UpdateCheck.php
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
<?php
|
||||
|
||||
namespace App\Support\Update;
|
||||
|
||||
/**
|
||||
* „Nach Updates suchen“: fragt /check und bereitet das Ergebnis für die Anzeige auf.
|
||||
* Zeigt bewusst keine Commit-Texte – nur ob es Neues gibt und was laut
|
||||
* Änderungsprotokoll neu ist.
|
||||
*/
|
||||
class UpdateCheck
|
||||
{
|
||||
public function __construct(
|
||||
private readonly Channels $channels,
|
||||
private readonly InstalledVersion $version,
|
||||
private readonly Changelog $changelog,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function run(?string $channel = null): array
|
||||
{
|
||||
$current = $this->version->current();
|
||||
$result = $this->channels->client($channel)->check($current);
|
||||
$latest = $result['latest_sha'] ?? null;
|
||||
|
||||
// Frische Installation: Die erste Prüfung liefert den Stand zum Merken.
|
||||
if ($current === null && is_string($latest) && InstalledVersion::isSha($latest)) {
|
||||
$this->version->save($latest);
|
||||
}
|
||||
|
||||
$preview = $result['changelog_preview'] ?? null;
|
||||
$entries = is_array($preview['entries'] ?? null) ? $preview['entries'] : [];
|
||||
|
||||
return [
|
||||
'has_update' => (bool) ($result['has_update'] ?? false),
|
||||
'latest_sha' => is_string($latest) ? $latest : null,
|
||||
'latest_short' => is_string($latest) ? substr($latest, 0, 7) : null,
|
||||
'version' => $result['version'] ?? null,
|
||||
'released_at' => $result['released_at'] ?? null,
|
||||
'versions_behind' => (int) ($result['versions_behind'] ?? 0),
|
||||
'channel_switch' => $result['channel_switch'] ?? null,
|
||||
// Feld kann fehlen – dann gibt es nichts zu berichten (kein leerer Kasten).
|
||||
'changelog' => array_map(fn (array $entry) => [
|
||||
'version' => $entry['version'] ?? null,
|
||||
'heading' => $entry['heading'] ?? null,
|
||||
'html' => $this->changelog->toHtml((string) ($entry['text'] ?? '')),
|
||||
], $entries),
|
||||
'changelog_complete' => $preview === null ? true : (bool) ($preview['complete'] ?? true),
|
||||
'changelog_url' => config('updater.changelog_url'),
|
||||
];
|
||||
}
|
||||
}
|
||||
114
app/Support/Update/UpdateClient.php
Normal file
114
app/Support/Update/UpdateClient.php
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
<?php
|
||||
|
||||
namespace App\Support\Update;
|
||||
|
||||
use App\Support\License\ServerError;
|
||||
use App\Support\License\VendorHttp;
|
||||
use Illuminate\Http\Client\Response;
|
||||
|
||||
/**
|
||||
* Zugriff auf den Update-Proxy eines Kanals. Kennt keine Tags und keine Releases:
|
||||
* Es zählt der Stand des Branches, identifiziert über den Commit-SHA.
|
||||
*/
|
||||
class UpdateClient
|
||||
{
|
||||
public function __construct(
|
||||
private readonly VendorHttp $http,
|
||||
private readonly string $baseUrl,
|
||||
) {
|
||||
if (! str_starts_with($baseUrl, 'https://')) {
|
||||
throw new \InvalidArgumentException('Update-Server müssen per HTTPS angesprochen werden.');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function version(): array
|
||||
{
|
||||
return $this->json('version');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function check(?string $currentSha): array
|
||||
{
|
||||
return $this->json('check', $currentSha ? ['current_sha' => $currentSha] : []);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function license(): array
|
||||
{
|
||||
return $this->json('license');
|
||||
}
|
||||
|
||||
public function changelog(): string
|
||||
{
|
||||
$response = $this->send(fn () => $this->http->request((int) config('updater.timeouts.json'))
|
||||
->accept('text/markdown')
|
||||
->get($this->url('changelog'), ['format' => 'raw']));
|
||||
|
||||
return $response->body();
|
||||
}
|
||||
|
||||
/**
|
||||
* ZIP in eine Datei streamen – nicht in den Speicher.
|
||||
*
|
||||
* @return array{sha: string|null, sha256: string|null}
|
||||
*/
|
||||
public function downloadZip(string $sha, string $target): array
|
||||
{
|
||||
$response = $this->send(fn () => $this->http->request((int) config('updater.timeouts.zip'))
|
||||
->accept('application/zip')
|
||||
->sink($target)
|
||||
->get($this->url('zip'), ['ref' => $sha]), sinkedTo: $target);
|
||||
|
||||
return [
|
||||
'sha' => $response->header('X-Commit-Sha') ?: null,
|
||||
'sha256' => $response->header('X-Content-Sha256') ?: null,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $query
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
private function json(string $path, array $query = []): array
|
||||
{
|
||||
$response = $this->send(fn () => $this->http->request((int) config('updater.timeouts.json'))
|
||||
->get($this->url($path), $query));
|
||||
|
||||
$data = $response->json();
|
||||
|
||||
if (! is_array($data)) {
|
||||
throw new ServerError('invalid_response', $response->status(), 'Antwort ist kein JSON.');
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param callable(): Response $callback
|
||||
*/
|
||||
private function send(callable $callback, ?string $sinkedTo = null): Response
|
||||
{
|
||||
$response = VendorHttp::guard($callback);
|
||||
|
||||
if (! $response->successful()) {
|
||||
// Bei Downloads steht die Fehlerantwort in der Zieldatei.
|
||||
$body = $sinkedTo && is_file($sinkedTo) ? (string) file_get_contents($sinkedTo) : null;
|
||||
|
||||
throw VendorHttp::errorFrom($response, $body);
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
private function url(string $path): string
|
||||
{
|
||||
return rtrim($this->baseUrl, '/').'/'.$path;
|
||||
}
|
||||
}
|
||||
70
app/Support/Update/UpdateProgress.php
Normal file
70
app/Support/Update/UpdateProgress.php
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
<?php
|
||||
|
||||
namespace App\Support\Update;
|
||||
|
||||
/**
|
||||
* Fortschritt eines laufenden Updates in storage/.update-progress – das Frontend
|
||||
* fragt ihn alle ~2 Sekunden ab.
|
||||
*/
|
||||
class UpdateProgress
|
||||
{
|
||||
/** Ohne Lebenszeichen gilt ein Lauf nach dieser Zeit als abgestürzt. */
|
||||
public const STALE_AFTER_SECONDS = 600;
|
||||
|
||||
public function __construct(private readonly ?string $file = null) {}
|
||||
|
||||
public function set(int $pct, string $step, string $text = ''): void
|
||||
{
|
||||
AtomicFile::write($this->path(), json_encode([
|
||||
'pct' => $pct,
|
||||
'step' => $step,
|
||||
'text' => $text,
|
||||
'ts' => time(),
|
||||
], JSON_UNESCAPED_UNICODE));
|
||||
}
|
||||
|
||||
/**
|
||||
* Fehlerzustand: pct = -1 unterscheidet ihn eindeutig von „0 % erledigt“.
|
||||
*/
|
||||
public function fail(string $text): void
|
||||
{
|
||||
$this->set(-1, 'error', $text);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array{pct: int, step: string, text: string, ts: int}
|
||||
*/
|
||||
public function get(): array
|
||||
{
|
||||
$data = json_decode((string) @file_get_contents($this->path()), true);
|
||||
|
||||
if (! is_array($data) || ! isset($data['pct'], $data['step'])) {
|
||||
return ['pct' => 0, 'step' => 'idle', 'text' => '', 'ts' => 0];
|
||||
}
|
||||
|
||||
return [
|
||||
'pct' => (int) $data['pct'],
|
||||
'step' => (string) $data['step'],
|
||||
'text' => (string) ($data['text'] ?? ''),
|
||||
'ts' => (int) ($data['ts'] ?? 0),
|
||||
];
|
||||
}
|
||||
|
||||
public function isRunning(): bool
|
||||
{
|
||||
$progress = $this->get();
|
||||
|
||||
return ! in_array($progress['step'], ['idle', 'done', 'error'], true)
|
||||
&& time() - $progress['ts'] < self::STALE_AFTER_SECONDS;
|
||||
}
|
||||
|
||||
public function clear(): void
|
||||
{
|
||||
@unlink($this->path());
|
||||
}
|
||||
|
||||
private function path(): string
|
||||
{
|
||||
return $this->file ?? storage_path('.update-progress');
|
||||
}
|
||||
}
|
||||
139
app/Support/Update/Updater.php
Normal file
139
app/Support/Update/Updater.php
Normal file
|
|
@ -0,0 +1,139 @@
|
|||
<?php
|
||||
|
||||
namespace App\Support\Update;
|
||||
|
||||
use App\Support\Audit;
|
||||
use App\Support\License\ServerError;
|
||||
use App\Support\License\ServerMessages;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use RuntimeException;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* Self-Updater: holt den Stand des aktiven Kanals als ZIP, legt ihn über die
|
||||
* Produktion (mit geschützten Pfaden), migriert, leert Caches und merkt sich
|
||||
* den neuen Commit-SHA. Ablauf und Prozentwerte nach docs/specs/self-updater.md.
|
||||
*/
|
||||
class Updater
|
||||
{
|
||||
public function __construct(
|
||||
private readonly Channels $channels,
|
||||
private readonly InstalledVersion $version,
|
||||
private readonly UpdateProgress $progress,
|
||||
private readonly MaintenanceFlag $maintenance,
|
||||
private readonly ZipExtractor $extractor,
|
||||
private readonly Migrations $migrations,
|
||||
private readonly ?string $basePath = null,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @return array{sha: string, migrations: int, files: int}
|
||||
*/
|
||||
public function installUpdate(?int $userId = null, ?string $channel = null): array
|
||||
{
|
||||
$channel ??= $this->channels->active();
|
||||
$zipFile = storage_path('app/update-'.bin2hex(random_bytes(4)).'.zip');
|
||||
$staging = storage_path('.update-staging');
|
||||
$targetSha = null;
|
||||
$migrationCount = 0;
|
||||
|
||||
try {
|
||||
$this->progress->set(0, 'maintenance', 'Wartungsmodus wird aktiviert …');
|
||||
$this->maintenance->activate((int) config('updater.maintenance_max_seconds', 600));
|
||||
|
||||
$this->progress->set(5, 'version', 'Neueste Version wird ermittelt …');
|
||||
$client = $this->channels->client($channel);
|
||||
$targetSha = (string) ($client->version()['sha'] ?? '');
|
||||
|
||||
if (! InstalledVersion::isSha($targetSha)) {
|
||||
throw new RuntimeException('Der Update-Server hat keinen gültigen Versionsstand gemeldet.');
|
||||
}
|
||||
|
||||
$this->progress->set(20, 'download', 'Neue Version wird heruntergeladen …');
|
||||
$headers = $client->downloadZip($targetSha, $zipFile);
|
||||
$this->verifyZip($zipFile, $headers);
|
||||
|
||||
$this->progress->set(50, 'extract', 'Archiv wird entpackt …');
|
||||
$this->extractor->extract($zipFile, $staging);
|
||||
|
||||
$this->progress->set(65, 'apply', 'Dateien werden übernommen …');
|
||||
$result = (new StagingApplier(ProtectedPaths::fromConfig()))->apply($staging, $this->basePath ?? base_path());
|
||||
|
||||
$this->progress->set(80, 'migrate', 'Datenbank wird aktualisiert …');
|
||||
$migrationCount = $this->migrations->run();
|
||||
|
||||
$this->progress->set(90, 'cache', 'Zwischenspeicher werden geleert …');
|
||||
$this->clearCaches();
|
||||
|
||||
$this->version->save($targetSha);
|
||||
@file_put_contents(storage_path('.migrations-fingerprint'), $this->migrations->fingerprint());
|
||||
|
||||
Audit::log('update.installed', [
|
||||
'channel' => $channel,
|
||||
'sha' => $targetSha,
|
||||
'migrations' => $migrationCount,
|
||||
'files' => $result['copied'],
|
||||
], $userId);
|
||||
|
||||
$this->progress->set(100, 'done', 'Aktualisierung abgeschlossen.');
|
||||
|
||||
return ['sha' => $targetSha, 'migrations' => $migrationCount, 'files' => $result['copied']];
|
||||
} catch (Throwable $e) {
|
||||
$message = $e instanceof ServerError ? ServerMessages::for($e) : $e->getMessage();
|
||||
|
||||
$this->progress->fail($message);
|
||||
Log::error('Update fehlgeschlagen: '.$e->getMessage(), ['exception' => $e]);
|
||||
Audit::log('update.failed', [
|
||||
'channel' => $channel,
|
||||
'sha' => $targetSha,
|
||||
'migrations' => $migrationCount,
|
||||
'error' => $message,
|
||||
'code' => $e instanceof ServerError ? $e->errorCode : null,
|
||||
], $userId);
|
||||
|
||||
throw $e;
|
||||
} finally {
|
||||
$this->maintenance->deactivate();
|
||||
@unlink($zipFile);
|
||||
Filesystem::deleteDirectory($staging);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array{sha: string|null, sha256: string|null} $headers
|
||||
*/
|
||||
private function verifyZip(string $file, array $headers): void
|
||||
{
|
||||
$handle = @fopen($file, 'rb');
|
||||
$magic = $handle ? fread($handle, 2) : '';
|
||||
|
||||
if ($handle) {
|
||||
fclose($handle);
|
||||
}
|
||||
|
||||
if ($magic !== 'PK') {
|
||||
throw new RuntimeException('Die Antwort des Update-Servers ist kein ZIP-Archiv (vermutlich eine Fehlerseite). Die installierte Version bleibt unverändert.');
|
||||
}
|
||||
|
||||
if ($headers['sha256'] && ! hash_equals(strtolower($headers['sha256']), hash_file('sha256', $file))) {
|
||||
throw new RuntimeException('Das heruntergeladene Archiv ist beschädigt (Prüfsumme stimmt nicht). Bitte erneut versuchen.');
|
||||
}
|
||||
}
|
||||
|
||||
private function clearCaches(): void
|
||||
{
|
||||
foreach (['cache:clear', 'view:clear', 'config:clear', 'route:clear', 'event:clear'] as $command) {
|
||||
try {
|
||||
Artisan::call($command);
|
||||
} catch (Throwable $e) {
|
||||
Log::warning("{$command} fehlgeschlagen: ".$e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
// Bytecode-Cache verwerfen – sonst läuft noch eine Weile der alte Code.
|
||||
if (function_exists('opcache_reset')) {
|
||||
@opcache_reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
146
app/Support/Update/ZipExtractor.php
Normal file
146
app/Support/Update/ZipExtractor.php
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
<?php
|
||||
|
||||
namespace App\Support\Update;
|
||||
|
||||
use RuntimeException;
|
||||
use ZipArchive;
|
||||
|
||||
/**
|
||||
* Entpackt ein Update-Archiv ins Staging und entfernt dabei den gemeinsamen
|
||||
* Top-Level-Ordner („repo-<sha>/“).
|
||||
*
|
||||
* ZIP-Slip-Schutz in zwei Stufen:
|
||||
* a) Eintragsnamen vorab ablehnen: absolute Pfade, Laufwerksbuchstaben,
|
||||
* „..“-Segmente, Null-Bytes.
|
||||
* b) Nach dem Schreiben den aufgelösten Pfad prüfen – liegt er wirklich im
|
||||
* Staging? Sonst sofort wieder löschen. Fängt ab, was (a) übersieht.
|
||||
*/
|
||||
class ZipExtractor
|
||||
{
|
||||
/**
|
||||
* @return int Anzahl entpackter Dateien
|
||||
*/
|
||||
public function extract(string $zipFile, string $targetDir): int
|
||||
{
|
||||
$zip = new ZipArchive;
|
||||
|
||||
if ($zip->open($zipFile) !== true) {
|
||||
throw new RuntimeException('Das heruntergeladene Archiv kann nicht geöffnet werden.');
|
||||
}
|
||||
|
||||
try {
|
||||
$this->recreate($targetDir);
|
||||
$root = realpath($targetDir);
|
||||
$prefix = $this->commonPrefix($zip);
|
||||
$count = 0;
|
||||
|
||||
for ($i = 0; $i < $zip->numFiles; $i++) {
|
||||
$name = (string) $zip->getNameIndex($i);
|
||||
|
||||
if (! self::isSafeEntryName($name)) {
|
||||
throw new RuntimeException("Unsicherer Pfad im Archiv abgelehnt: {$name}");
|
||||
}
|
||||
|
||||
$relative = substr($name, strlen($prefix));
|
||||
|
||||
if ($relative === '' || $relative === false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$destination = $root.DIRECTORY_SEPARATOR.$relative;
|
||||
|
||||
if (str_ends_with($name, '/')) {
|
||||
$this->makeDirectory($destination);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->makeDirectory(dirname($destination));
|
||||
$stream = $zip->getStream($name);
|
||||
|
||||
if ($stream === false || @file_put_contents($destination, $stream) === false) {
|
||||
throw new RuntimeException("Datei {$relative} kann nicht entpackt werden. Bitte Schreibrechte für storage/ prüfen.");
|
||||
}
|
||||
|
||||
fclose($stream);
|
||||
|
||||
// Stufe b: aufgelösten Pfad prüfen (Symlinks, ungewöhnliche Kodierungen).
|
||||
$resolved = realpath($destination);
|
||||
|
||||
if ($resolved === false || ! str_starts_with($resolved, $root.DIRECTORY_SEPARATOR)) {
|
||||
@unlink($destination);
|
||||
|
||||
throw new RuntimeException("Datei außerhalb des Entpackverzeichnisses abgelehnt: {$name}");
|
||||
}
|
||||
|
||||
$count++;
|
||||
}
|
||||
|
||||
return $count;
|
||||
} finally {
|
||||
$zip->close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Stufe a: Eintragsnamen vor dem Schreiben prüfen.
|
||||
*/
|
||||
public static function isSafeEntryName(string $name): bool
|
||||
{
|
||||
if ($name === '' || str_contains($name, "\0")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$normalized = str_replace('\\', '/', $name);
|
||||
|
||||
if (str_starts_with($normalized, '/') || preg_match('#^[a-zA-Z]:#', $normalized)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach (explode('/', $normalized) as $segment) {
|
||||
if ($segment === '..') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* GitHub-Stil: genau EIN gemeinsamer Top-Level-Ordner, der entfernt wird.
|
||||
*/
|
||||
private function commonPrefix(ZipArchive $zip): string
|
||||
{
|
||||
$prefix = null;
|
||||
|
||||
for ($i = 0; $i < $zip->numFiles; $i++) {
|
||||
$name = str_replace('\\', '/', (string) $zip->getNameIndex($i));
|
||||
$first = explode('/', $name, 2)[0].'/';
|
||||
|
||||
if (! str_contains($name, '/')) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if ($prefix === null) {
|
||||
$prefix = $first;
|
||||
} elseif ($prefix !== $first) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
return $prefix ?? '';
|
||||
}
|
||||
|
||||
private function recreate(string $dir): void
|
||||
{
|
||||
Filesystem::deleteDirectory($dir);
|
||||
$this->makeDirectory($dir);
|
||||
}
|
||||
|
||||
private function makeDirectory(string $dir): void
|
||||
{
|
||||
if (! is_dir($dir) && ! @mkdir($dir, 0775, true) && ! is_dir($dir)) {
|
||||
throw new RuntimeException("Verzeichnis {$dir} kann nicht angelegt werden. Bitte Schreibrechte prüfen.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -9,5 +9,5 @@ namespace App;
|
|||
*/
|
||||
final class Version
|
||||
{
|
||||
public const VERSION = '0.1.0';
|
||||
public const VERSION = '0.2.0';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
<?php
|
||||
|
||||
use App\Http\Middleware\EnsureNotInMaintenance;
|
||||
use App\Http\Middleware\HandleInertiaRequests;
|
||||
use App\Http\Middleware\RedirectToInstaller;
|
||||
use App\Http\Middleware\RunPendingMigrations;
|
||||
use App\Http\Middleware\RunPseudoCron;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Foundation\Configuration\Exceptions;
|
||||
use Illuminate\Foundation\Configuration\Middleware;
|
||||
|
|
@ -13,8 +17,13 @@ return Application::configure(basePath: dirname(__DIR__))
|
|||
health: '/up',
|
||||
)
|
||||
->withMiddleware(function (Middleware $middleware): void {
|
||||
$middleware->web(append: [
|
||||
$middleware->web(prepend: [
|
||||
EnsureNotInMaintenance::class,
|
||||
RedirectToInstaller::class,
|
||||
], append: [
|
||||
RunPendingMigrations::class,
|
||||
HandleInertiaRequests::class,
|
||||
RunPseudoCron::class,
|
||||
]);
|
||||
})
|
||||
->withExceptions(function (Exceptions $exceptions): void {
|
||||
|
|
|
|||
9
config/inhaus.php
Normal file
9
config/inhaus.php
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
|
||||
// Erzwingt den Installationsstatus (Tests, Sonderfälle). Leer = automatisch:
|
||||
// eingerichtet, wenn storage/.installed existiert oder APP_ENV=local ist.
|
||||
'installed' => env('INHAUS_INSTALLED'),
|
||||
|
||||
];
|
||||
61
config/updater.php
Normal file
61
config/updater.php
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
| Self-Updater und Lizenz – siehe docs/specs/self-updater.md und docs/PLAN.md (Abschnitt 5).
|
||||
| Der technische Schlüssel beim Hersteller ist „mitarbeiterportal“, unabhängig vom Produktnamen.
|
||||
*/
|
||||
|
||||
return [
|
||||
|
||||
'software' => 'mitarbeiterportal',
|
||||
|
||||
// Update-Kanäle: jeweils eigene Proxy-Basis-URL. Standard ist „stable“.
|
||||
'channels' => [
|
||||
'stable' => [
|
||||
'label' => 'Stabil',
|
||||
'url' => 'https://update.loheide.cloud/mitarbeiterportal',
|
||||
],
|
||||
'development' => [
|
||||
'label' => 'Entwicklung',
|
||||
'url' => 'https://update.loheide.cloud/mitarbeiterportal-development',
|
||||
],
|
||||
],
|
||||
|
||||
'default_channel' => 'stable',
|
||||
|
||||
'api_url' => 'https://api.loheide.cloud/v1',
|
||||
|
||||
'changelog_url' => 'https://update.loheide.cloud/mitarbeiterportal/changelog',
|
||||
|
||||
'timeouts' => [
|
||||
'json' => 20,
|
||||
'zip' => 180,
|
||||
],
|
||||
|
||||
'max_redirects' => 3,
|
||||
|
||||
// Werden beim Übernehmen eines Updates NIE überschrieben.
|
||||
// Verzeichnisse mit Schrägstrich am Ende, Dateien exakt.
|
||||
// Abweichung von der Vorgabe: vendor/ ist bewusst NICHT geschützt (docs/PLAN.md, 5.2).
|
||||
'protected_paths' => [
|
||||
'.env',
|
||||
'.git/',
|
||||
'storage/',
|
||||
'bootstrap/cache/',
|
||||
'node_modules/',
|
||||
'vendor-dev/',
|
||||
'composer.lock',
|
||||
'package-lock.json',
|
||||
'plugins/',
|
||||
'public/storage/',
|
||||
'public/uploads/',
|
||||
'public/hot',
|
||||
'config/local.php',
|
||||
'.htaccess',
|
||||
'database/database.sqlite',
|
||||
],
|
||||
|
||||
// Wartungsmodus läuft spätestens nach dieser Zeit von allein aus.
|
||||
'maintenance_max_seconds' => 600,
|
||||
|
||||
];
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('audit_logs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->string('action', 100);
|
||||
$table->json('data')->nullable();
|
||||
$table->timestamp('created_at')->useCurrent();
|
||||
|
||||
$table->index(['action', 'created_at']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('audit_logs');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
/**
|
||||
* Rückmeldungen an den Hersteller – zugleich Warteschlange für Meldungen, die
|
||||
* (noch) nicht zugestellt werden konnten. Der Idempotency-Key liegt bewusst im
|
||||
* selben Datensatz: Er muss bei jedem Wiederholungsversuch derselbe sein.
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('vendor_feedback', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->string('type', 30);
|
||||
$table->json('payload');
|
||||
$table->char('idempotency_key', 32)->unique();
|
||||
$table->string('status', 20)->default('pending');
|
||||
$table->unsignedTinyInteger('attempts')->default(0);
|
||||
$table->timestamp('next_attempt_at')->nullable();
|
||||
$table->string('reference', 50)->nullable();
|
||||
$table->string('last_error', 500)->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['status', 'next_attempt_at']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('vendor_feedback');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('notifications', function (Blueprint $table) {
|
||||
$table->uuid('id')->primary();
|
||||
$table->string('type');
|
||||
$table->morphs('notifiable');
|
||||
$table->text('data');
|
||||
$table->timestamp('read_at')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('notifications');
|
||||
}
|
||||
};
|
||||
65
docs/INSTALLATION.md
Normal file
65
docs/INSTALLATION.md
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
# Installation und Betrieb
|
||||
|
||||
Diese Anleitung richtet sich an die IT bzw. an die Person, die das Portal beim
|
||||
Hoster einrichtet. Shell-Zugang wird nicht benötigt.
|
||||
|
||||
## Voraussetzungen
|
||||
|
||||
- PHP **8.3** oder neuer mit den Erweiterungen `pdo_mysql`, `mbstring`,
|
||||
`openssl`, `intl`, `gd`, `zip`, `fileinfo`, `tokenizer`, `ctype`, `xml`, `dom`
|
||||
- **MySQL ab 8.0** oder **MariaDB ab 10.6** – eine leere Datenbank samt Benutzer
|
||||
- Apache mit `mod_rewrite` (Einstellungen per `.htaccess` müssen erlaubt sein)
|
||||
- Empfohlen: OPcache, `memory_limit` ≥ 128M, `upload_max_filesize` ≥ 8M, HTTPS
|
||||
- Ausgehende HTTPS-Verbindungen zu `update.loheide.cloud` und
|
||||
`api.loheide.cloud` (für Aktualisierungen und Rückmeldungen)
|
||||
|
||||
## Einrichtung
|
||||
|
||||
1. Das Installationsarchiv entpacken und **alle** Dateien per FTP/SFTP oder
|
||||
Dateimanager in das gewünschte Verzeichnis hochladen.
|
||||
2. Webroot festlegen:
|
||||
- **Empfohlen:** Die Domain zeigt auf das Unterverzeichnis `public/`.
|
||||
- Lässt der Hoster das nicht zu, zeigt die Domain auf das
|
||||
Installationsverzeichnis – die mitgelieferte `.htaccess` leitet dann alle
|
||||
Anfragen nach `public/` weiter.
|
||||
3. Schreibrechte für den Webserver: `storage/`, `bootstrap/cache/`,
|
||||
`public/uploads/` und – damit Aktualisierungen per Klick funktionieren – für
|
||||
das gesamte Installationsverzeichnis.
|
||||
4. Die Adresse des Portals im Browser aufrufen. Der Einrichtungsassistent führt
|
||||
durch **Systemprüfung → Datenbank → Administrator**. Lizenz-E-Mail und
|
||||
Lizenzschlüssel können dabei oder später eingetragen werden.
|
||||
5. Mit dem Administratorkonto anmelden und unter **Administration →
|
||||
Systemzustand** die Hinweise durchgehen.
|
||||
|
||||
> Solange die Einrichtung nicht abgeschlossen ist, kann jede Person, die die
|
||||
> Adresse kennt, den Assistenten ausfüllen. Die Einrichtung daher direkt nach
|
||||
> dem Hochladen abschließen.
|
||||
|
||||
## Hintergrundaufgaben
|
||||
|
||||
Rückmeldungen, geplante Inhalte und Aufräumarbeiten laufen im Hintergrund. Die
|
||||
genauen Angaben zeigt **Systemzustand** an.
|
||||
|
||||
- **Am besten:** Cronjob beim Hoster, jede Minute:
|
||||
`cd /pfad/zum/portal && php artisan schedule:run`
|
||||
- **Ohne Cron-Zugang:** die unter Systemzustand angezeigte geheime
|
||||
Web-Cron-Adresse jede Minute von einem externen Cron-Dienst aufrufen lassen.
|
||||
- **Ohne beides** laufen die Aufgaben beim Aufruf von Seiten mit – das
|
||||
funktioniert, ist aber weniger zuverlässig.
|
||||
|
||||
## Aktualisierungen
|
||||
|
||||
Unter **Administration → Aktualisierung**: „Nach Updates suchen“ und „Jetzt
|
||||
aktualisieren“. Das Portal zeigt währenddessen eine Wartungsseite, übernimmt
|
||||
die neue Fassung, bringt die Datenbank auf den neuen Stand und ist nach
|
||||
wenigen Minuten wieder erreichbar. `.env`, `storage/`, hochgeladene Dateien
|
||||
und Plugins werden dabei nie verändert.
|
||||
|
||||
Voraussetzung ist eine gültige Lizenz. Ein Lizenzproblem schränkt die Nutzung
|
||||
des Portals nicht ein – es verhindert nur den Bezug neuer Fassungen.
|
||||
|
||||
## Umzug auf einen anderen Server
|
||||
|
||||
Alle Dateien (inklusive `.env` und `storage/`) und die Datenbank übertragen.
|
||||
Anschließend unter **Aktualisierung** die alte Installation abmelden bzw. die
|
||||
Lizenz neu prüfen – jede Installation belegt einen Geräteplatz der Lizenz.
|
||||
|
|
@ -473,9 +473,9 @@ Kantinenplan, Ideenbox, Urlaubsanträge.
|
|||
|
||||
| Phase | Inhalt |
|
||||
|---|---|
|
||||
| **0 – Fundament** | Laravel-Skeleton, Docker-Dev, CI-Matrix, `VERSION` + `CHANGELOG.md` + Build-Workflow (Assets/`vendor` mitversioniert), lokaler Login, User & Profil, Header mit Avatar, Design-System (Tailwind/shadcn-vue) mit Design-Tokens, **Basis-Branding (Portalname, Logo, Markenfarbe)**, Personenverzeichnis, Schnellzugriffe, Filament-Grundgerüst |
|
||||
| **0b – News & Termine (vorgezogen)** | Neuigkeiten mit Kategorien, Titelbild, Planung, Hervorhebung (Slider); Termine mit .ics-Export; Startseite nach Intranet-Vorbild. Redaktion vorerst nur im Admin-Backend – Rechte pro Kategorie, Redaktion im Portal und Umzug in Plugins folgen mit Phase 2 |
|
||||
| **1 – Betrieb & Lizenz** | **Self-Updater** (inkl. Wartungsmodus, Auto-Migration, Kanäle), **Lizenz-Speicher & -Client** (rotierendes Token), Seite „Aktualisierung“, **Rückmeldungen**, Web-Installer, Site Health, Cron-Varianten |
|
||||
| **0 – Fundament** ✅ | Laravel-Skeleton, Docker-Dev, CI-Matrix, `VERSION` + `CHANGELOG.md` + Build-Workflow (Assets/`vendor` mitversioniert), lokaler Login, User & Profil, Header mit Avatar, Design-System (Tailwind/shadcn-vue) mit Design-Tokens, **Basis-Branding (Portalname, Logo, Markenfarbe)**, Personenverzeichnis, Schnellzugriffe, Filament-Grundgerüst |
|
||||
| **0b – News & Termine (vorgezogen)** ✅ | Neuigkeiten mit Kategorien, Titelbild, Planung, Hervorhebung (Slider); Termine mit .ics-Export; Startseite nach Intranet-Vorbild. Redaktion vorerst nur im Admin-Backend – Rechte pro Kategorie, Redaktion im Portal und Umzug in Plugins folgen mit Phase 2 |
|
||||
| **1 – Betrieb & Lizenz** ✅ | **Self-Updater** (inkl. Wartungsmodus, Auto-Migration, Kanäle), **Lizenz-Speicher & -Client** (rotierendes Token), Seite „Aktualisierung“, **Rückmeldungen**, Web-Installer, Site Health, Cron-Varianten |
|
||||
| **2 – Plugin-System & Rechte** | Plugin-Loader, Hooks/Filter, Registries, Recovery-Modus, Import-Map-Frontend; Rollen, Grants, Zielgruppen, Rechte-Cache, Rechte-Prüfer |
|
||||
| **3 – Entra ID** | OIDC-Login, JIT, Gruppen-/App-Rollen-Mapping (additiv), Graph-Profil- & Foto-Sync, Delta-Sync |
|
||||
| **4 – CMS** | Seitenbaum, Pagebuilder, Versionen; News-Freigabe-Workflow und Redaktion im Portal |
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
</source>
|
||||
<php>
|
||||
<env name="APP_ENV" value="testing"/>
|
||||
<env name="INHAUS_INSTALLED" value="true"/>
|
||||
<env name="APP_MAINTENANCE_DRIVER" value="file"/>
|
||||
<env name="BCRYPT_ROUNDS" value="4"/>
|
||||
<env name="BROADCAST_CONNECTION" value="null"/>
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/build/assets/Dashboard-Cy80rTIG.js
Normal file
1
public/build/assets/Dashboard-Cy80rTIG.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
import{$t as e,J as t,K as n,Ut as r,Xt as i,Y as a,lr as o,q as s}from"./app-CsynT-MH.js";var c={class:`grid place-items-center px-6 py-10 text-center`},l={class:`mt-3 text-sm font-medium`},u={key:0,class:`mt-1 max-w-sm text-[13px] text-muted-foreground`},d={__name:`EmptyState`,props:{icon:{type:[Object,Function],required:!0},title:{type:String,required:!0},text:{type:String,default:``}},setup(d){return(f,p)=>(r(),a(`div`,c,[(r(),s(e(d.icon),{class:`size-8 text-muted-foreground`,"stroke-width":1.5})),n(`p`,l,o(d.title),1),d.text?(r(),a(`p`,u,o(d.text),1)):t(``,!0),i(f.$slots,`default`)]))}};export{d as t};
|
||||
import{$t as e,J as t,K as n,Ut as r,Xt as i,Y as a,lr as o,q as s}from"./app-D5-myltL.js";var c={class:`grid place-items-center px-6 py-10 text-center`},l={class:`mt-3 text-sm font-medium`},u={key:0,class:`mt-1 max-w-sm text-[13px] text-muted-foreground`},d={__name:`EmptyState`,props:{icon:{type:[Object,Function],required:!0},title:{type:String,required:!0},text:{type:String,default:``}},setup(d){return(f,p)=>(r(),a(`div`,c,[(r(),s(e(d.icon),{class:`size-8 text-muted-foreground`,"stroke-width":1.5})),n(`p`,l,o(d.title),1),d.text?(r(),a(`p`,u,o(d.text),1)):t(``,!0),i(f.$slots,`default`)]))}};export{d as t};
|
||||
|
|
@ -1 +1 @@
|
|||
import{G as e,K as t,Ut as n,Y as r,lr as i}from"./app-CsynT-MH.js";import{t as a}from"./format-Dlm0nTI_.js";var o={class:`grid w-12 shrink-0 place-items-center rounded-md bg-muted py-1.5 leading-none`},s={class:`text-xl font-semibold`},c={class:`mt-1 text-[10px] font-semibold tracking-wide text-muted-foreground`},l={__name:`EventDateBlock`,props:{date:{type:String,required:!0}},setup(l){let u=l,d=e(()=>a(u.date));return(e,a)=>(n(),r(`div`,o,[t(`span`,s,i(d.value.day),1),t(`span`,c,i(d.value.month),1)]))}};export{l as t};
|
||||
import{G as e,K as t,Ut as n,Y as r,lr as i}from"./app-D5-myltL.js";import{t as a}from"./format-Dlm0nTI_.js";var o={class:`grid w-12 shrink-0 place-items-center rounded-md bg-muted py-1.5 leading-none`},s={class:`text-xl font-semibold`},c={class:`mt-1 text-[10px] font-semibold tracking-wide text-muted-foreground`},l={__name:`EventDateBlock`,props:{date:{type:String,required:!0}},setup(l){let u=l,d=e(()=>a(u.date));return(e,a)=>(n(),r(`div`,o,[t(`span`,s,i(d.value.day),1),t(`span`,c,i(d.value.month),1)]))}};export{l as t};
|
||||
|
|
@ -1 +1 @@
|
|||
import{J as e,K as t,Sn as n,Ut as r,Y as i,k as a,lr as o,n as s,nt as c,q as l,r as u,rr as d,tt as f}from"./app-CsynT-MH.js";import{k as p}from"./BrandLogo-BTmxPYut.js";import{t as m}from"./arrow-left-mgtA-v8n.js";import{t as h}from"./button-By-E3x2v.js";import{r as g,t as _}from"./FormField-VAcUnlCp.js";import{t as v}from"./GuestLayout-Cij2uD05.js";var y={key:0,class:`mb-6 rounded-md border border-brand-200 bg-brand-soft px-4 py-3 text-sm text-brand-soft-foreground`},b={__name:`ForgotPassword`,props:{status:{type:String,default:null}},setup(b){let x=u({email:``});return(u,S)=>(r(),l(v,{title:`Passwort vergessen`,description:`Wir senden Ihnen einen Link, mit dem Sie ein neues Passwort festlegen können.`},{default:n(()=>[b.status?(r(),i(`div`,y,o(b.status),1)):e(``,!0),t(`form`,{class:`grid gap-5`,onSubmit:S[1]||=a(e=>d(x).post(`/forgot-password`),[`prevent`])},[c(_,{id:`email`,label:`E-Mail-Adresse`,error:d(x).errors.email},{default:n(()=>[c(d(g),{id:`email`,modelValue:d(x).email,"onUpdate:modelValue":S[0]||=e=>d(x).email=e,type:`email`,autocomplete:`username`,autofocus:``,class:`h-10`},null,8,[`modelValue`])]),_:1},8,[`error`]),c(d(h),{type:`submit`,size:`lg`,class:`h-10 w-full`,disabled:d(x).processing},{default:n(()=>[d(x).processing?(r(),l(d(p),{key:0,class:`animate-spin`})):e(``,!0),S[2]||=f(` Link senden `,-1)]),_:1},8,[`disabled`]),c(d(s),{href:`/login`,class:`inline-flex items-center justify-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground`},{default:n(()=>[c(d(m),{class:`size-4`}),S[3]||=f(` Zurück zur Anmeldung `,-1)]),_:1})],32)]),_:1}))}};export{b as default};
|
||||
import{J as e,K as t,Sn as n,Ut as r,Y as i,k as a,lr as o,n as s,nt as c,q as l,r as u,rr as d,tt as f}from"./app-D5-myltL.js";import{k as p}from"./BrandLogo-6n9qq87f.js";import{t as m}from"./arrow-left-99a39ArM.js";import{t as h}from"./button-CK8gfgLI.js";import{r as g,t as _}from"./FormField-BxtniYWy.js";import{t as v}from"./GuestLayout-DXTg9GcL.js";var y={key:0,class:`mb-6 rounded-md border border-brand-200 bg-brand-soft px-4 py-3 text-sm text-brand-soft-foreground`},b={__name:`ForgotPassword`,props:{status:{type:String,default:null}},setup(b){let x=u({email:``});return(u,S)=>(r(),l(v,{title:`Passwort vergessen`,description:`Wir senden Ihnen einen Link, mit dem Sie ein neues Passwort festlegen können.`},{default:n(()=>[b.status?(r(),i(`div`,y,o(b.status),1)):e(``,!0),t(`form`,{class:`grid gap-5`,onSubmit:S[1]||=a(e=>d(x).post(`/forgot-password`),[`prevent`])},[c(_,{id:`email`,label:`E-Mail-Adresse`,error:d(x).errors.email},{default:n(()=>[c(d(g),{id:`email`,modelValue:d(x).email,"onUpdate:modelValue":S[0]||=e=>d(x).email=e,type:`email`,autocomplete:`username`,autofocus:``,class:`h-10`},null,8,[`modelValue`])]),_:1},8,[`error`]),c(d(h),{type:`submit`,size:`lg`,class:`h-10 w-full`,disabled:d(x).processing},{default:n(()=>[d(x).processing?(r(),l(d(p),{key:0,class:`animate-spin`})):e(``,!0),S[2]||=f(` Link senden `,-1)]),_:1},8,[`disabled`]),c(d(s),{href:`/login`,class:`inline-flex items-center justify-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground`},{default:n(()=>[c(d(m),{class:`size-4`}),S[3]||=f(` Zurück zur Anmeldung `,-1)]),_:1})],32)]),_:1}))}};export{b as default};
|
||||
|
|
@ -1 +1 @@
|
|||
import{E as e,J as t,Sn as n,Ut as r,Xt as i,Y as a,it as o,kt as s,lr as c,nt as l,or as u,q as d,rr as f,tt as p,wn as m,zn as h}from"./app-CsynT-MH.js";import{a as g,d as _,p as v,u as y}from"./BrandLogo-BTmxPYut.js";import{r as b}from"./dist-Bb3V_-fF.js";var x=o({__name:`Label`,props:{for:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`label`}},setup(e){let t=e;return v(),(e,a)=>(r(),d(f(_),s(t,{onMousedown:a[0]||=e=>{!e.defaultPrevented&&e.detail>1&&e.preventDefault()}}),{default:n(()=>[i(e.$slots,`default`)]),_:3},16))}}),S=o({__name:`Input`,props:{defaultValue:{},modelValue:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(t,{emit:n}){let i=t,o=b(i,`modelValue`,n,{passive:!0,defaultValue:i.defaultValue});return(t,n)=>m((r(),a(`input`,{"onUpdate:modelValue":n[0]||=e=>h(o)?o.value=e:null,"data-slot":`input`,class:u(f(y)(`file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,`focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3`,`aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,i.class))},null,2)),[[e,f(o)]])}}),C=o({__name:`Label`,props:{for:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,a=g(t,`class`);return(e,o)=>(r(),d(f(x),s({"data-slot":`label`},f(a),{class:f(y)(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,t.class)}),{default:n(()=>[i(e.$slots,`default`)]),_:3},16,[`class`]))}}),w={class:`grid content-start gap-1.5`},T={key:0,class:`text-[13px] text-destructive`},E={key:1,class:`text-[13px] text-muted-foreground`},D={__name:`FormField`,props:{id:{type:String,required:!0},label:{type:String,required:!0},error:{type:String,default:``},hint:{type:String,default:``}},setup(e){return(o,s)=>(r(),a(`div`,w,[l(f(C),{for:e.id,class:`text-[13px] font-medium`},{default:n(()=>[p(c(e.label),1)]),_:1},8,[`for`]),i(o.$slots,`default`),e.error?(r(),a(`p`,T,c(e.error),1)):e.hint?(r(),a(`p`,E,c(e.hint),1)):t(``,!0)]))}};export{C as n,S as r,D as t};
|
||||
import{E as e,J as t,Sn as n,Ut as r,Xt as i,Y as a,it as o,kt as s,lr as c,nt as l,or as u,q as d,rr as f,tt as p,wn as m,zn as h}from"./app-D5-myltL.js";import{a as g,d as _,p as v,u as y}from"./BrandLogo-6n9qq87f.js";import{r as b}from"./dist-BaRwaKfU.js";var x=o({__name:`Label`,props:{for:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`label`}},setup(e){let t=e;return v(),(e,a)=>(r(),d(f(_),s(t,{onMousedown:a[0]||=e=>{!e.defaultPrevented&&e.detail>1&&e.preventDefault()}}),{default:n(()=>[i(e.$slots,`default`)]),_:3},16))}}),S=o({__name:`Input`,props:{defaultValue:{},modelValue:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(t,{emit:n}){let i=t,o=b(i,`modelValue`,n,{passive:!0,defaultValue:i.defaultValue});return(t,n)=>m((r(),a(`input`,{"onUpdate:modelValue":n[0]||=e=>h(o)?o.value=e:null,"data-slot":`input`,class:u(f(y)(`file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,`focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3`,`aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,i.class))},null,2)),[[e,f(o)]])}}),C=o({__name:`Label`,props:{for:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,a=g(t,`class`);return(e,o)=>(r(),d(f(x),s({"data-slot":`label`},f(a),{class:f(y)(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,t.class)}),{default:n(()=>[i(e.$slots,`default`)]),_:3},16,[`class`]))}}),w={class:`grid content-start gap-1.5`},T={key:0,class:`text-[13px] text-destructive`},E={key:1,class:`text-[13px] text-muted-foreground`},D={__name:`FormField`,props:{id:{type:String,required:!0},label:{type:String,required:!0},error:{type:String,default:``},hint:{type:String,default:``}},setup(e){return(o,s)=>(r(),a(`div`,w,[l(f(C),{for:e.id,class:`text-[13px] font-medium`},{default:n(()=>[p(c(e.label),1)]),_:1},8,[`for`]),i(o.$slots,`default`),e.error?(r(),a(`p`,T,c(e.error),1)):e.hint?(r(),a(`p`,E,c(e.hint),1)):t(``,!0)]))}};export{C as n,S as r,D as t};
|
||||
|
|
@ -1 +1 @@
|
|||
import{F as e,G as t,J as n,K as r,Ut as i,Xt as a,Y as o,i as s,lr as c,nt as l,rr as u,t as d}from"./app-CsynT-MH.js";import{t as f}from"./BrandLogo-BTmxPYut.js";var p={class:`grid min-h-screen lg:grid-cols-[minmax(0,5fr)_minmax(0,6fr)]`},m={class:`relative hidden overflow-hidden bg-brand text-brand-foreground lg:flex lg:flex-col lg:justify-between lg:p-12`},h={class:`relative max-w-md`},g={class:`mt-4 text-[15px] opacity-80`},_={class:`relative text-xs opacity-60`},v={class:`flex items-center justify-center bg-background px-4 py-12 sm:px-8`},y={class:`w-full max-w-[400px]`},b={class:`mb-10 lg:hidden`},x={class:`text-2xl font-semibold tracking-tight`},S={key:0,class:`mt-2 text-sm text-muted-foreground`},C={class:`mt-8`},w={__name:`GuestLayout`,props:{title:{type:String,default:``},description:{type:String,default:``}},setup(w){let T=w,E=t(()=>s().props.branding);return(t,s)=>(i(),o(e,null,[l(u(d),{title:T.title},null,8,[`title`]),r(`div`,p,[r(`aside`,m,[s[1]||=r(`div`,{class:`pointer-events-none absolute inset-0 opacity-[0.12]`,style:{"background-image":`radial-gradient(circle at 20% 20%, white 0, transparent 45%), radial-gradient(circle at 90% 80%, white 0, transparent 40%)`}},null,-1),l(f,{inverted:``,class:`relative`}),r(`div`,h,[s[0]||=r(`p`,{class:`text-3xl leading-tight font-semibold tracking-tight`},`Alles Wichtige für Ihren Arbeitsalltag – an einem Ort.`,-1),r(`p`,g,`Neuigkeiten, Ansprechpartner und Anwendungen von `+c(E.value.portal_name)+`.`,1)]),r(`p`,_,`© `+c(new Date().getFullYear())+` `+c(E.value.portal_name),1)]),r(`main`,v,[r(`div`,y,[r(`div`,b,[l(f)]),r(`h1`,x,c(T.title),1),T.description?(i(),o(`p`,S,c(T.description),1)):n(``,!0),r(`div`,C,[a(t.$slots,`default`)])])])])],64))}};export{w as t};
|
||||
import{F as e,G as t,J as n,K as r,Ut as i,Xt as a,Y as o,i as s,lr as c,nt as l,rr as u,t as d}from"./app-D5-myltL.js";import{t as f}from"./BrandLogo-6n9qq87f.js";var p={class:`grid min-h-screen lg:grid-cols-[minmax(0,5fr)_minmax(0,6fr)]`},m={class:`relative hidden overflow-hidden bg-brand text-brand-foreground lg:flex lg:flex-col lg:justify-between lg:p-12`},h={class:`relative max-w-md`},g={class:`mt-4 text-[15px] opacity-80`},_={class:`relative text-xs opacity-60`},v={class:`flex items-center justify-center bg-background px-4 py-12 sm:px-8`},y={class:`w-full max-w-[400px]`},b={class:`mb-10 lg:hidden`},x={class:`text-2xl font-semibold tracking-tight`},S={key:0,class:`mt-2 text-sm text-muted-foreground`},C={class:`mt-8`},w={__name:`GuestLayout`,props:{title:{type:String,default:``},description:{type:String,default:``}},setup(w){let T=w,E=t(()=>s().props.branding);return(t,s)=>(i(),o(e,null,[l(u(d),{title:T.title},null,8,[`title`]),r(`div`,p,[r(`aside`,m,[s[1]||=r(`div`,{class:`pointer-events-none absolute inset-0 opacity-[0.12]`,style:{"background-image":`radial-gradient(circle at 20% 20%, white 0, transparent 45%), radial-gradient(circle at 90% 80%, white 0, transparent 40%)`}},null,-1),l(f,{inverted:``,class:`relative`}),r(`div`,h,[s[0]||=r(`p`,{class:`text-3xl leading-tight font-semibold tracking-tight`},`Alles Wichtige für Ihren Arbeitsalltag – an einem Ort.`,-1),r(`p`,g,`Neuigkeiten, Ansprechpartner und Anwendungen von `+c(E.value.portal_name)+`.`,1)]),r(`p`,_,`© `+c(new Date().getFullYear())+` `+c(E.value.portal_name),1)]),r(`main`,v,[r(`div`,y,[r(`div`,b,[l(f)]),r(`h1`,x,c(T.title),1),T.description?(i(),o(`p`,S,c(T.description),1)):n(``,!0),r(`div`,C,[a(t.$slots,`default`)])])])])],64))}};export{w as t};
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
import{F as e,G as t,J as n,K as r,Sn as i,Ut as a,Y as o,Yt as s,lr as c,n as l,nt as u,q as d,rr as f,tt as p}from"./app-CsynT-MH.js";import{t as m}from"./calendar-days-BIvZv67X.js";import{t as h}from"./AppLayout-F8bBmCnJ.js";import{t as g}from"./map-pin-BSi6wphK.js";import{t as _}from"./video-DEGAJLRQ.js";import{t as v}from"./EmptyState-Ckk_-AaU.js";import{i as y,r as b}from"./format-Dlm0nTI_.js";import{t as x}from"./EventDateBlock-Cq5Djfc9.js";var S={key:0,class:`grid max-w-4xl gap-8`},C={class:`mb-3 text-sm font-semibold text-muted-foreground`},w={class:`divide-y rounded-lg border bg-card`},T={class:`min-w-0 flex-1`},E={class:`text-[15px] font-semibold group-hover:underline`},D={class:`mt-0.5 text-[13px] text-muted-foreground`},O={key:0,class:`mt-0.5 flex items-center gap-1.5 text-[13px] text-muted-foreground`},k=[`src`],A={key:1,class:`max-w-4xl rounded-lg border border-dashed bg-card`},j={__name:`Index`,props:{events:{type:Object,required:!0}},setup(j){let M=j,N=t(()=>{let e=[];for(let t of M.events.data){let n=new Date(t.starts_at),r=y((n<new Date?new Date:n).toISOString()),i=e[e.length-1];i?.label===r?i.events.push(t):e.push({label:r,events:[t]})}return e});return(t,y)=>(a(),d(h,{title:`Termine`},{default:i(()=>[y[0]||=r(`div`,{class:`mb-6`},[r(`h1`,{class:`text-2xl font-semibold tracking-tight`},`Termine`),r(`p`,{class:`mt-1 text-sm text-muted-foreground`},`Veranstaltungen, Fortbildungen und Treffen.`)],-1),N.value.length?(a(),o(`div`,S,[(a(!0),o(e,null,s(N.value,t=>(a(),o(`section`,{key:t.label},[r(`h2`,C,c(t.label),1),r(`ul`,w,[(a(!0),o(e,null,s(t.events,e=>(a(),o(`li`,{key:e.id},[u(f(l),{href:`/termine/${e.id}`,class:`group flex items-center gap-4 p-4 transition-colors hover:bg-accent/60`},{default:i(()=>[u(x,{date:e.starts_at,class:`w-14`},null,8,[`date`]),r(`div`,T,[r(`h3`,E,c(e.title),1),r(`p`,D,c(f(b)(e)),1),e.location||e.online_url?(a(),o(`p`,O,[e.location?(a(),d(f(g),{key:0,class:`size-3.5`})):(a(),d(f(_),{key:1,class:`size-3.5`})),p(` `+c(e.location||`Online`),1)])):n(``,!0)]),e.thumb_url?(a(),o(`img`,{key:0,src:e.thumb_url,alt:``,loading:`lazy`,class:`hidden h-16 w-28 shrink-0 rounded-md object-cover sm:block`},null,8,k)):n(``,!0)]),_:2},1032,[`href`])]))),128))])]))),128))])):(a(),o(`div`,A,[u(v,{icon:f(m),title:`Keine anstehenden Termine`,text:`Neue Termine erscheinen hier, sobald sie eingetragen sind.`},null,8,[`icon`])]))]),_:1}))}};export{j as default};
|
||||
import{F as e,G as t,J as n,K as r,Sn as i,Ut as a,Y as o,Yt as s,lr as c,n as l,nt as u,q as d,rr as f,tt as p}from"./app-D5-myltL.js";import{t as m}from"./calendar-days-idvOkJ3J.js";import{t as h}from"./AppLayout-DI-U1ko3.js";import{t as g}from"./map-pin-gOUT4ItV.js";import{t as _}from"./video-Bvsp0re8.js";import{t as v}from"./EmptyState-wvjgIxp3.js";import{i as y,r as b}from"./format-Dlm0nTI_.js";import{t as x}from"./EventDateBlock-BEMye_DY.js";var S={key:0,class:`grid max-w-4xl gap-8`},C={class:`mb-3 text-sm font-semibold text-muted-foreground`},w={class:`divide-y rounded-lg border bg-card`},T={class:`min-w-0 flex-1`},E={class:`text-[15px] font-semibold group-hover:underline`},D={class:`mt-0.5 text-[13px] text-muted-foreground`},O={key:0,class:`mt-0.5 flex items-center gap-1.5 text-[13px] text-muted-foreground`},k=[`src`],A={key:1,class:`max-w-4xl rounded-lg border border-dashed bg-card`},j={__name:`Index`,props:{events:{type:Object,required:!0}},setup(j){let M=j,N=t(()=>{let e=[];for(let t of M.events.data){let n=new Date(t.starts_at),r=y((n<new Date?new Date:n).toISOString()),i=e[e.length-1];i?.label===r?i.events.push(t):e.push({label:r,events:[t]})}return e});return(t,y)=>(a(),d(h,{title:`Termine`},{default:i(()=>[y[0]||=r(`div`,{class:`mb-6`},[r(`h1`,{class:`text-2xl font-semibold tracking-tight`},`Termine`),r(`p`,{class:`mt-1 text-sm text-muted-foreground`},`Veranstaltungen, Fortbildungen und Treffen.`)],-1),N.value.length?(a(),o(`div`,S,[(a(!0),o(e,null,s(N.value,t=>(a(),o(`section`,{key:t.label},[r(`h2`,C,c(t.label),1),r(`ul`,w,[(a(!0),o(e,null,s(t.events,e=>(a(),o(`li`,{key:e.id},[u(f(l),{href:`/termine/${e.id}`,class:`group flex items-center gap-4 p-4 transition-colors hover:bg-accent/60`},{default:i(()=>[u(x,{date:e.starts_at,class:`w-14`},null,8,[`date`]),r(`div`,T,[r(`h3`,E,c(e.title),1),r(`p`,D,c(f(b)(e)),1),e.location||e.online_url?(a(),o(`p`,O,[e.location?(a(),d(f(g),{key:0,class:`size-3.5`})):(a(),d(f(_),{key:1,class:`size-3.5`})),p(` `+c(e.location||`Online`),1)])):n(``,!0)]),e.thumb_url?(a(),o(`img`,{key:0,src:e.thumb_url,alt:``,loading:`lazy`,class:`hidden h-16 w-28 shrink-0 rounded-md object-cover sm:block`},null,8,k)):n(``,!0)]),_:2},1032,[`href`])]))),128))])]))),128))])):(a(),o(`div`,A,[u(v,{icon:f(m),title:`Keine anstehenden Termine`,text:`Neue Termine erscheinen hier, sobald sie eingetragen sind.`},null,8,[`icon`])]))]),_:1}))}};export{j as default};
|
||||
|
|
@ -1 +1 @@
|
|||
import{F as e,J as t,K as n,Sn as r,Ut as i,Y as a,Yt as o,a as s,lr as c,n as l,nt as u,or as d,q as f,rr as p,tt as m}from"./app-CsynT-MH.js";import{t as h}from"./AppLayout-F8bBmCnJ.js";import{t as g}from"./chevron-left-BZls6HMK.js";import{t as _}from"./chevron-right-CFe35sP-.js";import{i as v,t as y}from"./NewsCard-CrFv9-d1.js";import{t as b}from"./button-By-E3x2v.js";import{t as x}from"./EmptyState-Ckk_-AaU.js";var S={key:0,class:`mb-6 flex flex-wrap gap-2`,"aria-label":`Kategorien`},C={key:1,class:`grid gap-5 sm:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4`},w={key:2,class:`rounded-lg border border-dashed bg-card`},T={key:3,class:`mt-8 flex items-center justify-between`,"aria-label":`Seiten`},E={class:`text-sm text-muted-foreground`},D={class:`flex gap-2`},O={__name:`Index`,props:{posts:{type:Object,required:!0},categories:{type:Array,required:!0},activeCategory:{type:String,default:null}},setup(O){return(k,A)=>(i(),f(h,{title:`Neuigkeiten`},{default:r(()=>[A[5]||=n(`div`,{class:`mb-6`},[n(`h1`,{class:`text-2xl font-semibold tracking-tight`},`Neuigkeiten`),n(`p`,{class:`mt-1 text-sm text-muted-foreground`},`Aktuelles aus dem Unternehmen und den Bereichen.`)],-1),O.categories.length?(i(),a(`nav`,S,[u(p(l),{href:`/neuigkeiten`,class:d([`rounded-full border px-3.5 py-1.5 text-[13px] font-medium transition-colors`,O.activeCategory?`bg-card hover:bg-accent`:`border-brand bg-brand text-brand-foreground`]),"preserve-scroll":``},{default:r(()=>[...A[2]||=[m(` Alle `,-1)]]),_:1},8,[`class`]),(i(!0),a(e,null,o(O.categories,e=>(i(),f(p(l),{key:e.slug,href:`/neuigkeiten?kategorie=${e.slug}`,class:d([`rounded-full border px-3.5 py-1.5 text-[13px] font-medium transition-colors`,O.activeCategory===e.slug?`border-brand bg-brand text-brand-foreground`:`bg-card hover:bg-accent`]),"preserve-scroll":``},{default:r(()=>[m(c(e.name),1)]),_:2},1032,[`href`,`class`]))),128))])):t(``,!0),O.posts.data.length?(i(),a(`div`,C,[(i(!0),a(e,null,o(O.posts.data,e=>(i(),f(y,{key:e.id,post:e},null,8,[`post`]))),128))])):(i(),a(`div`,w,[u(x,{icon:p(v),title:`Keine Beiträge`,text:`In dieser Kategorie ist noch nichts veröffentlicht.`},null,8,[`icon`])])),O.posts.meta.last_page>1?(i(),a(`nav`,T,[n(`p`,E,`Seite `+c(O.posts.meta.current_page)+` von `+c(O.posts.meta.last_page),1),n(`div`,D,[u(p(b),{variant:`outline`,size:`sm`,disabled:!O.posts.links.prev,onClick:A[0]||=e=>p(s).get(O.posts.links.prev)},{default:r(()=>[u(p(g)),A[3]||=m(` Neuere`,-1)]),_:1},8,[`disabled`]),u(p(b),{variant:`outline`,size:`sm`,disabled:!O.posts.links.next,onClick:A[1]||=e=>p(s).get(O.posts.links.next)},{default:r(()=>[A[4]||=m(`Ältere `,-1),u(p(_))]),_:1},8,[`disabled`])])])):t(``,!0)]),_:1}))}};export{O as default};
|
||||
import{F as e,J as t,K as n,Sn as r,Ut as i,Y as a,Yt as o,a as s,lr as c,n as l,nt as u,or as d,q as f,rr as p,tt as m}from"./app-D5-myltL.js";import{t as h}from"./AppLayout-DI-U1ko3.js";import{t as g}from"./chevron-left-DJf03pzL.js";import{t as _}from"./chevron-right-3K_kIePF.js";import{i as v,t as y}from"./NewsCard-C3zrf7NQ.js";import{t as b}from"./button-CK8gfgLI.js";import{t as x}from"./EmptyState-wvjgIxp3.js";var S={key:0,class:`mb-6 flex flex-wrap gap-2`,"aria-label":`Kategorien`},C={key:1,class:`grid gap-5 sm:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4`},w={key:2,class:`rounded-lg border border-dashed bg-card`},T={key:3,class:`mt-8 flex items-center justify-between`,"aria-label":`Seiten`},E={class:`text-sm text-muted-foreground`},D={class:`flex gap-2`},O={__name:`Index`,props:{posts:{type:Object,required:!0},categories:{type:Array,required:!0},activeCategory:{type:String,default:null}},setup(O){return(k,A)=>(i(),f(h,{title:`Neuigkeiten`},{default:r(()=>[A[5]||=n(`div`,{class:`mb-6`},[n(`h1`,{class:`text-2xl font-semibold tracking-tight`},`Neuigkeiten`),n(`p`,{class:`mt-1 text-sm text-muted-foreground`},`Aktuelles aus dem Unternehmen und den Bereichen.`)],-1),O.categories.length?(i(),a(`nav`,S,[u(p(l),{href:`/neuigkeiten`,class:d([`rounded-full border px-3.5 py-1.5 text-[13px] font-medium transition-colors`,O.activeCategory?`bg-card hover:bg-accent`:`border-brand bg-brand text-brand-foreground`]),"preserve-scroll":``},{default:r(()=>[...A[2]||=[m(` Alle `,-1)]]),_:1},8,[`class`]),(i(!0),a(e,null,o(O.categories,e=>(i(),f(p(l),{key:e.slug,href:`/neuigkeiten?kategorie=${e.slug}`,class:d([`rounded-full border px-3.5 py-1.5 text-[13px] font-medium transition-colors`,O.activeCategory===e.slug?`border-brand bg-brand text-brand-foreground`:`bg-card hover:bg-accent`]),"preserve-scroll":``},{default:r(()=>[m(c(e.name),1)]),_:2},1032,[`href`,`class`]))),128))])):t(``,!0),O.posts.data.length?(i(),a(`div`,C,[(i(!0),a(e,null,o(O.posts.data,e=>(i(),f(y,{key:e.id,post:e},null,8,[`post`]))),128))])):(i(),a(`div`,w,[u(x,{icon:p(v),title:`Keine Beiträge`,text:`In dieser Kategorie ist noch nichts veröffentlicht.`},null,8,[`icon`])])),O.posts.meta.last_page>1?(i(),a(`nav`,T,[n(`p`,E,`Seite `+c(O.posts.meta.current_page)+` von `+c(O.posts.meta.last_page),1),n(`div`,D,[u(p(b),{variant:`outline`,size:`sm`,disabled:!O.posts.links.prev,onClick:A[0]||=e=>p(s).get(O.posts.links.prev)},{default:r(()=>[u(p(g)),A[3]||=m(` Neuere`,-1)]),_:1},8,[`disabled`]),u(p(b),{variant:`outline`,size:`sm`,disabled:!O.posts.links.next,onClick:A[1]||=e=>p(s).get(O.posts.links.next)},{default:r(()=>[A[4]||=m(`Ältere `,-1),u(p(_))]),_:1},8,[`disabled`])])])):t(``,!0)]),_:1}))}};export{O as default};
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
import{J as e,K as t,Sn as n,Ut as r,Y as i,lr as a,n as o,nt as s,q as c,rr as l}from"./app-CsynT-MH.js";import{A as u}from"./BrandLogo-BTmxPYut.js";import{o as d}from"./format-Dlm0nTI_.js";var f=u({name:`newspaper`,size:24,node:[[`path`,{d:`M15 18h-5`,key:`95g1m2`}],[`path`,{d:`M18 14h-8`,key:`sponae`}],[`path`,{d:`M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2`,key:`39pd36`}],[`rect`,{width:`8`,height:`4`,x:`10`,y:`6`,rx:`1`,key:`aywv1n`}]]}),p={key:0,class:`text-[11px] font-semibold tracking-wide text-brand-text uppercase`},m={__name:`CategoryLabel`,props:{category:{type:Object,default:null}},setup(t){return(n,o)=>t.category?(r(),i(`span`,p,a(t.category.name),1)):e(``,!0)}},h={class:`relative aspect-video overflow-hidden bg-muted`},g=[`src`,`alt`],_={key:1,class:`grid size-full place-items-center bg-brand-soft`},v={__name:`NewsImage`,props:{src:{type:String,default:null},alt:{type:String,default:``}},setup(e){return(t,n)=>(r(),i(`div`,h,[e.src?(r(),i(`img`,{key:0,src:e.src,alt:e.alt,loading:`lazy`,class:`size-full object-cover`},null,8,g)):(r(),i(`div`,_,[s(l(f),{class:`size-1/4 max-h-10 max-w-10 text-brand-text opacity-60`,"stroke-width":1.5})]))]))}},y={class:`flex flex-1 flex-col p-4`},b={class:`mt-1 line-clamp-2 text-[15px] leading-snug font-semibold group-hover:underline`},x={key:0,class:`mt-1.5 line-clamp-2 text-[13px] text-muted-foreground`},S={class:`mt-auto pt-3 text-xs text-muted-foreground`},C={__name:`NewsCard`,props:{post:{type:Object,required:!0}},setup(u){return(f,p)=>(r(),c(l(o),{href:`/neuigkeiten/${u.post.slug}`,class:`group flex h-full flex-col overflow-hidden rounded-lg border bg-card transition-shadow hover:shadow-md`},{default:n(()=>[s(v,{src:u.post.thumb_url,alt:u.post.title},null,8,[`src`,`alt`]),t(`div`,y,[s(m,{category:u.post.category},null,8,[`category`]),t(`h3`,b,a(u.post.title),1),u.post.teaser?(r(),i(`p`,x,a(u.post.teaser),1)):e(``,!0),t(`p`,S,a(l(d)(u.post.published_at))+` · `+a(u.post.reading_minutes)+` Min.`,1)])]),_:1},8,[`href`]))}};export{f as i,v as n,m as r,C as t};
|
||||
import{J as e,K as t,Sn as n,Ut as r,Y as i,lr as a,n as o,nt as s,q as c,rr as l}from"./app-D5-myltL.js";import{A as u}from"./BrandLogo-6n9qq87f.js";import{o as d}from"./format-Dlm0nTI_.js";var f=u({name:`newspaper`,size:24,node:[[`path`,{d:`M15 18h-5`,key:`95g1m2`}],[`path`,{d:`M18 14h-8`,key:`sponae`}],[`path`,{d:`M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2`,key:`39pd36`}],[`rect`,{width:`8`,height:`4`,x:`10`,y:`6`,rx:`1`,key:`aywv1n`}]]}),p={key:0,class:`text-[11px] font-semibold tracking-wide text-brand-text uppercase`},m={__name:`CategoryLabel`,props:{category:{type:Object,default:null}},setup(t){return(n,o)=>t.category?(r(),i(`span`,p,a(t.category.name),1)):e(``,!0)}},h={class:`relative aspect-video overflow-hidden bg-muted`},g=[`src`,`alt`],_={key:1,class:`grid size-full place-items-center bg-brand-soft`},v={__name:`NewsImage`,props:{src:{type:String,default:null},alt:{type:String,default:``}},setup(e){return(t,n)=>(r(),i(`div`,h,[e.src?(r(),i(`img`,{key:0,src:e.src,alt:e.alt,loading:`lazy`,class:`size-full object-cover`},null,8,g)):(r(),i(`div`,_,[s(l(f),{class:`size-1/4 max-h-10 max-w-10 text-brand-text opacity-60`,"stroke-width":1.5})]))]))}},y={class:`flex flex-1 flex-col p-4`},b={class:`mt-1 line-clamp-2 text-[15px] leading-snug font-semibold group-hover:underline`},x={key:0,class:`mt-1.5 line-clamp-2 text-[13px] text-muted-foreground`},S={class:`mt-auto pt-3 text-xs text-muted-foreground`},C={__name:`NewsCard`,props:{post:{type:Object,required:!0}},setup(u){return(f,p)=>(r(),c(l(o),{href:`/neuigkeiten/${u.post.slug}`,class:`group flex h-full flex-col overflow-hidden rounded-lg border bg-card transition-shadow hover:shadow-md`},{default:n(()=>[s(v,{src:u.post.thumb_url,alt:u.post.title},null,8,[`src`,`alt`]),t(`div`,y,[s(m,{category:u.post.category},null,8,[`category`]),t(`h3`,b,a(u.post.title),1),u.post.teaser?(r(),i(`p`,x,a(u.post.teaser),1)):e(``,!0),t(`p`,S,a(l(d)(u.post.published_at))+` · `+a(u.post.reading_minutes)+` Min.`,1)])]),_:1},8,[`href`]))}};export{f as i,v as n,m as r,C as t};
|
||||
|
|
@ -1 +1 @@
|
|||
import{J as e,K as t,Sn as n,Ut as r,Xt as i,Y as a,lr as o,n as s,nt as c,or as l,q as u,rr as d,tt as f}from"./app-CsynT-MH.js";import{t as p}from"./chevron-right-CFe35sP-.js";var m={class:`rounded-lg border bg-card text-card-foreground`},h={key:0,class:`flex items-center justify-between gap-4 px-5 pt-4 pb-3`},g={class:`text-base font-semibold`},_={__name:`Panel`,props:{title:{type:String,default:``},actionLabel:{type:String,default:``},actionHref:{type:String,default:``}},setup(_){return(v,y)=>(r(),a(`section`,m,[_.title||v.$slots.actions?(r(),a(`header`,h,[t(`h2`,g,o(_.title),1),i(v.$slots,`actions`,{},()=>[_.actionHref?(r(),u(d(s),{key:0,href:_.actionHref,class:`inline-flex items-center gap-0.5 text-[13px] font-medium text-brand-text hover:underline`},{default:n(()=>[f(o(_.actionLabel)+` `,1),c(d(p),{class:`size-3.5`})]),_:1},8,[`href`])):e(``,!0)])])):e(``,!0),t(`div`,{class:l([`px-5 pb-5`,{"pt-5":!_.title&&!v.$slots.actions}])},[i(v.$slots,`default`)],2)]))}};export{_ as t};
|
||||
import{J as e,K as t,Sn as n,Ut as r,Xt as i,Y as a,lr as o,n as s,nt as c,or as l,q as u,rr as d,tt as f}from"./app-D5-myltL.js";import{t as p}from"./chevron-right-3K_kIePF.js";var m={class:`rounded-lg border bg-card text-card-foreground`},h={key:0,class:`flex items-center justify-between gap-4 px-5 pt-4 pb-3`},g={class:`text-base font-semibold`},_={__name:`Panel`,props:{title:{type:String,default:``},actionLabel:{type:String,default:``},actionHref:{type:String,default:``}},setup(_){return(v,y)=>(r(),a(`section`,m,[_.title||v.$slots.actions?(r(),a(`header`,h,[t(`h2`,g,o(_.title),1),i(v.$slots,`actions`,{},()=>[_.actionHref?(r(),u(d(s),{key:0,href:_.actionHref,class:`inline-flex items-center gap-0.5 text-[13px] font-medium text-brand-text hover:underline`},{default:n(()=>[f(o(_.actionLabel)+` `,1),c(d(p),{class:`size-3.5`})]),_:1},8,[`href`])):e(``,!0)])])):e(``,!0),t(`div`,{class:l([`px-5 pb-5`,{"pt-5":!_.title&&!v.$slots.actions}])},[i(v.$slots,`default`)],2)]))}};export{_ as t};
|
||||
|
|
@ -1 +1 @@
|
|||
import{J as e,K as t,Sn as n,Ut as r,k as i,nt as a,q as o,r as s,rr as c,tt as l}from"./app-CsynT-MH.js";import{k as u}from"./BrandLogo-BTmxPYut.js";import{t as d}from"./button-By-E3x2v.js";import{r as f,t as p}from"./FormField-VAcUnlCp.js";import{t as m}from"./GuestLayout-Cij2uD05.js";var h={__name:`ResetPassword`,props:{email:{type:String,default:``},token:{type:String,required:!0}},setup(h){let g=h,_=s({token:g.token,email:g.email,password:``,password_confirmation:``});function v(){_.post(`/reset-password`,{onFinish:()=>_.reset(`password`,`password_confirmation`)})}return(s,h)=>(r(),o(m,{title:`Neues Passwort festlegen`,description:`Mindestens 10 Zeichen, mit Buchstaben und Ziffern.`},{default:n(()=>[t(`form`,{class:`grid gap-5`,onSubmit:i(v,[`prevent`])},[a(p,{id:`email`,label:`E-Mail-Adresse`,error:c(_).errors.email},{default:n(()=>[a(c(f),{id:`email`,modelValue:c(_).email,"onUpdate:modelValue":h[0]||=e=>c(_).email=e,type:`email`,autocomplete:`username`,class:`h-10`},null,8,[`modelValue`])]),_:1},8,[`error`]),a(p,{id:`password`,label:`Neues Passwort`,error:c(_).errors.password},{default:n(()=>[a(c(f),{id:`password`,modelValue:c(_).password,"onUpdate:modelValue":h[1]||=e=>c(_).password=e,type:`password`,autocomplete:`new-password`,autofocus:``,class:`h-10`},null,8,[`modelValue`])]),_:1},8,[`error`]),a(p,{id:`password_confirmation`,label:`Passwort wiederholen`},{default:n(()=>[a(c(f),{id:`password_confirmation`,modelValue:c(_).password_confirmation,"onUpdate:modelValue":h[2]||=e=>c(_).password_confirmation=e,type:`password`,autocomplete:`new-password`,class:`h-10`},null,8,[`modelValue`])]),_:1}),a(c(d),{type:`submit`,size:`lg`,class:`h-10 w-full`,disabled:c(_).processing},{default:n(()=>[c(_).processing?(r(),o(c(u),{key:0,class:`animate-spin`})):e(``,!0),h[3]||=l(` Passwort speichern `,-1)]),_:1},8,[`disabled`])],32)]),_:1}))}};export{h as default};
|
||||
import{J as e,K as t,Sn as n,Ut as r,k as i,nt as a,q as o,r as s,rr as c,tt as l}from"./app-D5-myltL.js";import{k as u}from"./BrandLogo-6n9qq87f.js";import{t as d}from"./button-CK8gfgLI.js";import{r as f,t as p}from"./FormField-BxtniYWy.js";import{t as m}from"./GuestLayout-DXTg9GcL.js";var h={__name:`ResetPassword`,props:{email:{type:String,default:``},token:{type:String,required:!0}},setup(h){let g=h,_=s({token:g.token,email:g.email,password:``,password_confirmation:``});function v(){_.post(`/reset-password`,{onFinish:()=>_.reset(`password`,`password_confirmation`)})}return(s,h)=>(r(),o(m,{title:`Neues Passwort festlegen`,description:`Mindestens 10 Zeichen, mit Buchstaben und Ziffern.`},{default:n(()=>[t(`form`,{class:`grid gap-5`,onSubmit:i(v,[`prevent`])},[a(p,{id:`email`,label:`E-Mail-Adresse`,error:c(_).errors.email},{default:n(()=>[a(c(f),{id:`email`,modelValue:c(_).email,"onUpdate:modelValue":h[0]||=e=>c(_).email=e,type:`email`,autocomplete:`username`,class:`h-10`},null,8,[`modelValue`])]),_:1},8,[`error`]),a(p,{id:`password`,label:`Neues Passwort`,error:c(_).errors.password},{default:n(()=>[a(c(f),{id:`password`,modelValue:c(_).password,"onUpdate:modelValue":h[1]||=e=>c(_).password=e,type:`password`,autocomplete:`new-password`,autofocus:``,class:`h-10`},null,8,[`modelValue`])]),_:1},8,[`error`]),a(p,{id:`password_confirmation`,label:`Passwort wiederholen`},{default:n(()=>[a(c(f),{id:`password_confirmation`,modelValue:c(_).password_confirmation,"onUpdate:modelValue":h[2]||=e=>c(_).password_confirmation=e,type:`password`,autocomplete:`new-password`,class:`h-10`},null,8,[`modelValue`])]),_:1}),a(c(d),{type:`submit`,size:`lg`,class:`h-10 w-full`,disabled:c(_).processing},{default:n(()=>[c(_).processing?(r(),o(c(u),{key:0,class:`animate-spin`})):e(``,!0),h[3]||=l(` Passwort speichern `,-1)]),_:1},8,[`disabled`])],32)]),_:1}))}};export{h as default};
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
import{J as e,K as t,Sn as n,Ut as r,Y as i,lr as a,n as o,nt as s,q as c,rr as l,tt as u}from"./app-CsynT-MH.js";import{A as d}from"./BrandLogo-BTmxPYut.js";import{t as f}from"./arrow-left-mgtA-v8n.js";import{t as p}from"./AppLayout-F8bBmCnJ.js";import{t as m}from"./clock-CvJm3n4o.js";import{t as h}from"./map-pin-BSi6wphK.js";import{t as g}from"./video-DEGAJLRQ.js";import{t as _}from"./button-By-E3x2v.js";import{r as v}from"./format-Dlm0nTI_.js";import{t as y}from"./EventDateBlock-Cq5Djfc9.js";import{t as b}from"./Panel-B3tnckCV.js";var x=d({name:`calendar-plus`,size:24,node:[[`path`,{d:`M16 18h6`,key:`987eiv`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M19 15v6`,key:`10aioa`}],[`path`,{d:`M21 11.5V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h8.3`,key:`jgwkxf`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}]]}),S={class:`mx-auto max-w-4xl`},C={class:`flex items-start gap-4`},w={class:`pt-1 text-2xl leading-tight font-semibold tracking-tight sm:text-3xl`},T=[`src`,`alt`],E={class:`mt-6 grid gap-6 lg:grid-cols-3`},D=[`innerHTML`],O={key:1,class:`text-sm text-muted-foreground`},k={class:`grid gap-4 text-sm`},A={class:`flex gap-3`},j={key:0,class:`flex gap-3`},M={key:1,class:`flex gap-3`},N={class:`min-w-0`},P={class:`truncate`},F=[`href`],I=[`href`],L={__name:`Show`,props:{event:{type:Object,required:!0}},setup(d){return(L,R)=>(r(),c(p,{title:d.event.title},{default:n(()=>[t(`div`,S,[s(l(o),{href:`/termine`,class:`mb-6 inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground`},{default:n(()=>[s(l(f),{class:`size-4`}),R[0]||=u(` Alle Termine `,-1)]),_:1}),t(`div`,C,[s(y,{date:d.event.starts_at,class:`w-16 py-2`},null,8,[`date`]),t(`h1`,w,a(d.event.title),1)]),d.event.image_url?(r(),i(`img`,{key:0,src:d.event.image_url,alt:d.event.title,class:`mt-6 aspect-video w-full rounded-lg object-cover`},null,8,T)):e(``,!0),t(`div`,E,[s(b,{title:`Beschreibung`,class:`lg:col-span-2`},{default:n(()=>[d.event.description_html?(r(),i(`div`,{key:0,class:`prose prose-neutral max-w-none text-[15px]`,innerHTML:d.event.description_html},null,8,D)):(r(),i(`p`,O,`Keine weiteren Informationen.`))]),_:1}),s(b,{title:`Details`,class:`content-start`},{default:n(()=>[t(`dl`,k,[t(`div`,A,[s(l(m),{class:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),t(`div`,null,[R[1]||=t(`dt`,{class:`text-xs text-muted-foreground`},`Wann`,-1),t(`dd`,null,a(l(v)(d.event)),1)])]),d.event.location?(r(),i(`div`,j,[s(l(h),{class:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),t(`div`,null,[R[2]||=t(`dt`,{class:`text-xs text-muted-foreground`},`Ort`,-1),t(`dd`,null,a(d.event.location),1)])])):e(``,!0),d.event.online_url?(r(),i(`div`,M,[s(l(g),{class:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),t(`div`,N,[R[3]||=t(`dt`,{class:`text-xs text-muted-foreground`},`Online`,-1),t(`dd`,P,[t(`a`,{href:d.event.online_url,target:`_blank`,rel:`noopener`,class:`text-brand-text hover:underline`},`Zur Teilnahme`,8,F)])])])):e(``,!0)]),s(l(_),{variant:`outline`,class:`mt-5 w-full`,"as-child":``},{default:n(()=>[t(`a`,{href:`/termine/${d.event.id}/kalender.ics`},[s(l(x)),R[4]||=u(` In meinen Kalender`,-1)],8,I)]),_:1})]),_:1})])])]),_:1},8,[`title`]))}};export{L as default};
|
||||
import{J as e,K as t,Sn as n,Ut as r,Y as i,lr as a,n as o,nt as s,q as c,rr as l,tt as u}from"./app-D5-myltL.js";import{A as d}from"./BrandLogo-6n9qq87f.js";import{t as f}from"./arrow-left-99a39ArM.js";import{t as p}from"./AppLayout-DI-U1ko3.js";import{t as m}from"./clock-9LUlycVP.js";import{t as h}from"./map-pin-gOUT4ItV.js";import{t as g}from"./video-Bvsp0re8.js";import{t as _}from"./button-CK8gfgLI.js";import{r as v}from"./format-Dlm0nTI_.js";import{t as y}from"./EventDateBlock-BEMye_DY.js";import{t as b}from"./Panel-qbzyicSq.js";var x=d({name:`calendar-plus`,size:24,node:[[`path`,{d:`M16 18h6`,key:`987eiv`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M19 15v6`,key:`10aioa`}],[`path`,{d:`M21 11.5V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h8.3`,key:`jgwkxf`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}]]}),S={class:`mx-auto max-w-4xl`},C={class:`flex items-start gap-4`},w={class:`pt-1 text-2xl leading-tight font-semibold tracking-tight sm:text-3xl`},T=[`src`,`alt`],E={class:`mt-6 grid gap-6 lg:grid-cols-3`},D=[`innerHTML`],O={key:1,class:`text-sm text-muted-foreground`},k={class:`grid gap-4 text-sm`},A={class:`flex gap-3`},j={key:0,class:`flex gap-3`},M={key:1,class:`flex gap-3`},N={class:`min-w-0`},P={class:`truncate`},F=[`href`],I=[`href`],L={__name:`Show`,props:{event:{type:Object,required:!0}},setup(d){return(L,R)=>(r(),c(p,{title:d.event.title},{default:n(()=>[t(`div`,S,[s(l(o),{href:`/termine`,class:`mb-6 inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground`},{default:n(()=>[s(l(f),{class:`size-4`}),R[0]||=u(` Alle Termine `,-1)]),_:1}),t(`div`,C,[s(y,{date:d.event.starts_at,class:`w-16 py-2`},null,8,[`date`]),t(`h1`,w,a(d.event.title),1)]),d.event.image_url?(r(),i(`img`,{key:0,src:d.event.image_url,alt:d.event.title,class:`mt-6 aspect-video w-full rounded-lg object-cover`},null,8,T)):e(``,!0),t(`div`,E,[s(b,{title:`Beschreibung`,class:`lg:col-span-2`},{default:n(()=>[d.event.description_html?(r(),i(`div`,{key:0,class:`prose prose-neutral max-w-none text-[15px]`,innerHTML:d.event.description_html},null,8,D)):(r(),i(`p`,O,`Keine weiteren Informationen.`))]),_:1}),s(b,{title:`Details`,class:`content-start`},{default:n(()=>[t(`dl`,k,[t(`div`,A,[s(l(m),{class:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),t(`div`,null,[R[1]||=t(`dt`,{class:`text-xs text-muted-foreground`},`Wann`,-1),t(`dd`,null,a(l(v)(d.event)),1)])]),d.event.location?(r(),i(`div`,j,[s(l(h),{class:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),t(`div`,null,[R[2]||=t(`dt`,{class:`text-xs text-muted-foreground`},`Ort`,-1),t(`dd`,null,a(d.event.location),1)])])):e(``,!0),d.event.online_url?(r(),i(`div`,M,[s(l(g),{class:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),t(`div`,N,[R[3]||=t(`dt`,{class:`text-xs text-muted-foreground`},`Online`,-1),t(`dd`,P,[t(`a`,{href:d.event.online_url,target:`_blank`,rel:`noopener`,class:`text-brand-text hover:underline`},`Zur Teilnahme`,8,F)])])])):e(``,!0)]),s(l(_),{variant:`outline`,class:`mt-5 w-full`,"as-child":``},{default:n(()=>[t(`a`,{href:`/termine/${d.event.id}/kalender.ics`},[s(l(x)),R[4]||=u(` In meinen Kalender`,-1)],8,I)]),_:1})]),_:1})])])]),_:1},8,[`title`]))}};export{L as default};
|
||||
|
|
@ -1 +1 @@
|
|||
import{F as e,J as t,K as n,Sn as r,Ut as i,Y as a,Yt as o,lr as s,n as c,nt as l,q as u,rr as d,tt as f}from"./app-CsynT-MH.js";import{t as p}from"./arrow-left-mgtA-v8n.js";import{r as m,t as h}from"./AppLayout-F8bBmCnJ.js";import{t as g}from"./clock-CvJm3n4o.js";import{r as _,t as v}from"./NewsCard-CrFv9-d1.js";import{n as y}from"./format-Dlm0nTI_.js";var b={class:`mx-auto max-w-3xl`},x={class:`mt-2 text-3xl leading-tight font-semibold tracking-tight sm:text-[34px]`},S={key:0,class:`mt-4 text-lg leading-relaxed text-muted-foreground`},C={class:`mt-6 flex flex-wrap items-center gap-x-6 gap-y-3 border-y py-4 text-sm`},w={class:`block font-medium`},T={key:0,class:`block text-xs text-muted-foreground`},E={class:`text-muted-foreground`},D={class:`inline-flex items-center gap-1.5 text-muted-foreground`},O=[`src`,`alt`],k=[`innerHTML`],A={key:0,class:`mx-auto mt-16 max-w-5xl`},j={class:`grid gap-5 sm:grid-cols-2 lg:grid-cols-3`},M={__name:`Show`,props:{post:{type:Object,required:!0},related:{type:Object,required:!0}},setup(M){return(N,P)=>(i(),u(h,{title:M.post.title},{default:r(()=>[n(`article`,b,[l(d(c),{href:`/neuigkeiten`,class:`mb-6 inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground`},{default:r(()=>[l(d(p),{class:`size-4`}),P[0]||=f(` Alle Neuigkeiten `,-1)]),_:1}),n(`header`,null,[l(_,{category:M.post.category},null,8,[`category`]),n(`h1`,x,s(M.post.title),1),M.post.teaser?(i(),a(`p`,S,s(M.post.teaser),1)):t(``,!0),n(`div`,C,[M.post.author?(i(),u(d(c),{key:0,href:`/personen/${M.post.author.id}`,class:`flex items-center gap-3 hover:underline`},{default:r(()=>[l(m,{person:M.post.author,class:`size-9`},null,8,[`person`]),n(`span`,null,[n(`span`,w,s(M.post.author.name),1),M.post.author.job_title?(i(),a(`span`,T,s(M.post.author.job_title),1)):t(``,!0)])]),_:1},8,[`href`])):t(``,!0),n(`span`,E,s(d(y)(M.post.published_at)),1),n(`span`,D,[l(d(g),{class:`size-4`}),f(` `+s(M.post.reading_minutes)+` Min. Lesezeit`,1)])])]),M.post.cover_url?(i(),a(`img`,{key:0,src:M.post.cover_url,alt:M.post.title,class:`mt-8 aspect-video w-full rounded-lg object-cover`},null,8,O)):t(``,!0),n(`div`,{class:`prose prose-neutral mt-8 max-w-none prose-headings:tracking-tight prose-img:rounded-lg`,innerHTML:M.post.body_html},null,8,k)]),M.related.data.length?(i(),a(`section`,A,[P[1]||=n(`h2`,{class:`mb-4 text-lg font-semibold`},`Weitere Beiträge`,-1),n(`div`,j,[(i(!0),a(e,null,o(M.related.data,e=>(i(),u(v,{key:e.id,post:e},null,8,[`post`]))),128))])])):t(``,!0)]),_:1},8,[`title`]))}};export{M as default};
|
||||
import{F as e,J as t,K as n,Sn as r,Ut as i,Y as a,Yt as o,lr as s,n as c,nt as l,q as u,rr as d,tt as f}from"./app-D5-myltL.js";import{t as p}from"./arrow-left-99a39ArM.js";import{r as m,t as h}from"./AppLayout-DI-U1ko3.js";import{t as g}from"./clock-9LUlycVP.js";import{r as _,t as v}from"./NewsCard-C3zrf7NQ.js";import{n as y}from"./format-Dlm0nTI_.js";var b={class:`mx-auto max-w-3xl`},x={class:`mt-2 text-3xl leading-tight font-semibold tracking-tight sm:text-[34px]`},S={key:0,class:`mt-4 text-lg leading-relaxed text-muted-foreground`},C={class:`mt-6 flex flex-wrap items-center gap-x-6 gap-y-3 border-y py-4 text-sm`},w={class:`block font-medium`},T={key:0,class:`block text-xs text-muted-foreground`},E={class:`text-muted-foreground`},D={class:`inline-flex items-center gap-1.5 text-muted-foreground`},O=[`src`,`alt`],k=[`innerHTML`],A={key:0,class:`mx-auto mt-16 max-w-5xl`},j={class:`grid gap-5 sm:grid-cols-2 lg:grid-cols-3`},M={__name:`Show`,props:{post:{type:Object,required:!0},related:{type:Object,required:!0}},setup(M){return(N,P)=>(i(),u(h,{title:M.post.title},{default:r(()=>[n(`article`,b,[l(d(c),{href:`/neuigkeiten`,class:`mb-6 inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground`},{default:r(()=>[l(d(p),{class:`size-4`}),P[0]||=f(` Alle Neuigkeiten `,-1)]),_:1}),n(`header`,null,[l(_,{category:M.post.category},null,8,[`category`]),n(`h1`,x,s(M.post.title),1),M.post.teaser?(i(),a(`p`,S,s(M.post.teaser),1)):t(``,!0),n(`div`,C,[M.post.author?(i(),u(d(c),{key:0,href:`/personen/${M.post.author.id}`,class:`flex items-center gap-3 hover:underline`},{default:r(()=>[l(m,{person:M.post.author,class:`size-9`},null,8,[`person`]),n(`span`,null,[n(`span`,w,s(M.post.author.name),1),M.post.author.job_title?(i(),a(`span`,T,s(M.post.author.job_title),1)):t(``,!0)])]),_:1},8,[`href`])):t(``,!0),n(`span`,E,s(d(y)(M.post.published_at)),1),n(`span`,D,[l(d(g),{class:`size-4`}),f(` `+s(M.post.reading_minutes)+` Min. Lesezeit`,1)])])]),M.post.cover_url?(i(),a(`img`,{key:0,src:M.post.cover_url,alt:M.post.title,class:`mt-8 aspect-video w-full rounded-lg object-cover`},null,8,O)):t(``,!0),n(`div`,{class:`prose prose-neutral mt-8 max-w-none prose-headings:tracking-tight prose-img:rounded-lg`,innerHTML:M.post.body_html},null,8,k)]),M.related.data.length?(i(),a(`section`,A,[P[1]||=n(`h2`,{class:`mb-4 text-lg font-semibold`},`Weitere Beiträge`,-1),n(`div`,j,[(i(!0),a(e,null,o(M.related.data,e=>(i(),u(v,{key:e.id,post:e},null,8,[`post`]))),128))])])):t(``,!0)]),_:1},8,[`title`]))}};export{M as default};
|
||||
|
|
@ -1 +1 @@
|
|||
import{$t as e,F as t,G as n,J as r,K as i,Sn as a,Ut as o,Y as s,Yt as c,lr as l,n as u,nt as d,q as f,rr as p,tt as m}from"./app-CsynT-MH.js";import{A as h}from"./BrandLogo-BTmxPYut.js";import{t as g}from"./building-complex-BQB_KSrz.js";import{a as _,r as v,t as y}from"./AppLayout-F8bBmCnJ.js";import{n as b,t as x}from"./phone-CmJSf8TQ.js";import{t as S}from"./map-pin-BSi6wphK.js";import{t as C}from"./button-By-E3x2v.js";import{t as w}from"./Panel-B3tnckCV.js";var T=h({name:`smartphone`,size:24,node:[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]}),E={class:`overflow-hidden rounded-lg border bg-card`},D={class:`flex flex-col gap-4 px-6 pb-6 sm:flex-row sm:items-end sm:justify-between`},O={class:`flex flex-col gap-4 sm:flex-row sm:items-end`},k={class:`sm:pb-1`},A={class:`text-2xl font-semibold tracking-tight`},j={key:0,class:`mt-0.5 text-[15px] text-muted-foreground`},M={class:`flex gap-2 sm:pb-1`},N=[`href`],P={class:`mt-6 grid gap-6 lg:grid-cols-12`},F={class:`grid gap-4`},I={class:`min-w-0`},L={class:`text-xs text-muted-foreground`},R={class:`truncate text-sm`},z=[`href`],B={key:0,class:`text-sm leading-relaxed whitespace-pre-line`},V={key:1,class:`text-sm text-muted-foreground`},H={__name:`Show`,props:{person:{type:Object,required:!0},isOwnProfile:{type:Boolean,default:!1}},setup(h){let H=h,U=n(()=>[{icon:b,label:`E-Mail`,value:H.person.email,href:`mailto:${H.person.email}`},{icon:x,label:`Telefon`,value:H.person.phone,href:H.person.phone&&`tel:${H.person.phone}`},{icon:T,label:`Mobil`,value:H.person.mobile,href:H.person.mobile&&`tel:${H.person.mobile}`},{icon:g,label:`Abteilung`,value:H.person.department},{icon:S,label:`Standort`,value:H.person.location}].filter(e=>e.value));return(n,g)=>(o(),f(y,{title:h.person.name},{default:a(()=>[i(`section`,E,[g[2]||=i(`div`,{class:`h-28 bg-brand sm:h-32`,style:{"background-image":`linear-gradient(120deg, transparent 40%, rgb(255 255 255 / 0.08))`}},null,-1),i(`div`,D,[i(`div`,O,[d(v,{person:h.person,class:`-mt-14 size-28 text-2xl ring-4 ring-card`},null,8,[`person`]),i(`div`,k,[i(`h1`,A,l(h.person.name),1),h.person.job_title?(o(),s(`p`,j,l(h.person.job_title),1)):r(``,!0)])]),i(`div`,M,[h.isOwnProfile?(o(),f(p(C),{key:0,variant:`outline`,"as-child":``},{default:a(()=>[d(p(u),{href:`/profil/bearbeiten`},{default:a(()=>[d(p(_)),g[0]||=m(` Profil bearbeiten`,-1)]),_:1})]),_:1})):(o(),f(p(C),{key:1,"as-child":``},{default:a(()=>[i(`a`,{href:`mailto:${h.person.email}`},[d(p(b)),g[1]||=m(` E-Mail schreiben`,-1)],8,N)]),_:1}))])])]),i(`div`,P,[d(w,{title:`Kontakt`,class:`lg:col-span-5`},{default:a(()=>[i(`dl`,F,[(o(!0),s(t,null,c(U.value,n=>(o(),s(`div`,{key:n.label,class:`flex items-start gap-3`},[(o(),f(e(n.icon),{class:`mt-0.5 size-4 shrink-0 text-muted-foreground`})),i(`div`,I,[i(`dt`,L,l(n.label),1),i(`dd`,R,[n.href?(o(),s(`a`,{key:0,href:n.href,class:`text-brand-text hover:underline`},l(n.value),9,z)):(o(),s(t,{key:1},[m(l(n.value),1)],64))])])]))),128))])]),_:1}),d(w,{title:`Über mich`,class:`lg:col-span-7`},{default:a(()=>[h.person.about?(o(),s(`p`,B,l(h.person.about),1)):(o(),s(`p`,V,`Noch keine Angaben.`))]),_:1})])]),_:1},8,[`title`]))}};export{H as default};
|
||||
import{$t as e,F as t,G as n,J as r,K as i,Sn as a,Ut as o,Y as s,Yt as c,lr as l,n as u,nt as d,q as f,rr as p,tt as m}from"./app-D5-myltL.js";import{A as h}from"./BrandLogo-6n9qq87f.js";import{t as g}from"./building-complex-BVkAFlNa.js";import{a as _,r as v,t as y}from"./AppLayout-DI-U1ko3.js";import{n as b,t as x}from"./phone-Cx1UQ_mM.js";import{t as S}from"./map-pin-gOUT4ItV.js";import{t as C}from"./button-CK8gfgLI.js";import{t as w}from"./Panel-qbzyicSq.js";var T=h({name:`smartphone`,size:24,node:[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]}),E={class:`overflow-hidden rounded-lg border bg-card`},D={class:`flex flex-col gap-4 px-6 pb-6 sm:flex-row sm:items-end sm:justify-between`},O={class:`flex flex-col gap-4 sm:flex-row sm:items-end`},k={class:`sm:pb-1`},A={class:`text-2xl font-semibold tracking-tight`},j={key:0,class:`mt-0.5 text-[15px] text-muted-foreground`},M={class:`flex gap-2 sm:pb-1`},N=[`href`],P={class:`mt-6 grid gap-6 lg:grid-cols-12`},F={class:`grid gap-4`},I={class:`min-w-0`},L={class:`text-xs text-muted-foreground`},R={class:`truncate text-sm`},z=[`href`],B={key:0,class:`text-sm leading-relaxed whitespace-pre-line`},V={key:1,class:`text-sm text-muted-foreground`},H={__name:`Show`,props:{person:{type:Object,required:!0},isOwnProfile:{type:Boolean,default:!1}},setup(h){let H=h,U=n(()=>[{icon:b,label:`E-Mail`,value:H.person.email,href:`mailto:${H.person.email}`},{icon:x,label:`Telefon`,value:H.person.phone,href:H.person.phone&&`tel:${H.person.phone}`},{icon:T,label:`Mobil`,value:H.person.mobile,href:H.person.mobile&&`tel:${H.person.mobile}`},{icon:g,label:`Abteilung`,value:H.person.department},{icon:S,label:`Standort`,value:H.person.location}].filter(e=>e.value));return(n,g)=>(o(),f(y,{title:h.person.name},{default:a(()=>[i(`section`,E,[g[2]||=i(`div`,{class:`h-28 bg-brand sm:h-32`,style:{"background-image":`linear-gradient(120deg, transparent 40%, rgb(255 255 255 / 0.08))`}},null,-1),i(`div`,D,[i(`div`,O,[d(v,{person:h.person,class:`-mt-14 size-28 text-2xl ring-4 ring-card`},null,8,[`person`]),i(`div`,k,[i(`h1`,A,l(h.person.name),1),h.person.job_title?(o(),s(`p`,j,l(h.person.job_title),1)):r(``,!0)])]),i(`div`,M,[h.isOwnProfile?(o(),f(p(C),{key:0,variant:`outline`,"as-child":``},{default:a(()=>[d(p(u),{href:`/profil/bearbeiten`},{default:a(()=>[d(p(_)),g[0]||=m(` Profil bearbeiten`,-1)]),_:1})]),_:1})):(o(),f(p(C),{key:1,"as-child":``},{default:a(()=>[i(`a`,{href:`mailto:${h.person.email}`},[d(p(b)),g[1]||=m(` E-Mail schreiben`,-1)],8,N)]),_:1}))])])]),i(`div`,P,[d(w,{title:`Kontakt`,class:`lg:col-span-5`},{default:a(()=>[i(`dl`,F,[(o(!0),s(t,null,c(U.value,n=>(o(),s(`div`,{key:n.label,class:`flex items-start gap-3`},[(o(),f(e(n.icon),{class:`mt-0.5 size-4 shrink-0 text-muted-foreground`})),i(`div`,I,[i(`dt`,L,l(n.label),1),i(`dd`,R,[n.href?(o(),s(`a`,{key:0,href:n.href,class:`text-brand-text hover:underline`},l(n.value),9,z)):(o(),s(t,{key:1},[m(l(n.value),1)],64))])])]))),128))])]),_:1}),d(w,{title:`Über mich`,class:`lg:col-span-7`},{default:a(()=>[h.person.about?(o(),s(`p`,B,l(h.person.about),1)):(o(),s(`p`,V,`Noch keine Angaben.`))]),_:1})])]),_:1},8,[`title`]))}};export{H as default};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
import{A as e}from"./BrandLogo-BTmxPYut.js";var t=e({name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]});export{t};
|
||||
import{A as e}from"./BrandLogo-6n9qq87f.js";var t=e({name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]});export{t};
|
||||
|
|
@ -1 +1 @@
|
|||
import{A as e}from"./BrandLogo-BTmxPYut.js";var t=e({name:`building-complex`,size:24,node:[[`path`,{d:`M10 12h4`,key:`a56b0p`}],[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2`,key:`secmi2`}],[`path`,{d:`M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16`,key:`16ra0t`}]],aliases:[`building-2`]});export{t};
|
||||
import{A as e}from"./BrandLogo-6n9qq87f.js";var t=e({name:`building-complex`,size:24,node:[[`path`,{d:`M10 12h4`,key:`a56b0p`}],[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2`,key:`secmi2`}],[`path`,{d:`M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16`,key:`16ra0t`}]],aliases:[`building-2`]});export{t};
|
||||
|
|
@ -1 +1 @@
|
|||
import{Sn as e,Ut as t,Xt as n,it as r,or as i,q as a,rr as o}from"./app-CsynT-MH.js";import{O as s,d as c,u as l}from"./BrandLogo-BTmxPYut.js";var u=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,d=s,f=(e,t)=>n=>{if(t?.variants==null)return d(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=u(t)||u(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return d(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},p=r({__name:`Button`,props:{variant:{},size:{},class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:`button`}},setup(r){let s=r;return(u,d)=>(t(),a(o(c),{"data-slot":`button`,"data-variant":r.variant,"data-size":r.size,as:r.as,"as-child":r.asChild,class:i(o(l)(o(m)({variant:r.variant,size:r.size}),s.class))},{default:e(()=>[n(u.$slots,`default`)]),_:3},8,[`data-variant`,`data-size`,`as`,`as-child`,`class`]))}}),m=f(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,xs:`h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-xs":`size-6 rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});export{p as t};
|
||||
import{Sn as e,Ut as t,Xt as n,it as r,or as i,q as a,rr as o}from"./app-D5-myltL.js";import{O as s,d as c,u as l}from"./BrandLogo-6n9qq87f.js";var u=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,d=s,f=(e,t)=>n=>{if(t?.variants==null)return d(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=u(t)||u(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return d(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},p=r({__name:`Button`,props:{variant:{},size:{},class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:`button`}},setup(r){let s=r;return(u,d)=>(t(),a(o(c),{"data-slot":`button`,"data-variant":r.variant,"data-size":r.size,as:r.as,"as-child":r.asChild,class:i(o(l)(o(m)({variant:r.variant,size:r.size}),s.class))},{default:e(()=>[n(u.$slots,`default`)]),_:3},8,[`data-variant`,`data-size`,`as`,`as-child`,`class`]))}}),m=f(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,xs:`h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-xs":`size-6 rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});export{p as t};
|
||||
|
|
@ -1 +1 @@
|
|||
import{A as e}from"./BrandLogo-BTmxPYut.js";var t=e({name:`calendar-days`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 13h.01`,key:`1sbv64`}],[`path`,{d:`M12 13h.01`,key:`y0uutt`}],[`path`,{d:`M16 13h.01`,key:`wip0gl`}],[`path`,{d:`M8 17h.01`,key:`p3bg7i`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M16 17h.01`,key:`ql8jdd`}]]});export{t};
|
||||
import{A as e}from"./BrandLogo-6n9qq87f.js";var t=e({name:`calendar-days`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 13h.01`,key:`1sbv64`}],[`path`,{d:`M12 13h.01`,key:`y0uutt`}],[`path`,{d:`M16 13h.01`,key:`wip0gl`}],[`path`,{d:`M8 17h.01`,key:`p3bg7i`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M16 17h.01`,key:`ql8jdd`}]]});export{t};
|
||||
|
|
@ -1 +1 @@
|
|||
import{A as e}from"./BrandLogo-BTmxPYut.js";var t=e({name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]});export{t};
|
||||
import{A as e}from"./BrandLogo-6n9qq87f.js";var t=e({name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]});export{t};
|
||||
|
|
@ -1 +1 @@
|
|||
import{A as e}from"./BrandLogo-BTmxPYut.js";var t=e({name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]});export{t};
|
||||
import{A as e}from"./BrandLogo-6n9qq87f.js";var t=e({name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]});export{t};
|
||||
|
|
@ -1 +1 @@
|
|||
import{A as e}from"./BrandLogo-BTmxPYut.js";var t=e({name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]});export{t};
|
||||
import{A as e}from"./BrandLogo-6n9qq87f.js";var t=e({name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]});export{t};
|
||||
|
|
@ -1 +1 @@
|
|||
import{At as e,G as t,Lt as n,Xn as r,_n as i,ft as a,qn as o,rr as s,tr as c}from"./app-CsynT-MH.js";import{i as l,l as u,n as d,o as f,r as p,s as m}from"./BrandLogo-BTmxPYut.js";var h=d?window:void 0;d&&window.document,d&&window.navigator,d&&window.location;function g(e){let t=c(e);return t?.$el??t}function _(...e){let n=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),r=t(()=>{let t=f(c(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0});return u(()=>[r.value?.map(e=>g(e))??[h].filter(e=>e!=null),f(c(r.value?e[1]:e[0])),f(s(r.value?e[2]:e[1])),c(r.value?e[3]:e[2])],([e,t,r,i],a,o)=>{if(!e?.length||!t?.length||!r?.length)return;let s=l(i)?{...i}:i,c=e.flatMap(e=>t.flatMap(t=>r.map(r=>n(e,t,r,s))));o(()=>{c.forEach(e=>e())})},{flush:`post`})}function v(){let e=r(!1),t=a();return t&&n(()=>{e.value=!0},t),e}function y(e){let n=v();return t(()=>(n.value,!!e()))}function b(e){return JSON.parse(JSON.stringify(e))}function x(e,n,r={}){let{window:a=h,...o}=r,s,l=y(()=>a&&`ResizeObserver`in a),u=()=>{s&&=(s.disconnect(),void 0)},d=t(()=>{let t=c(e);return Array.isArray(t)?t.map(e=>g(e)):[g(t)]}),f=i(d,e=>{if(u(),l.value&&a){s=new ResizeObserver(n);for(let t of e)t instanceof Element&&s.observe(t,o)}},{immediate:!0,flush:`post`}),p=()=>{u(),f()};return m(p),{isSupported:l,stop:p}}function S(n,r,s,c={}){var l,u;let{clone:d=!1,passive:f=!1,eventName:m,deep:h=!1,defaultValue:g,shouldEmit:_}=c,v=a(),y=s||v?.emit||(v==null||(l=v.$emit)==null?void 0:l.bind(v))||(v==null||(u=v.proxy)==null||(u=u.$emit)==null?void 0:u.bind(v?.proxy)),x=m;r||=`modelValue`,x||=`update:${r.toString()}`;let S=e=>d?typeof d==`function`?d(e):b(e):e,C=()=>p(n[r])?S(n[r]):g,w=e=>{_?_(e)&&y(x,e):y(x,e)};if(f){let t=C(),a=o(t),s=!1;return i(()=>n[r],t=>{s||(s=!0,a.value=S(t),e(()=>s=!1))}),i(a,e=>{!s&&(e!==n[r]||h)&&w(e)},{deep:h}),a}return t({get(){return C()},set(e){w(e)}})}export{x as n,S as r,_ as t};
|
||||
import{At as e,G as t,Lt as n,Xn as r,_n as i,ft as a,qn as o,rr as s,tr as c}from"./app-D5-myltL.js";import{i as l,l as u,n as d,o as f,r as p,s as m}from"./BrandLogo-6n9qq87f.js";var h=d?window:void 0;d&&window.document,d&&window.navigator,d&&window.location;function g(e){let t=c(e);return t?.$el??t}function _(...e){let n=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),r=t(()=>{let t=f(c(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0});return u(()=>[r.value?.map(e=>g(e))??[h].filter(e=>e!=null),f(c(r.value?e[1]:e[0])),f(s(r.value?e[2]:e[1])),c(r.value?e[3]:e[2])],([e,t,r,i],a,o)=>{if(!e?.length||!t?.length||!r?.length)return;let s=l(i)?{...i}:i,c=e.flatMap(e=>t.flatMap(t=>r.map(r=>n(e,t,r,s))));o(()=>{c.forEach(e=>e())})},{flush:`post`})}function v(){let e=r(!1),t=a();return t&&n(()=>{e.value=!0},t),e}function y(e){let n=v();return t(()=>(n.value,!!e()))}function b(e){return JSON.parse(JSON.stringify(e))}function x(e,n,r={}){let{window:a=h,...o}=r,s,l=y(()=>a&&`ResizeObserver`in a),u=()=>{s&&=(s.disconnect(),void 0)},d=t(()=>{let t=c(e);return Array.isArray(t)?t.map(e=>g(e)):[g(t)]}),f=i(d,e=>{if(u(),l.value&&a){s=new ResizeObserver(n);for(let t of e)t instanceof Element&&s.observe(t,o)}},{immediate:!0,flush:`post`}),p=()=>{u(),f()};return m(p),{isSupported:l,stop:p}}function S(n,r,s,c={}){var l,u;let{clone:d=!1,passive:f=!1,eventName:m,deep:h=!1,defaultValue:g,shouldEmit:_}=c,v=a(),y=s||v?.emit||(v==null||(l=v.$emit)==null?void 0:l.bind(v))||(v==null||(u=v.proxy)==null||(u=u.$emit)==null?void 0:u.bind(v?.proxy)),x=m;r||=`modelValue`,x||=`update:${r.toString()}`;let S=e=>d?typeof d==`function`?d(e):b(e):e,C=()=>p(n[r])?S(n[r]):g,w=e=>{_?_(e)&&y(x,e):y(x,e)};if(f){let t=C(),a=o(t),s=!1;return i(()=>n[r],t=>{s||(s=!0,a.value=S(t),e(()=>s=!1))}),i(a,e=>{!s&&(e!==n[r]||h)&&w(e)},{deep:h}),a}return t({get(){return C()},set(e){w(e)}})}export{x as n,S as r,_ as t};
|
||||
|
|
@ -1 +1 @@
|
|||
import{A as e}from"./BrandLogo-BTmxPYut.js";var t=e({name:`map-pin`,size:24,node:[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]});export{t};
|
||||
import{A as e}from"./BrandLogo-6n9qq87f.js";var t=e({name:`map-pin`,size:24,node:[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]});export{t};
|
||||
|
|
@ -1 +1 @@
|
|||
import{A as e}from"./BrandLogo-BTmxPYut.js";var t=e({name:`mail`,size:24,node:[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]}),n=e({name:`phone`,size:24,node:[[`path`,{d:`M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384`,key:`9njp5v`}]]});export{t as n,n as t};
|
||||
import{A as e}from"./BrandLogo-6n9qq87f.js";var t=e({name:`mail`,size:24,node:[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]}),n=e({name:`phone`,size:24,node:[[`path`,{d:`M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384`,key:`9njp5v`}]]});export{t as n,n as t};
|
||||
|
|
@ -1 +1 @@
|
|||
import{A as e}from"./BrandLogo-BTmxPYut.js";var t=e({name:`video`,size:24,node:[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]});export{t};
|
||||
import{A as e}from"./BrandLogo-6n9qq87f.js";var t=e({name:`video`,size:24,node:[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]});export{t};
|
||||
|
|
@ -1,158 +1,158 @@
|
|||
{
|
||||
"_AppLayout-F8bBmCnJ.js": {
|
||||
"file": "assets/AppLayout-F8bBmCnJ.js",
|
||||
"_AppLayout-DI-U1ko3.js": {
|
||||
"file": "assets/AppLayout-DI-U1ko3.js",
|
||||
"name": "AppLayout",
|
||||
"imports": [
|
||||
"_RovingFocusGroup-B46-IPpj.js",
|
||||
"_RovingFocusGroup-DPHsLoWY.js",
|
||||
"resources/js/app.js",
|
||||
"_BrandLogo-BTmxPYut.js"
|
||||
"_BrandLogo-6n9qq87f.js"
|
||||
]
|
||||
},
|
||||
"_BrandLogo-BTmxPYut.js": {
|
||||
"file": "assets/BrandLogo-BTmxPYut.js",
|
||||
"_BrandLogo-6n9qq87f.js": {
|
||||
"file": "assets/BrandLogo-6n9qq87f.js",
|
||||
"name": "BrandLogo",
|
||||
"imports": [
|
||||
"resources/js/app.js"
|
||||
]
|
||||
},
|
||||
"_EmptyState-Ckk_-AaU.js": {
|
||||
"file": "assets/EmptyState-Ckk_-AaU.js",
|
||||
"_EmptyState-wvjgIxp3.js": {
|
||||
"file": "assets/EmptyState-wvjgIxp3.js",
|
||||
"name": "EmptyState",
|
||||
"imports": [
|
||||
"resources/js/app.js"
|
||||
]
|
||||
},
|
||||
"_EventDateBlock-Cq5Djfc9.js": {
|
||||
"file": "assets/EventDateBlock-Cq5Djfc9.js",
|
||||
"_EventDateBlock-BEMye_DY.js": {
|
||||
"file": "assets/EventDateBlock-BEMye_DY.js",
|
||||
"name": "EventDateBlock",
|
||||
"imports": [
|
||||
"resources/js/app.js",
|
||||
"_format-Dlm0nTI_.js"
|
||||
]
|
||||
},
|
||||
"_FormField-VAcUnlCp.js": {
|
||||
"file": "assets/FormField-VAcUnlCp.js",
|
||||
"_FormField-BxtniYWy.js": {
|
||||
"file": "assets/FormField-BxtniYWy.js",
|
||||
"name": "FormField",
|
||||
"imports": [
|
||||
"resources/js/app.js",
|
||||
"_BrandLogo-BTmxPYut.js",
|
||||
"_dist-Bb3V_-fF.js"
|
||||
"_BrandLogo-6n9qq87f.js",
|
||||
"_dist-BaRwaKfU.js"
|
||||
]
|
||||
},
|
||||
"_GuestLayout-Cij2uD05.js": {
|
||||
"file": "assets/GuestLayout-Cij2uD05.js",
|
||||
"_GuestLayout-DXTg9GcL.js": {
|
||||
"file": "assets/GuestLayout-DXTg9GcL.js",
|
||||
"name": "GuestLayout",
|
||||
"imports": [
|
||||
"resources/js/app.js",
|
||||
"_BrandLogo-BTmxPYut.js"
|
||||
"_BrandLogo-6n9qq87f.js"
|
||||
]
|
||||
},
|
||||
"_NewsCard-CrFv9-d1.js": {
|
||||
"file": "assets/NewsCard-CrFv9-d1.js",
|
||||
"_NewsCard-C3zrf7NQ.js": {
|
||||
"file": "assets/NewsCard-C3zrf7NQ.js",
|
||||
"name": "NewsCard",
|
||||
"imports": [
|
||||
"resources/js/app.js",
|
||||
"_BrandLogo-BTmxPYut.js",
|
||||
"_BrandLogo-6n9qq87f.js",
|
||||
"_format-Dlm0nTI_.js"
|
||||
]
|
||||
},
|
||||
"_Panel-B3tnckCV.js": {
|
||||
"file": "assets/Panel-B3tnckCV.js",
|
||||
"_Panel-qbzyicSq.js": {
|
||||
"file": "assets/Panel-qbzyicSq.js",
|
||||
"name": "Panel",
|
||||
"imports": [
|
||||
"resources/js/app.js",
|
||||
"_chevron-right-CFe35sP-.js"
|
||||
"_chevron-right-3K_kIePF.js"
|
||||
]
|
||||
},
|
||||
"_RovingFocusGroup-B46-IPpj.js": {
|
||||
"file": "assets/RovingFocusGroup-B46-IPpj.js",
|
||||
"_RovingFocusGroup-DPHsLoWY.js": {
|
||||
"file": "assets/RovingFocusGroup-DPHsLoWY.js",
|
||||
"name": "RovingFocusGroup",
|
||||
"imports": [
|
||||
"resources/js/app.js",
|
||||
"_BrandLogo-BTmxPYut.js"
|
||||
"_BrandLogo-6n9qq87f.js"
|
||||
]
|
||||
},
|
||||
"_arrow-left-mgtA-v8n.js": {
|
||||
"file": "assets/arrow-left-mgtA-v8n.js",
|
||||
"_arrow-left-99a39ArM.js": {
|
||||
"file": "assets/arrow-left-99a39ArM.js",
|
||||
"name": "arrow-left",
|
||||
"imports": [
|
||||
"_BrandLogo-BTmxPYut.js"
|
||||
"_BrandLogo-6n9qq87f.js"
|
||||
]
|
||||
},
|
||||
"_building-complex-BQB_KSrz.js": {
|
||||
"file": "assets/building-complex-BQB_KSrz.js",
|
||||
"_building-complex-BVkAFlNa.js": {
|
||||
"file": "assets/building-complex-BVkAFlNa.js",
|
||||
"name": "building-complex",
|
||||
"imports": [
|
||||
"_BrandLogo-BTmxPYut.js"
|
||||
"_BrandLogo-6n9qq87f.js"
|
||||
]
|
||||
},
|
||||
"_button-By-E3x2v.js": {
|
||||
"file": "assets/button-By-E3x2v.js",
|
||||
"_button-CK8gfgLI.js": {
|
||||
"file": "assets/button-CK8gfgLI.js",
|
||||
"name": "button",
|
||||
"imports": [
|
||||
"resources/js/app.js",
|
||||
"_BrandLogo-BTmxPYut.js"
|
||||
"_BrandLogo-6n9qq87f.js"
|
||||
]
|
||||
},
|
||||
"_calendar-days-BIvZv67X.js": {
|
||||
"file": "assets/calendar-days-BIvZv67X.js",
|
||||
"_calendar-days-idvOkJ3J.js": {
|
||||
"file": "assets/calendar-days-idvOkJ3J.js",
|
||||
"name": "calendar-days",
|
||||
"imports": [
|
||||
"_BrandLogo-BTmxPYut.js"
|
||||
"_BrandLogo-6n9qq87f.js"
|
||||
]
|
||||
},
|
||||
"_chevron-left-BZls6HMK.js": {
|
||||
"file": "assets/chevron-left-BZls6HMK.js",
|
||||
"_chevron-left-DJf03pzL.js": {
|
||||
"file": "assets/chevron-left-DJf03pzL.js",
|
||||
"name": "chevron-left",
|
||||
"imports": [
|
||||
"_BrandLogo-BTmxPYut.js"
|
||||
"_BrandLogo-6n9qq87f.js"
|
||||
]
|
||||
},
|
||||
"_chevron-right-CFe35sP-.js": {
|
||||
"file": "assets/chevron-right-CFe35sP-.js",
|
||||
"_chevron-right-3K_kIePF.js": {
|
||||
"file": "assets/chevron-right-3K_kIePF.js",
|
||||
"name": "chevron-right",
|
||||
"imports": [
|
||||
"_BrandLogo-BTmxPYut.js"
|
||||
"_BrandLogo-6n9qq87f.js"
|
||||
]
|
||||
},
|
||||
"_clock-CvJm3n4o.js": {
|
||||
"file": "assets/clock-CvJm3n4o.js",
|
||||
"_clock-9LUlycVP.js": {
|
||||
"file": "assets/clock-9LUlycVP.js",
|
||||
"name": "clock",
|
||||
"imports": [
|
||||
"_BrandLogo-BTmxPYut.js"
|
||||
"_BrandLogo-6n9qq87f.js"
|
||||
]
|
||||
},
|
||||
"_dist-Bb3V_-fF.js": {
|
||||
"file": "assets/dist-Bb3V_-fF.js",
|
||||
"_dist-BaRwaKfU.js": {
|
||||
"file": "assets/dist-BaRwaKfU.js",
|
||||
"name": "dist",
|
||||
"imports": [
|
||||
"resources/js/app.js",
|
||||
"_BrandLogo-BTmxPYut.js"
|
||||
"_BrandLogo-6n9qq87f.js"
|
||||
]
|
||||
},
|
||||
"_format-Dlm0nTI_.js": {
|
||||
"file": "assets/format-Dlm0nTI_.js",
|
||||
"name": "format"
|
||||
},
|
||||
"_map-pin-BSi6wphK.js": {
|
||||
"file": "assets/map-pin-BSi6wphK.js",
|
||||
"_map-pin-gOUT4ItV.js": {
|
||||
"file": "assets/map-pin-gOUT4ItV.js",
|
||||
"name": "map-pin",
|
||||
"imports": [
|
||||
"_BrandLogo-BTmxPYut.js"
|
||||
"_BrandLogo-6n9qq87f.js"
|
||||
]
|
||||
},
|
||||
"_phone-CmJSf8TQ.js": {
|
||||
"file": "assets/phone-CmJSf8TQ.js",
|
||||
"_phone-Cx1UQ_mM.js": {
|
||||
"file": "assets/phone-Cx1UQ_mM.js",
|
||||
"name": "phone",
|
||||
"imports": [
|
||||
"_BrandLogo-BTmxPYut.js"
|
||||
"_BrandLogo-6n9qq87f.js"
|
||||
]
|
||||
},
|
||||
"_video-DEGAJLRQ.js": {
|
||||
"file": "assets/video-DEGAJLRQ.js",
|
||||
"_video-Bvsp0re8.js": {
|
||||
"file": "assets/video-Bvsp0re8.js",
|
||||
"name": "video",
|
||||
"imports": [
|
||||
"_BrandLogo-BTmxPYut.js"
|
||||
"_BrandLogo-6n9qq87f.js"
|
||||
]
|
||||
},
|
||||
"node_modules/@fontsource-variable/inter/files/inter-cyrillic-ext-wght-normal.woff2": {
|
||||
|
|
@ -184,7 +184,7 @@
|
|||
"src": "node_modules/@fontsource-variable/inter/files/inter-vietnamese-wght-normal.woff2"
|
||||
},
|
||||
"resources/js/app.js": {
|
||||
"file": "assets/app-CsynT-MH.js",
|
||||
"file": "assets/app-D5-myltL.js",
|
||||
"name": "app",
|
||||
"src": "resources/js/app.js",
|
||||
"isEntry": true,
|
||||
|
|
@ -202,7 +202,7 @@
|
|||
"resources/js/pages/Profile/Show.vue"
|
||||
],
|
||||
"css": [
|
||||
"assets/app-DxcDumIk.css"
|
||||
"assets/app-Bgv065de.css"
|
||||
],
|
||||
"assets": [
|
||||
"assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2",
|
||||
|
|
@ -215,177 +215,177 @@
|
|||
]
|
||||
},
|
||||
"resources/js/pages/Auth/ForgotPassword.vue": {
|
||||
"file": "assets/ForgotPassword-CgGduxBM.js",
|
||||
"file": "assets/ForgotPassword-BivSnSWP.js",
|
||||
"name": "ForgotPassword",
|
||||
"src": "resources/js/pages/Auth/ForgotPassword.vue",
|
||||
"isDynamicEntry": true,
|
||||
"imports": [
|
||||
"resources/js/app.js",
|
||||
"_BrandLogo-BTmxPYut.js",
|
||||
"_arrow-left-mgtA-v8n.js",
|
||||
"_button-By-E3x2v.js",
|
||||
"_FormField-VAcUnlCp.js",
|
||||
"_GuestLayout-Cij2uD05.js"
|
||||
"_BrandLogo-6n9qq87f.js",
|
||||
"_arrow-left-99a39ArM.js",
|
||||
"_button-CK8gfgLI.js",
|
||||
"_FormField-BxtniYWy.js",
|
||||
"_GuestLayout-DXTg9GcL.js"
|
||||
]
|
||||
},
|
||||
"resources/js/pages/Auth/Login.vue": {
|
||||
"file": "assets/Login-BiRvw7wL.js",
|
||||
"file": "assets/Login-DiZmMnin.js",
|
||||
"name": "Login",
|
||||
"src": "resources/js/pages/Auth/Login.vue",
|
||||
"isDynamicEntry": true,
|
||||
"imports": [
|
||||
"_RovingFocusGroup-B46-IPpj.js",
|
||||
"_RovingFocusGroup-DPHsLoWY.js",
|
||||
"resources/js/app.js",
|
||||
"_BrandLogo-BTmxPYut.js",
|
||||
"_button-By-E3x2v.js",
|
||||
"_FormField-VAcUnlCp.js",
|
||||
"_GuestLayout-Cij2uD05.js"
|
||||
"_BrandLogo-6n9qq87f.js",
|
||||
"_button-CK8gfgLI.js",
|
||||
"_FormField-BxtniYWy.js",
|
||||
"_GuestLayout-DXTg9GcL.js"
|
||||
]
|
||||
},
|
||||
"resources/js/pages/Auth/ResetPassword.vue": {
|
||||
"file": "assets/ResetPassword-Dz5VpUdf.js",
|
||||
"file": "assets/ResetPassword-CwiyJwHU.js",
|
||||
"name": "ResetPassword",
|
||||
"src": "resources/js/pages/Auth/ResetPassword.vue",
|
||||
"isDynamicEntry": true,
|
||||
"imports": [
|
||||
"resources/js/app.js",
|
||||
"_BrandLogo-BTmxPYut.js",
|
||||
"_button-By-E3x2v.js",
|
||||
"_FormField-VAcUnlCp.js",
|
||||
"_GuestLayout-Cij2uD05.js"
|
||||
"_BrandLogo-6n9qq87f.js",
|
||||
"_button-CK8gfgLI.js",
|
||||
"_FormField-BxtniYWy.js",
|
||||
"_GuestLayout-DXTg9GcL.js"
|
||||
]
|
||||
},
|
||||
"resources/js/pages/Dashboard.vue": {
|
||||
"file": "assets/Dashboard-e5JJv28z.js",
|
||||
"file": "assets/Dashboard-Cy80rTIG.js",
|
||||
"name": "Dashboard",
|
||||
"src": "resources/js/pages/Dashboard.vue",
|
||||
"isDynamicEntry": true,
|
||||
"imports": [
|
||||
"resources/js/app.js",
|
||||
"_BrandLogo-BTmxPYut.js",
|
||||
"_building-complex-BQB_KSrz.js",
|
||||
"_calendar-days-BIvZv67X.js",
|
||||
"_AppLayout-F8bBmCnJ.js",
|
||||
"_chevron-left-BZls6HMK.js",
|
||||
"_chevron-right-CFe35sP-.js",
|
||||
"_clock-CvJm3n4o.js",
|
||||
"_phone-CmJSf8TQ.js",
|
||||
"_NewsCard-CrFv9-d1.js",
|
||||
"_dist-Bb3V_-fF.js",
|
||||
"_EmptyState-Ckk_-AaU.js",
|
||||
"_BrandLogo-6n9qq87f.js",
|
||||
"_building-complex-BVkAFlNa.js",
|
||||
"_calendar-days-idvOkJ3J.js",
|
||||
"_AppLayout-DI-U1ko3.js",
|
||||
"_chevron-left-DJf03pzL.js",
|
||||
"_chevron-right-3K_kIePF.js",
|
||||
"_clock-9LUlycVP.js",
|
||||
"_phone-Cx1UQ_mM.js",
|
||||
"_NewsCard-C3zrf7NQ.js",
|
||||
"_dist-BaRwaKfU.js",
|
||||
"_EmptyState-wvjgIxp3.js",
|
||||
"_format-Dlm0nTI_.js",
|
||||
"_EventDateBlock-Cq5Djfc9.js",
|
||||
"_Panel-B3tnckCV.js"
|
||||
"_EventDateBlock-BEMye_DY.js",
|
||||
"_Panel-qbzyicSq.js"
|
||||
]
|
||||
},
|
||||
"resources/js/pages/Events/Index.vue": {
|
||||
"file": "assets/Index-BIgjOQOx.js",
|
||||
"file": "assets/Index-Dlj62S0U.js",
|
||||
"name": "Index",
|
||||
"src": "resources/js/pages/Events/Index.vue",
|
||||
"isDynamicEntry": true,
|
||||
"imports": [
|
||||
"resources/js/app.js",
|
||||
"_calendar-days-BIvZv67X.js",
|
||||
"_AppLayout-F8bBmCnJ.js",
|
||||
"_map-pin-BSi6wphK.js",
|
||||
"_video-DEGAJLRQ.js",
|
||||
"_EmptyState-Ckk_-AaU.js",
|
||||
"_calendar-days-idvOkJ3J.js",
|
||||
"_AppLayout-DI-U1ko3.js",
|
||||
"_map-pin-gOUT4ItV.js",
|
||||
"_video-Bvsp0re8.js",
|
||||
"_EmptyState-wvjgIxp3.js",
|
||||
"_format-Dlm0nTI_.js",
|
||||
"_EventDateBlock-Cq5Djfc9.js"
|
||||
"_EventDateBlock-BEMye_DY.js"
|
||||
]
|
||||
},
|
||||
"resources/js/pages/Events/Show.vue": {
|
||||
"file": "assets/Show-B5dx92I0.js",
|
||||
"file": "assets/Show-BXWl_lbu.js",
|
||||
"name": "Show",
|
||||
"src": "resources/js/pages/Events/Show.vue",
|
||||
"isDynamicEntry": true,
|
||||
"imports": [
|
||||
"resources/js/app.js",
|
||||
"_BrandLogo-BTmxPYut.js",
|
||||
"_arrow-left-mgtA-v8n.js",
|
||||
"_AppLayout-F8bBmCnJ.js",
|
||||
"_clock-CvJm3n4o.js",
|
||||
"_map-pin-BSi6wphK.js",
|
||||
"_video-DEGAJLRQ.js",
|
||||
"_button-By-E3x2v.js",
|
||||
"_BrandLogo-6n9qq87f.js",
|
||||
"_arrow-left-99a39ArM.js",
|
||||
"_AppLayout-DI-U1ko3.js",
|
||||
"_clock-9LUlycVP.js",
|
||||
"_map-pin-gOUT4ItV.js",
|
||||
"_video-Bvsp0re8.js",
|
||||
"_button-CK8gfgLI.js",
|
||||
"_format-Dlm0nTI_.js",
|
||||
"_EventDateBlock-Cq5Djfc9.js",
|
||||
"_Panel-B3tnckCV.js"
|
||||
"_EventDateBlock-BEMye_DY.js",
|
||||
"_Panel-qbzyicSq.js"
|
||||
]
|
||||
},
|
||||
"resources/js/pages/News/Index.vue": {
|
||||
"file": "assets/Index-kx9gb5BZ.js",
|
||||
"file": "assets/Index-ZM3RglBP.js",
|
||||
"name": "Index",
|
||||
"src": "resources/js/pages/News/Index.vue",
|
||||
"isDynamicEntry": true,
|
||||
"imports": [
|
||||
"resources/js/app.js",
|
||||
"_AppLayout-F8bBmCnJ.js",
|
||||
"_chevron-left-BZls6HMK.js",
|
||||
"_chevron-right-CFe35sP-.js",
|
||||
"_NewsCard-CrFv9-d1.js",
|
||||
"_button-By-E3x2v.js",
|
||||
"_EmptyState-Ckk_-AaU.js"
|
||||
"_AppLayout-DI-U1ko3.js",
|
||||
"_chevron-left-DJf03pzL.js",
|
||||
"_chevron-right-3K_kIePF.js",
|
||||
"_NewsCard-C3zrf7NQ.js",
|
||||
"_button-CK8gfgLI.js",
|
||||
"_EmptyState-wvjgIxp3.js"
|
||||
]
|
||||
},
|
||||
"resources/js/pages/News/Show.vue": {
|
||||
"file": "assets/Show-DHpaMv82.js",
|
||||
"file": "assets/Show-BXzU2MfN.js",
|
||||
"name": "Show",
|
||||
"src": "resources/js/pages/News/Show.vue",
|
||||
"isDynamicEntry": true,
|
||||
"imports": [
|
||||
"resources/js/app.js",
|
||||
"_arrow-left-mgtA-v8n.js",
|
||||
"_AppLayout-F8bBmCnJ.js",
|
||||
"_clock-CvJm3n4o.js",
|
||||
"_NewsCard-CrFv9-d1.js",
|
||||
"_arrow-left-99a39ArM.js",
|
||||
"_AppLayout-DI-U1ko3.js",
|
||||
"_clock-9LUlycVP.js",
|
||||
"_NewsCard-C3zrf7NQ.js",
|
||||
"_format-Dlm0nTI_.js"
|
||||
]
|
||||
},
|
||||
"resources/js/pages/People/Index.vue": {
|
||||
"file": "assets/Index-DylaXNJn.js",
|
||||
"file": "assets/Index-BUE-yMoR.js",
|
||||
"name": "Index",
|
||||
"src": "resources/js/pages/People/Index.vue",
|
||||
"isDynamicEntry": true,
|
||||
"imports": [
|
||||
"resources/js/app.js",
|
||||
"_BrandLogo-BTmxPYut.js",
|
||||
"_AppLayout-F8bBmCnJ.js",
|
||||
"_chevron-left-BZls6HMK.js",
|
||||
"_chevron-right-CFe35sP-.js",
|
||||
"_phone-CmJSf8TQ.js",
|
||||
"_button-By-E3x2v.js"
|
||||
"_BrandLogo-6n9qq87f.js",
|
||||
"_AppLayout-DI-U1ko3.js",
|
||||
"_chevron-left-DJf03pzL.js",
|
||||
"_chevron-right-3K_kIePF.js",
|
||||
"_phone-Cx1UQ_mM.js",
|
||||
"_button-CK8gfgLI.js"
|
||||
]
|
||||
},
|
||||
"resources/js/pages/Profile/Edit.vue": {
|
||||
"file": "assets/Edit-Osg1WMnn.js",
|
||||
"file": "assets/Edit-DHkRd5uy.js",
|
||||
"name": "Edit",
|
||||
"src": "resources/js/pages/Profile/Edit.vue",
|
||||
"isDynamicEntry": true,
|
||||
"imports": [
|
||||
"resources/js/app.js",
|
||||
"_BrandLogo-BTmxPYut.js",
|
||||
"_AppLayout-F8bBmCnJ.js",
|
||||
"_button-By-E3x2v.js",
|
||||
"_FormField-VAcUnlCp.js",
|
||||
"_dist-Bb3V_-fF.js",
|
||||
"_Panel-B3tnckCV.js"
|
||||
"_BrandLogo-6n9qq87f.js",
|
||||
"_AppLayout-DI-U1ko3.js",
|
||||
"_button-CK8gfgLI.js",
|
||||
"_FormField-BxtniYWy.js",
|
||||
"_dist-BaRwaKfU.js",
|
||||
"_Panel-qbzyicSq.js"
|
||||
]
|
||||
},
|
||||
"resources/js/pages/Profile/Show.vue": {
|
||||
"file": "assets/Show-CvpllHlj.js",
|
||||
"file": "assets/Show-CEANdaSL.js",
|
||||
"name": "Show",
|
||||
"src": "resources/js/pages/Profile/Show.vue",
|
||||
"isDynamicEntry": true,
|
||||
"imports": [
|
||||
"resources/js/app.js",
|
||||
"_BrandLogo-BTmxPYut.js",
|
||||
"_building-complex-BQB_KSrz.js",
|
||||
"_AppLayout-F8bBmCnJ.js",
|
||||
"_phone-CmJSf8TQ.js",
|
||||
"_map-pin-BSi6wphK.js",
|
||||
"_button-By-E3x2v.js",
|
||||
"_Panel-B3tnckCV.js"
|
||||
"_BrandLogo-6n9qq87f.js",
|
||||
"_building-complex-BVkAFlNa.js",
|
||||
"_AppLayout-DI-U1ko3.js",
|
||||
"_phone-Cx1UQ_mM.js",
|
||||
"_map-pin-gOUT4ItV.js",
|
||||
"_button-CK8gfgLI.js",
|
||||
"_Panel-qbzyicSq.js"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -15,12 +15,12 @@ defineProps({
|
|||
<div class="flex items-center justify-between gap-4 bg-brand px-6 py-6 text-brand-foreground">
|
||||
<div class="min-w-0">
|
||||
<div class="text-sm opacity-85">{{ greeting }},</div>
|
||||
<div class="mt-0.5 truncate text-[22px] leading-tight font-semibold tracking-tight">{{ user.name }}</div>
|
||||
<div class="mt-1.5 truncate text-[13px] opacity-85">
|
||||
<div class="mt-0.5 text-[22px] leading-tight font-semibold tracking-tight break-words">{{ user.name }}</div>
|
||||
<div class="mt-1.5 line-clamp-2 text-[13px] opacity-85">
|
||||
{{ profile.job_title || 'Schön, dass Sie da sind!' }}
|
||||
</div>
|
||||
</div>
|
||||
<PersonAvatar :person="user" class="size-20 shrink-0 text-xl ring-4 ring-white/25" />
|
||||
<PersonAvatar :person="user" class="size-16 shrink-0 text-lg ring-4 ring-white/25 xl:size-20 xl:text-xl" />
|
||||
</div>
|
||||
<nav class="grid grid-cols-3 divide-x" aria-label="Mein Bereich">
|
||||
<Link :href="`/personen/${user.id}`" class="flex flex-col items-center gap-2 px-2 py-4 text-center text-xs font-medium text-foreground/80 hover:bg-accent hover:text-foreground">
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ const profileIncomplete = computed(() => !props.profile.avatar_url || !props.pro
|
|||
/>
|
||||
</form>
|
||||
<Link href="/personen" class="mt-4 flex items-center justify-between text-[13px] text-muted-foreground hover:text-foreground">
|
||||
{{ peopleCount.toLocaleString('de-DE') }} Kolleginnen und Kollegen im Verzeichnis
|
||||
{{ peopleCount === 1 ? '1 Person' : `${peopleCount.toLocaleString('de-DE')} Personen` }} im Verzeichnis
|
||||
<ArrowRight class="size-4" />
|
||||
</Link>
|
||||
</Panel>
|
||||
|
|
|
|||
161
resources/views/filament/pages/feedback.blade.php
Normal file
161
resources/views/filament/pages/feedback.blade.php
Normal file
|
|
@ -0,0 +1,161 @@
|
|||
<x-filament-panels::page>
|
||||
<style>
|
||||
.ih-form { display: grid; gap: 1.25rem; }
|
||||
.ih-field { display: grid; gap: .375rem; }
|
||||
.ih-label { font-size: .875rem; font-weight: 500; }
|
||||
.ih-hint { font-size: .8125rem; color: rgb(107 114 128); }
|
||||
.ih-error { font-size: .8125rem; color: rgb(220 38 38); }
|
||||
.ih-grid2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
|
||||
.ih-types { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
|
||||
.ih-types label { display: inline-flex; align-items: center; gap: .5rem; font-size: .875rem; }
|
||||
.ih-textarea { width: 100%; min-height: 9rem; border: 0; padding: .5rem .75rem; background: transparent; font-size: .875rem; resize: vertical; }
|
||||
.ih-textarea:focus { outline: none; }
|
||||
.ih-tech { font-size: .8125rem; }
|
||||
.ih-tech summary { cursor: pointer; font-weight: 500; }
|
||||
.ih-tech dl { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin-top: .75rem; }
|
||||
.ih-tech dt { color: rgb(107 114 128); }
|
||||
.ih-tech dd { font-family: ui-monospace, monospace; word-break: break-all; }
|
||||
.ih-privacy { font-size: .8125rem; line-height: 1.55; color: rgb(75 85 99); border-left: 3px solid rgb(209 213 219); padding: .25rem 0 .25rem 1rem; }
|
||||
.ih-privacy ul { list-style: disc; padding-left: 1.25rem; margin: .5rem 0; }
|
||||
.ih-privacy p { margin: .5rem 0; }
|
||||
.ih-table { width: 100%; font-size: .875rem; border-collapse: collapse; }
|
||||
.ih-table th { text-align: left; font-weight: 500; color: rgb(107 114 128); padding: .375rem .5rem .375rem 0; }
|
||||
.ih-table td { padding: .5rem .5rem .5rem 0; border-top: 1px solid rgb(243 244 246); vertical-align: top; }
|
||||
.dark .ih-hint, .dark .ih-privacy, .dark .ih-tech dt, .dark .ih-table th { color: rgb(156 163 175); }
|
||||
.dark .ih-table td { border-color: rgb(55 65 81); }
|
||||
</style>
|
||||
|
||||
@if ($lastReference)
|
||||
<x-filament::callout color="success" icon="heroicon-o-check-circle" heading="Ihre Meldung ist eingegangen">
|
||||
<x-slot name="description">Referenznummer für Rückfragen: <strong>{{ $lastReference }}</strong></x-slot>
|
||||
</x-filament::callout>
|
||||
@endif
|
||||
|
||||
@if ($notice)
|
||||
<x-filament::callout color="warning" icon="heroicon-o-information-circle" :description="$notice" />
|
||||
@endif
|
||||
|
||||
@if (count($types) === 0)
|
||||
<x-filament::section>
|
||||
<p class="ih-hint">Rückmeldungen an den Hersteller sind für dieses Programm derzeit nicht freigeschaltet.</p>
|
||||
</x-filament::section>
|
||||
@else
|
||||
<x-filament::section heading="Neue Rückmeldung" description="Fehlerberichte und Wünsche gehen direkt an das Entwicklungsteam.">
|
||||
<form wire:submit="submit" class="ih-form">
|
||||
<div class="ih-field">
|
||||
<span class="ih-label">Art der Meldung</span>
|
||||
<div class="ih-types">
|
||||
@foreach ($types as $key => $label)
|
||||
<label><x-filament::input.radio wire:model.live="type" value="{{ $key }}" /> {{ $label }}</label>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label class="ih-field">
|
||||
<span class="ih-label">Betreff</span>
|
||||
<x-filament::input.wrapper :valid="! $errors->has('subject')">
|
||||
<x-filament::input type="text" wire:model="subject" maxlength="255" placeholder="Kurz und konkret, z. B. „Export bricht bei großen Listen ab“" />
|
||||
</x-filament::input.wrapper>
|
||||
@error('subject') <span class="ih-error">{{ $message }}</span> @enderror
|
||||
</label>
|
||||
|
||||
<label class="ih-field">
|
||||
<span class="ih-label">Beschreibung</span>
|
||||
<x-filament::input.wrapper :valid="! $errors->has('body')">
|
||||
<textarea class="ih-textarea" wire:model="body" placeholder="{{ $type === 'bugreport' ? 'Was haben Sie getan, was ist passiert, was hätten Sie erwartet?' : 'Was möchten Sie erreichen, und wie würde es Ihnen helfen?' }}"></textarea>
|
||||
</x-filament::input.wrapper>
|
||||
@error('body') <span class="ih-error">{{ $message }}</span> @enderror
|
||||
</label>
|
||||
|
||||
@if ($type === 'bugreport')
|
||||
<label class="ih-field" style="max-width: 16rem">
|
||||
<span class="ih-label">Dringlichkeit</span>
|
||||
<x-filament::input.wrapper>
|
||||
<x-filament::input.select wire:model="severity">
|
||||
<option value="low">Niedrig</option>
|
||||
<option value="normal">Normal</option>
|
||||
<option value="high">Hoch</option>
|
||||
<option value="critical">Kritisch – Arbeit nicht möglich</option>
|
||||
</x-filament::input.select>
|
||||
</x-filament::input.wrapper>
|
||||
</label>
|
||||
@endif
|
||||
|
||||
<div class="ih-grid2">
|
||||
<label class="ih-field">
|
||||
<span class="ih-label">E-Mail für Rückfragen <span class="ih-hint">(freiwillig)</span></span>
|
||||
<x-filament::input.wrapper :valid="! $errors->has('email')">
|
||||
<x-filament::input type="email" wire:model="email" />
|
||||
</x-filament::input.wrapper>
|
||||
@error('email') <span class="ih-error">{{ $message }}</span> @enderror
|
||||
</label>
|
||||
<label class="ih-field">
|
||||
<span class="ih-label">Name <span class="ih-hint">(freiwillig)</span></span>
|
||||
<x-filament::input.wrapper>
|
||||
<x-filament::input type="text" wire:model="name" />
|
||||
</x-filament::input.wrapper>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<details class="ih-tech">
|
||||
<summary>Diese technischen Angaben werden mitgesendet</summary>
|
||||
<dl>
|
||||
<dt>app_version</dt><dd>{{ $technical['app_version'] }}</dd>
|
||||
<dt>current_sha</dt><dd>{{ $technical['current_sha'] ?? '–' }}</dd>
|
||||
<dt>os</dt><dd>{{ $technical['os'] }}</dd>
|
||||
@foreach ($technical['metadata'] as $key => $value)
|
||||
<dt>metadata.{{ $key }}</dt><dd>{{ $value }}</dd>
|
||||
@endforeach
|
||||
</dl>
|
||||
</details>
|
||||
|
||||
{{-- Datenschutzhinweis über dem Absendeknopf (docs/specs/feedback.md). Zeilen für nicht
|
||||
gesendete Angaben sind gestrichen: Anhänge gibt es nicht, Lizenzdaten nur mit Lizenz. --}}
|
||||
<div class="ih-privacy">
|
||||
<p>Mit dem Absenden werden Daten an api.loheide.cloud übertragen. Übermittelt werden:</p>
|
||||
<ul>
|
||||
<li>Ihr Text: Betreff und Beschreibung</li>
|
||||
<li>Name und E-Mail-Adresse, soweit Sie sie angeben – für Rückfragen</li>
|
||||
@if ($hasLicense)
|
||||
<li>Ihre Lizenzdaten, damit die Meldung Ihrem Konto zugeordnet werden kann</li>
|
||||
@endif
|
||||
<li>Programmversion, installierter Stand und Betriebssystem</li>
|
||||
<li>technisch bedingt: Ihre IP-Adresse, Datum und Uhrzeit</li>
|
||||
</ul>
|
||||
<p>Bitte beachten: Was Sie in die Beschreibung schreiben, wird mit übertragen. Enthält es Namen, Adressen oder Vorgänge anderer Personen, entfernen Sie diese bitte vorher.</p>
|
||||
<p>Zweck: Bearbeitung Ihrer Meldung und Rückfragen dazu. Das Senden ist freiwillig; es geschieht nur, wenn Sie es hier auslösen.</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<x-filament::button type="submit" icon="heroicon-o-paper-airplane">Absenden</x-filament::button>
|
||||
</div>
|
||||
</form>
|
||||
</x-filament::section>
|
||||
@endif
|
||||
|
||||
@if ($history->isNotEmpty())
|
||||
<x-filament::section heading="Meine Rückmeldungen">
|
||||
<table class="ih-table">
|
||||
<thead><tr><th>Datum</th><th>Art</th><th>Betreff</th><th>Referenz / Status</th></tr></thead>
|
||||
<tbody>
|
||||
@foreach ($history as $item)
|
||||
<tr>
|
||||
<td>{{ $item->created_at->format('d.m.Y H:i') }}</td>
|
||||
<td>{{ \App\Models\VendorFeedback::TYPES[$item->type] ?? $item->type }}</td>
|
||||
<td>{{ $item->payload['title'] ?? '' }}</td>
|
||||
<td>
|
||||
@if ($item->status === 'sent')
|
||||
<strong>{{ $item->reference }}</strong>
|
||||
@elseif ($item->status === 'pending')
|
||||
<x-filament::badge color="warning">wird gesendet ({{ $item->attempts }}. Versuch)</x-filament::badge>
|
||||
@else
|
||||
<x-filament::badge color="danger">nicht zugestellt</x-filament::badge>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</x-filament::section>
|
||||
@endif
|
||||
</x-filament-panels::page>
|
||||
39
resources/views/filament/pages/system-health.blade.php
Normal file
39
resources/views/filament/pages/system-health.blade.php
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<x-filament-panels::page>
|
||||
<style>
|
||||
.ih-list { display: grid; }
|
||||
.ih-item { display: grid; grid-template-columns: 1.5rem 14rem 1fr; gap: .75rem; padding: .625rem 0; border-top: 1px solid rgb(243 244 246); font-size: .875rem; align-items: start; }
|
||||
.ih-item:first-child { border-top: 0; }
|
||||
.ih-dot { width: .75rem; height: .75rem; border-radius: 999px; margin-top: .3rem; }
|
||||
.ih-ok { background: rgb(22 163 74); }
|
||||
.ih-warning { background: rgb(217 119 6); }
|
||||
.ih-error { background: rgb(220 38 38); }
|
||||
.ih-label { font-weight: 500; }
|
||||
.ih-code { font-family: ui-monospace, monospace; font-size: .8125rem; word-break: break-all; padding: .5rem .75rem; border-radius: .5rem; background: rgb(243 244 246); }
|
||||
.ih-hint { font-size: .875rem; color: rgb(107 114 128); margin: .5rem 0; }
|
||||
.dark .ih-item { border-color: rgb(55 65 81); }
|
||||
.dark .ih-code { background: rgb(31 41 55); }
|
||||
.dark .ih-hint { color: rgb(156 163 175); }
|
||||
@media (max-width: 640px) { .ih-item { grid-template-columns: 1.5rem 1fr; } .ih-item > :last-child { grid-column: 2; } }
|
||||
</style>
|
||||
|
||||
@foreach ($groups as $heading => $checks)
|
||||
<x-filament::section :heading="$heading">
|
||||
<div class="ih-list">
|
||||
@foreach ($checks as $check)
|
||||
<div class="ih-item">
|
||||
<span class="ih-dot ih-{{ $check['status'] }}" title="{{ ['ok' => 'in Ordnung', 'warning' => 'Hinweis', 'error' => 'Problem'][$check['status']] }}"></span>
|
||||
<span class="ih-label">{{ $check['label'] }}</span>
|
||||
<span>{{ $check['message'] }}</span>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</x-filament::section>
|
||||
@endforeach
|
||||
|
||||
<x-filament::section heading="Hintergrundaufgaben einrichten" description="Für Rückmeldungen, geplante Inhalte und Aufräumarbeiten. Ohne Einrichtung laufen sie nur, wenn jemand das Portal aufruft.">
|
||||
<p class="ih-hint">Am besten: ein Cronjob beim Hoster, der jede Minute läuft:</p>
|
||||
<div class="ih-code">{{ $cronLine }}</div>
|
||||
<p class="ih-hint">Ohne Cron-Zugang: diese Adresse jede Minute von einem Cron-Dienst aufrufen lassen (geheim halten):</p>
|
||||
<div class="ih-code">{{ $webCronUrl }}</div>
|
||||
</x-filament::section>
|
||||
</x-filament-panels::page>
|
||||
360
resources/views/filament/pages/updates.blade.php
Normal file
360
resources/views/filament/pages/updates.blade.php
Normal file
|
|
@ -0,0 +1,360 @@
|
|||
<x-filament-panels::page>
|
||||
<style>
|
||||
.ih-stack { display: grid; gap: 1.5rem; }
|
||||
.ih-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; }
|
||||
.ih-muted { color: rgb(107 114 128); font-size: .875rem; }
|
||||
.ih-strong { font-weight: 600; }
|
||||
.ih-big { font-size: 1.5rem; font-weight: 600; letter-spacing: -.01em; }
|
||||
.ih-progress { height: .5rem; border-radius: 999px; background: rgb(229 231 235); overflow: hidden; }
|
||||
.ih-progress > div { height: 100%; background: var(--primary-600); transition: width .4s ease; }
|
||||
.ih-prose { font-size: .875rem; line-height: 1.6; }
|
||||
.ih-prose ul { list-style: disc; padding-left: 1.25rem; margin: .25rem 0; }
|
||||
.ih-prose p { margin: .25rem 0; }
|
||||
.ih-prose a { color: var(--primary-600); text-decoration: underline; }
|
||||
.ih-entry + .ih-entry { border-top: 1px solid rgb(229 231 235); padding-top: 1rem; margin-top: 1rem; }
|
||||
.ih-privacy { font-size: .8125rem; line-height: 1.55; color: rgb(75 85 99); border-left: 3px solid rgb(209 213 219); padding: .25rem 0 .25rem 1rem; }
|
||||
.ih-privacy ul { list-style: disc; padding-left: 1.25rem; margin: .5rem 0; }
|
||||
.ih-privacy p { margin: .5rem 0; }
|
||||
.ih-table { width: 100%; font-size: .875rem; border-collapse: collapse; }
|
||||
.ih-table td { padding: .375rem 0; border-bottom: 1px solid rgb(243 244 246); }
|
||||
.ih-grid2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
|
||||
.ih-select { border: 1px solid rgb(209 213 219); border-radius: .5rem; padding: .375rem 2rem .375rem .75rem; font-size: .875rem; background-color: transparent; }
|
||||
.dark .ih-muted, .dark .ih-privacy { color: rgb(156 163 175); }
|
||||
.dark .ih-progress { background: rgb(55 65 81); }
|
||||
.dark .ih-entry + .ih-entry, .dark .ih-table td { border-color: rgb(55 65 81); }
|
||||
</style>
|
||||
|
||||
<script>
|
||||
function updater({ csrf, progress, channel }) {
|
||||
return {
|
||||
csrf,
|
||||
progress,
|
||||
channel,
|
||||
result: null,
|
||||
error: null,
|
||||
checking: false,
|
||||
installing: false,
|
||||
migrationMessage: '',
|
||||
timer: null,
|
||||
|
||||
get busy() {
|
||||
return this.checking || this.installing;
|
||||
},
|
||||
|
||||
init() {
|
||||
// Seite während eines laufenden Updates neu geladen: weiter beobachten.
|
||||
if (!['idle', 'done', 'error'].includes(this.progress.step)) {
|
||||
this.installing = true;
|
||||
this.poll();
|
||||
}
|
||||
},
|
||||
|
||||
async post(url, body = {}) {
|
||||
const response = await fetch(url, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json', Accept: 'application/json', 'X-CSRF-TOKEN': this.csrf },
|
||||
body: JSON.stringify(body),
|
||||
});
|
||||
|
||||
return response.json().catch(() => ({ ok: false, message: `Unerwartete Antwort (HTTP ${response.status}).` }));
|
||||
},
|
||||
|
||||
async check() {
|
||||
this.checking = true;
|
||||
this.error = null;
|
||||
this.result = null;
|
||||
|
||||
try {
|
||||
const data = await this.post('/admin/update/check');
|
||||
data.ok ? (this.result = data.result) : (this.error = data.message);
|
||||
|
||||
if (data.license_input) {
|
||||
this.error += ' Die Lizenzdaten können unten eingegeben werden.';
|
||||
}
|
||||
} catch (e) {
|
||||
this.error = 'Die Update-Suche konnte nicht ausgeführt werden.';
|
||||
} finally {
|
||||
this.checking = false;
|
||||
}
|
||||
},
|
||||
|
||||
updateSummary() {
|
||||
const r = this.result;
|
||||
const parts = [];
|
||||
|
||||
parts.push(r.version ? `Version ${r.version} (${r.latest_short})` : `Stand ${r.latest_short}`);
|
||||
|
||||
if (r.released_at) {
|
||||
parts.push(`veröffentlicht am ${new Date(r.released_at).toLocaleDateString('de-DE')}`);
|
||||
}
|
||||
|
||||
if (r.versions_behind > 0) {
|
||||
parts.push(`${r.versions_behind} Version(en) zurück`);
|
||||
}
|
||||
|
||||
return parts.join(' · ');
|
||||
},
|
||||
|
||||
async install() {
|
||||
if (!confirm('Jetzt aktualisieren? Das Portal ist währenddessen kurz nicht erreichbar.')) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.installing = true;
|
||||
this.progress = { pct: 0, step: 'maintenance', text: 'Aktualisierung wird gestartet …' };
|
||||
this.poll();
|
||||
|
||||
// Der Server arbeitet weiter, auch wenn diese Anfrage abbricht – maßgeblich ist der Fortschritt.
|
||||
this.post('/admin/update/install').catch(() => {});
|
||||
},
|
||||
|
||||
poll() {
|
||||
clearTimeout(this.timer);
|
||||
this.timer = setTimeout(async () => {
|
||||
try {
|
||||
const response = await fetch('/admin/update/progress', { headers: { Accept: 'application/json' } });
|
||||
this.progress = await response.json();
|
||||
} catch (e) {
|
||||
// Kurzzeitig nicht erreichbar (z. B. beim Austausch der Dateien) – weiter versuchen.
|
||||
}
|
||||
|
||||
if (this.progress.step === 'done') {
|
||||
this.installing = false;
|
||||
setTimeout(() => window.location.reload(), 1500);
|
||||
} else if (this.progress.step === 'error') {
|
||||
this.installing = false;
|
||||
} else {
|
||||
this.poll();
|
||||
}
|
||||
}, 2000);
|
||||
},
|
||||
|
||||
async changeChannel() {
|
||||
const data = await this.post('/admin/update/channel', { channel: this.channel });
|
||||
this.result = null;
|
||||
this.error = data.ok ? null : (data.message ?? 'Kanal konnte nicht gespeichert werden.');
|
||||
},
|
||||
|
||||
async runMigrations() {
|
||||
this.migrationMessage = 'Läuft …';
|
||||
const data = await this.post('/admin/update/migrations');
|
||||
this.migrationMessage = data.ok ? `${data.count} Migration(en) ausgeführt.` : data.message;
|
||||
|
||||
if (data.ok && data.count > 0) {
|
||||
setTimeout(() => window.location.reload(), 1200);
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="ih-stack"
|
||||
x-data="updater({
|
||||
csrf: @js(csrf_token()),
|
||||
progress: @js($progress),
|
||||
channel: @js($activeChannel),
|
||||
})"
|
||||
x-init="init()"
|
||||
>
|
||||
{{-- Version und Kanal --}}
|
||||
<x-filament::section>
|
||||
<div class="ih-row" style="justify-content: space-between">
|
||||
<div>
|
||||
<div class="ih-muted">Installierte Version</div>
|
||||
<div class="ih-big">{{ $release }} @if ($shortSha)<span class="ih-muted" style="font-size: 1rem">({{ $shortSha }})</span>@endif</div>
|
||||
</div>
|
||||
<label class="ih-row" style="gap: .5rem">
|
||||
<span class="ih-muted">Update-Kanal</span>
|
||||
<select class="ih-select" x-model="channel" @change="changeChannel()" :disabled="busy">
|
||||
@foreach ($channels as $key => $label)
|
||||
<option value="{{ $key }}">{{ $label }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
</x-filament::section>
|
||||
|
||||
{{-- Suche und Installation --}}
|
||||
<x-filament::section heading="Nach Updates suchen">
|
||||
<div class="ih-stack" style="gap: 1rem">
|
||||
<div class="ih-row">
|
||||
<x-filament::button icon="heroicon-o-magnifying-glass" x-on:click="check()" x-bind:disabled="busy">
|
||||
Nach Updates suchen
|
||||
</x-filament::button>
|
||||
<x-filament::loading-indicator class="h-5 w-5" x-show="checking" x-cloak />
|
||||
</div>
|
||||
|
||||
<template x-if="error">
|
||||
<x-filament::callout color="danger" icon="heroicon-o-exclamation-triangle">
|
||||
<x-slot name="description"><span x-text="error"></span></x-slot>
|
||||
</x-filament::callout>
|
||||
</template>
|
||||
|
||||
<template x-if="result && !result.has_update">
|
||||
<x-filament::callout color="success" icon="heroicon-o-check-circle" heading="Sie verwenden die neueste Version." />
|
||||
</template>
|
||||
|
||||
<template x-if="result && result.has_update">
|
||||
<div class="ih-stack" style="gap: 1rem">
|
||||
<x-filament::callout color="info" icon="heroicon-o-arrow-down-circle" heading="Neue Version verfügbar">
|
||||
<x-slot name="description">
|
||||
<span x-text="updateSummary()"></span>
|
||||
<template x-if="result.channel_switch && result.channel_switch.direction === 'back'">
|
||||
<span><br>Hinweis: Der Stand stammt aus einem anderen Kanal und ist älter als der installierte – das ist beim Zurückwechseln normal.</span>
|
||||
</template>
|
||||
</x-slot>
|
||||
</x-filament::callout>
|
||||
|
||||
<template x-if="result.changelog.length">
|
||||
<div>
|
||||
<div class="ih-strong" style="margin-bottom: .5rem">Was ist neu?</div>
|
||||
<template x-for="entry in result.changelog" :key="entry.heading">
|
||||
<div class="ih-entry">
|
||||
<div class="ih-strong" x-text="entry.heading"></div>
|
||||
<div class="ih-prose" x-html="entry.html"></div>
|
||||
</div>
|
||||
</template>
|
||||
<template x-if="!result.changelog_complete">
|
||||
<p class="ih-muted" style="margin-top: .75rem">
|
||||
Gekürzt – <a :href="result.changelog_url" target="_blank" rel="noopener" style="text-decoration: underline">vollständiges Änderungsprotokoll</a>
|
||||
</p>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="ih-row">
|
||||
<x-filament::button color="success" icon="heroicon-o-arrow-path" x-on:click="install()" x-bind:disabled="busy">
|
||||
Jetzt aktualisieren
|
||||
</x-filament::button>
|
||||
<span class="ih-muted">Das Portal zeigt währenddessen eine Wartungsseite.</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template x-if="progress.step !== 'idle' && (installing || progress.step === 'error' || progress.step === 'done')">
|
||||
<div class="ih-stack" style="gap: .5rem">
|
||||
<div class="ih-row" style="justify-content: space-between">
|
||||
<span x-text="progress.text"></span>
|
||||
<span class="ih-muted" x-show="progress.pct >= 0" x-text="progress.pct + ' %'"></span>
|
||||
</div>
|
||||
<div class="ih-progress" x-show="progress.pct >= 0"><div :style="`width: ${Math.max(progress.pct, 3)}%`"></div></div>
|
||||
<template x-if="progress.step === 'error'">
|
||||
<x-filament::callout color="danger" icon="heroicon-o-x-circle" heading="Aktualisierung fehlgeschlagen">
|
||||
<x-slot name="description"><span x-text="progress.text"></span> Die bisherige Version läuft weiter.</x-slot>
|
||||
</x-filament::callout>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
{{-- Datenschutzhinweis: dauerhaft sichtbar, Wortlaut nach Vorgabe (docs/specs/self-updater.md). --}}
|
||||
<div class="ih-privacy">
|
||||
<p>Bei der Suche nach Updates und beim Herunterladen einer neuen Fassung werden Daten an update.loheide.cloud übertragen. Übermittelt werden:</p>
|
||||
<ul>
|
||||
<li>die auf Ihrer Lizenz hinterlegte E-Mail-Adresse und der Lizenzschlüssel</li>
|
||||
<li>eine Gerätekennung, die dieses Programm einmalig als Zufallszahl erzeugt hat (keine Hardwarekennung, keine Seriennummer) – damit wird gezählt, auf wie vielen Geräten die Lizenz genutzt wird</li>
|
||||
<li>Rechnername, Betriebssystem und Programmversion, damit Sie Ihre Geräte im Kundenportal auseinanderhalten können</li>
|
||||
<li>der bei Ihnen installierte Stand, damit die Gegenstelle weiß, was neu ist</li>
|
||||
<li>technisch bedingt: Ihre IP-Adresse, Datum und Uhrzeit des Abrufs</li>
|
||||
</ul>
|
||||
<p>Zweck: Bereitstellung der Aktualisierung und Prüfung der Lizenz.</p>
|
||||
<p>Nicht übertragen werden Inhalte aus diesem Programm: keine Dokumente, keine Datenbank, keine Eingaben. Die Verbindung ist verschlüsselt.</p>
|
||||
</div>
|
||||
</div>
|
||||
</x-filament::section>
|
||||
|
||||
{{-- Lizenz --}}
|
||||
<x-filament::section heading="Lizenz" description="Die Lizenz wird nur für den Bezug von Updates benötigt. Ein Lizenzproblem schränkt die Nutzung des Portals nicht ein.">
|
||||
<div class="ih-stack" style="gap: 1.25rem">
|
||||
@if ($licenseError || $licenseStatusError)
|
||||
<x-filament::callout color="warning" icon="heroicon-o-exclamation-triangle" :description="$licenseError ?? $licenseStatusError" />
|
||||
@endif
|
||||
|
||||
@if ($licenseSummary)
|
||||
@if ($licenseSummary['expires_soon'])
|
||||
<x-filament::callout color="warning" icon="heroicon-o-clock" heading="Lizenz läuft bald ab" :description="'Noch '.$licenseSummary['days_remaining'].' Tage. Updates stehen danach erst nach einer Verlängerung wieder zur Verfügung.'" />
|
||||
@endif
|
||||
|
||||
<table class="ih-table">
|
||||
<tr><td class="ih-muted">Registriert auf</td><td>{{ collect([$licenseSummary['registered_to']['company'] ?? null, $licenseSummary['registered_to']['contact_name'] ?? null])->filter()->implode(' · ') ?: '–' }}</td></tr>
|
||||
<tr><td class="ih-muted">Laufzeit</td><td>
|
||||
@if ($licenseSummary['unlimited'])
|
||||
unbefristet
|
||||
@elseif ($licenseSummary['expired'])
|
||||
abgelaufen
|
||||
@elseif ($licenseSummary['valid_until'])
|
||||
bis {{ \Illuminate\Support\Carbon::parse($licenseSummary['valid_until'])->format('d.m.Y') }}@if ($licenseSummary['days_remaining'] !== null) (noch {{ $licenseSummary['days_remaining'] }} Tage)@endif
|
||||
@else
|
||||
–
|
||||
@endif
|
||||
</td></tr>
|
||||
<tr><td class="ih-muted">Geräteplätze</td><td>{{ $licenseSummary['devices']['used'] ?? '?' }} von {{ $licenseSummary['devices']['max'] ?? '?' }} belegt</td></tr>
|
||||
<tr><td class="ih-muted">Diese Installation</td><td>{{ $deviceLabel }}</td></tr>
|
||||
</table>
|
||||
@endif
|
||||
|
||||
<form wire:submit="saveLicense" class="ih-stack" style="gap: 1rem">
|
||||
<div class="ih-grid2">
|
||||
<label>
|
||||
<span class="ih-muted">Lizenz-E-Mail</span>
|
||||
<x-filament::input.wrapper :valid="! $errors->has('licenseEmail')">
|
||||
<x-filament::input type="email" wire:model="licenseEmail" autocomplete="off" />
|
||||
</x-filament::input.wrapper>
|
||||
@error('licenseEmail') <span class="ih-muted" style="color: rgb(220 38 38)">{{ $message }}</span> @enderror
|
||||
</label>
|
||||
<label>
|
||||
<span class="ih-muted">Lizenzschlüssel @if ($maskedKey)(hinterlegt: {{ $maskedKey }})@endif</span>
|
||||
<x-filament::input.wrapper :valid="! $errors->has('licenseKey')">
|
||||
<x-filament::input type="password" wire:model="licenseKey" autocomplete="off" :placeholder="$maskedKey ? 'Leer lassen, um ihn zu behalten' : ''" />
|
||||
</x-filament::input.wrapper>
|
||||
@error('licenseKey') <span class="ih-muted" style="color: rgb(220 38 38)">{{ $message }}</span> @enderror
|
||||
</label>
|
||||
</div>
|
||||
<p class="ih-muted">Die Lizenz-E-Mail ist die Adresse, auf die die Lizenz ausgestellt ist – nicht zwingend Ihre eigene.</p>
|
||||
<div class="ih-row">
|
||||
<x-filament::button type="submit">Speichern und prüfen</x-filament::button>
|
||||
@if ($hasLicense)
|
||||
<x-filament::button color="gray" wire:click="checkLicense">Lizenz prüfen</x-filament::button>
|
||||
<x-filament::button color="danger" outlined wire:click="releaseDevice" wire:confirm="Diese Installation bei der Lizenz abmelden? Der Geräteplatz wird frei, Updates sind danach erst nach erneuter Prüfung möglich.">
|
||||
Diese Installation abmelden
|
||||
</x-filament::button>
|
||||
@endif
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</x-filament::section>
|
||||
|
||||
{{-- Migrationen --}}
|
||||
<x-filament::section heading="Datenbank" :description="$pendingMigrations ? $pendingMigrations.' ausstehende Migration(en)' : 'Alle Migrationen sind angewendet.'" collapsible :collapsed="! $pendingMigrations">
|
||||
<div class="ih-stack" style="gap: 1rem">
|
||||
<div class="ih-row">
|
||||
<x-filament::button color="gray" icon="heroicon-o-circle-stack" x-on:click="runMigrations()" x-bind:disabled="busy">Migrationen ausführen</x-filament::button>
|
||||
<span class="ih-muted" x-text="migrationMessage"></span>
|
||||
</div>
|
||||
<table class="ih-table">
|
||||
@foreach ($migrations as $migration)
|
||||
<tr>
|
||||
<td style="font-family: ui-monospace, monospace; font-size: .8125rem">{{ $migration['name'] }}</td>
|
||||
<td style="text-align: right">
|
||||
<x-filament::badge :color="$migration['ran'] ? 'success' : 'warning'">{{ $migration['ran'] ? 'angewendet' : 'offen' }}</x-filament::badge>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
</div>
|
||||
</x-filament::section>
|
||||
|
||||
{{-- Änderungsprotokoll --}}
|
||||
<x-filament::section heading="Änderungsprotokoll" collapsible>
|
||||
@forelse ($changelog as $section)
|
||||
<div class="ih-entry">
|
||||
<div class="ih-strong">Version {{ $section['heading'] }}</div>
|
||||
<div class="ih-prose">{!! $section['html'] !!}</div>
|
||||
</div>
|
||||
@empty
|
||||
<p class="ih-muted">Kein Änderungsprotokoll vorhanden.</p>
|
||||
@endforelse
|
||||
</x-filament::section>
|
||||
</div>
|
||||
|
||||
</x-filament-panels::page>
|
||||
55
resources/views/install/account.blade.php
Normal file
55
resources/views/install/account.blade.php
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
@extends('install.layout', ['step' => 3])
|
||||
|
||||
@section('content')
|
||||
<h1>Portal und Administrator</h1>
|
||||
<p class="lead">Mit diesem Konto verwalten Sie das Portal. Weitere Personen legen Sie später im Admin-Bereich an oder binden Ihren Identity Provider an.</p>
|
||||
|
||||
<form method="post" action="/install/konto">
|
||||
@csrf
|
||||
<label for="portal_name">Name des Portals</label>
|
||||
<input id="portal_name" name="portal_name" value="{{ old('portal_name', 'Mitarbeiterportal') }}" required>
|
||||
@error('portal_name') <div class="error">{{ $message }}</div> @enderror
|
||||
|
||||
<div class="row">
|
||||
<div>
|
||||
<label for="first_name">Vorname</label>
|
||||
<input id="first_name" name="first_name" value="{{ old('first_name') }}" required autocomplete="given-name">
|
||||
@error('first_name') <div class="error">{{ $message }}</div> @enderror
|
||||
</div>
|
||||
<div>
|
||||
<label for="last_name">Nachname</label>
|
||||
<input id="last_name" name="last_name" value="{{ old('last_name') }}" required autocomplete="family-name">
|
||||
@error('last_name') <div class="error">{{ $message }}</div> @enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label for="email">E-Mail-Adresse</label>
|
||||
<input id="email" name="email" type="email" value="{{ old('email') }}" required autocomplete="username">
|
||||
@error('email') <div class="error">{{ $message }}</div> @enderror
|
||||
|
||||
<div class="row">
|
||||
<div>
|
||||
<label for="password">Passwort</label>
|
||||
<input id="password" name="password" type="password" required autocomplete="new-password">
|
||||
</div>
|
||||
<div>
|
||||
<label for="password_confirmation">Wiederholen</label>
|
||||
<input id="password_confirmation" name="password_confirmation" type="password" required autocomplete="new-password">
|
||||
</div>
|
||||
</div>
|
||||
@error('password') <div class="error">{{ $message }}</div> @else <div class="hint">Mindestens 10 Zeichen, mit Buchstaben und Ziffern.</div> @enderror
|
||||
|
||||
<fieldset>
|
||||
<legend>Lizenz (optional, für Updates)</legend>
|
||||
<label for="license_email">Lizenz-E-Mail</label>
|
||||
<input id="license_email" name="license_email" type="email" value="{{ old('license_email') }}" autocomplete="off">
|
||||
@error('license_email') <div class="error">{{ $message }}</div> @enderror
|
||||
<label for="license_key">Lizenzschlüssel</label>
|
||||
<input id="license_key" name="license_key" type="password" autocomplete="off">
|
||||
@error('license_key') <div class="error">{{ $message }}</div> @enderror
|
||||
<div class="hint">Kann auch später unter „Aktualisierung“ hinterlegt werden.</div>
|
||||
</fieldset>
|
||||
|
||||
<button type="submit">Einrichtung abschließen</button>
|
||||
</form>
|
||||
@endsection
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue