added a help system, replaced the words "tenant" and "Pwa" with better alternatives. corrected and implemented cron jobs. prepared going live on a coolify-powered system.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\PhotoboothSettings\Pages;
|
||||
|
||||
use App\Filament\Resources\PhotoboothSettings\PhotoboothSettingResource;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditPhotoboothSetting extends EditRecord
|
||||
{
|
||||
protected static string $resource = PhotoboothSettingResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
protected function getRedirectUrl(): string
|
||||
{
|
||||
return $this->getResource()::getUrl('index');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\PhotoboothSettings\Pages;
|
||||
|
||||
use App\Filament\Resources\PhotoboothSettings\PhotoboothSettingResource;
|
||||
use App\Models\PhotoboothSetting;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListPhotoboothSettings extends ListRecords
|
||||
{
|
||||
protected static string $resource = PhotoboothSettingResource::class;
|
||||
|
||||
public function mount(): void
|
||||
{
|
||||
parent::mount();
|
||||
|
||||
PhotoboothSetting::current();
|
||||
}
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\PhotoboothSettings;
|
||||
|
||||
use App\Filament\Resources\PhotoboothSettings\Pages\EditPhotoboothSetting;
|
||||
use App\Filament\Resources\PhotoboothSettings\Pages\ListPhotoboothSettings;
|
||||
use App\Filament\Resources\PhotoboothSettings\Schemas\PhotoboothSettingForm;
|
||||
use App\Filament\Resources\PhotoboothSettings\Schemas\PhotoboothSettingInfolist;
|
||||
use App\Filament\Resources\PhotoboothSettings\Tables\PhotoboothSettingsTable;
|
||||
use App\Models\PhotoboothSetting;
|
||||
use BackedEnum;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use UnitEnum;
|
||||
|
||||
class PhotoboothSettingResource extends Resource
|
||||
{
|
||||
protected static ?string $model = PhotoboothSetting::class;
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack;
|
||||
|
||||
protected static UnitEnum|string|null $navigationGroup = null;
|
||||
|
||||
protected static ?int $navigationSort = 95;
|
||||
|
||||
public static function getNavigationGroup(): UnitEnum|string|null
|
||||
{
|
||||
return __('admin.nav.platform_management');
|
||||
}
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return PhotoboothSettingForm::configure($schema);
|
||||
}
|
||||
|
||||
public static function infolist(Schema $schema): Schema
|
||||
{
|
||||
return PhotoboothSettingInfolist::configure($schema);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return PhotoboothSettingsTable::configure($table);
|
||||
}
|
||||
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => ListPhotoboothSettings::route('/'),
|
||||
'edit' => EditPhotoboothSetting::route('/{record}/edit'),
|
||||
];
|
||||
}
|
||||
|
||||
public static function canCreate(?Model $record = null): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function canDelete(?Model $record = null): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function canDeleteAny(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\PhotoboothSettings\Schemas;
|
||||
|
||||
use Filament\Forms\Components\Section;
|
||||
use Filament\Forms\Components\TagsInput;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Toggle;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class PhotoboothSettingForm
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema->components([
|
||||
Section::make(__('FTP-Verbindung'))
|
||||
->description(__('Globale Parameter für den vsftpd-Container.'))
|
||||
->schema([
|
||||
TextInput::make('ftp_port')
|
||||
->numeric()
|
||||
->required()
|
||||
->minValue(1)
|
||||
->maxValue(65535)
|
||||
->helperText(__('Standard: Port 2121 innerhalb des internen Netzwerks.')),
|
||||
TextInput::make('rate_limit_per_minute')
|
||||
->label(__('Uploads pro Minute'))
|
||||
->numeric()
|
||||
->required()
|
||||
->minValue(1)
|
||||
->maxValue(200)
|
||||
->helperText(__('Harte Rate-Limits für Photobooth-Clients.')),
|
||||
TextInput::make('expiry_grace_days')
|
||||
->label(__('Ablauf (Tage nach Eventende)'))
|
||||
->numeric()
|
||||
->required()
|
||||
->minValue(0)
|
||||
->maxValue(14),
|
||||
])->columns(3),
|
||||
Section::make(__('Sicherheit & Steuerung'))
|
||||
->schema([
|
||||
Toggle::make('require_ftps')
|
||||
->label(__('FTPS erzwingen'))
|
||||
->helperText(__('Aktivieren, wenn nur verschlüsselte FTP-Verbindungen erlaubt sein sollen.')),
|
||||
TagsInput::make('allowed_ip_ranges')
|
||||
->label(__('Erlaubte IP-Ranges (optional)'))
|
||||
->placeholder('10.0.0.0/24')
|
||||
->helperText(__('Liste optionaler CIDR-Ranges für Control-Service Allowlisting.')),
|
||||
TextInput::make('control_service_base_url')
|
||||
->label(__('Control-Service URL'))
|
||||
->url()
|
||||
->maxLength(191)
|
||||
->helperText(__('REST-Endpunkt des Provisioning-Sidecars (z. B. http://control:8080).')),
|
||||
TextInput::make('control_service_token_identifier')
|
||||
->label(__('Token Referenz'))
|
||||
->maxLength(191)
|
||||
->helperText(__('Bezeichner des Secrets im Secrets-Store (keine Klartext-Tokens speichern).')),
|
||||
])->columns(2),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\PhotoboothSettings\Schemas;
|
||||
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class PhotoboothSettingInfolist
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
//
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\PhotoboothSettings\Tables;
|
||||
|
||||
use Filament\Tables;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class PhotoboothSettingsTable
|
||||
{
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
Tables\Columns\TextColumn::make('ftp_port')
|
||||
->label(__('Port'))
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('rate_limit_per_minute')
|
||||
->label(__('Uploads/Minute'))
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('expiry_grace_days')
|
||||
->label(__('Ablauf +Tage'))
|
||||
->sortable(),
|
||||
Tables\Columns\IconColumn::make('require_ftps')
|
||||
->label(__('FTPS'))
|
||||
->boolean(),
|
||||
Tables\Columns\TextColumn::make('updated_at')
|
||||
->since()
|
||||
->label(__('Aktualisiert')),
|
||||
])
|
||||
->recordActions([
|
||||
Tables\Actions\EditAction::make(),
|
||||
])
|
||||
->headerActions([])
|
||||
->bulkActions([]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user