mirror of
https://github.com/pelican-dev/panel.git
synced 2025-07-08 20:11:08 +02:00
wip
This commit is contained in:
parent
c1f50d5d7f
commit
31206e15fa
@ -17,6 +17,8 @@ class Health extends Page
|
|||||||
|
|
||||||
protected string $view = 'filament.pages.health';
|
protected string $view = 'filament.pages.health';
|
||||||
|
|
||||||
|
protected array $extraAttributes = [];
|
||||||
|
|
||||||
/** @var array<string, string> */
|
/** @var array<string, string> */
|
||||||
protected $listeners = [
|
protected $listeners = [
|
||||||
'refresh-component' => '$refresh',
|
'refresh-component' => '$refresh',
|
||||||
|
@ -379,6 +379,7 @@ class Settings extends Page implements HasSchemas
|
|||||||
Section::make(trans('admin/setting.mail.from_settings'))
|
Section::make(trans('admin/setting.mail.from_settings'))
|
||||||
->description(trans('admin/setting.mail.from_settings_help'))
|
->description(trans('admin/setting.mail.from_settings_help'))
|
||||||
->columns()
|
->columns()
|
||||||
|
->columnSpanFull()
|
||||||
->schema([
|
->schema([
|
||||||
TextInput::make('MAIL_FROM_ADDRESS')
|
TextInput::make('MAIL_FROM_ADDRESS')
|
||||||
->label(trans('admin/setting.mail.from_address'))
|
->label(trans('admin/setting.mail.from_address'))
|
||||||
@ -392,6 +393,7 @@ class Settings extends Page implements HasSchemas
|
|||||||
]),
|
]),
|
||||||
Section::make(trans('admin/setting.mail.smtp.smtp_title'))
|
Section::make(trans('admin/setting.mail.smtp.smtp_title'))
|
||||||
->columns()
|
->columns()
|
||||||
|
->columnSpanFull()
|
||||||
->visible(fn (Get $get) => $get('MAIL_MAILER') === 'smtp')
|
->visible(fn (Get $get) => $get('MAIL_MAILER') === 'smtp')
|
||||||
->schema([
|
->schema([
|
||||||
TextInput::make('MAIL_HOST')
|
TextInput::make('MAIL_HOST')
|
||||||
@ -428,6 +430,7 @@ class Settings extends Page implements HasSchemas
|
|||||||
]),
|
]),
|
||||||
Section::make(trans('admin/setting.mail.mailgun.mailgun_title'))
|
Section::make(trans('admin/setting.mail.mailgun.mailgun_title'))
|
||||||
->columns()
|
->columns()
|
||||||
|
->columnSpanFull()
|
||||||
->visible(fn (Get $get) => $get('MAIL_MAILER') === 'mailgun')
|
->visible(fn (Get $get) => $get('MAIL_MAILER') === 'mailgun')
|
||||||
->schema([
|
->schema([
|
||||||
TextInput::make('MAILGUN_DOMAIN')
|
TextInput::make('MAILGUN_DOMAIN')
|
||||||
@ -467,6 +470,7 @@ class Settings extends Page implements HasSchemas
|
|||||||
Section::make(trans('admin/setting.backup.throttle'))
|
Section::make(trans('admin/setting.backup.throttle'))
|
||||||
->description(trans('admin/setting.backup.throttle_help'))
|
->description(trans('admin/setting.backup.throttle_help'))
|
||||||
->columns()
|
->columns()
|
||||||
|
->columnSpanFull()
|
||||||
->schema([
|
->schema([
|
||||||
TextInput::make('BACKUP_THROTTLE_LIMIT')
|
TextInput::make('BACKUP_THROTTLE_LIMIT')
|
||||||
->label(trans('admin/setting.backup.limit'))
|
->label(trans('admin/setting.backup.limit'))
|
||||||
|
@ -17,7 +17,6 @@ use Filament\Infolists\Components\TextEntry;
|
|||||||
use Filament\Resources\Resource;
|
use Filament\Resources\Resource;
|
||||||
use Filament\Schemas\Components\Component;
|
use Filament\Schemas\Components\Component;
|
||||||
use Filament\Schemas\Components\Fieldset;
|
use Filament\Schemas\Components\Fieldset;
|
||||||
use Filament\Schemas\Components\Form;
|
|
||||||
use Filament\Schemas\Components\Section;
|
use Filament\Schemas\Components\Section;
|
||||||
use Filament\Schemas\Components\Utilities\Get;
|
use Filament\Schemas\Components\Utilities\Get;
|
||||||
use Filament\Tables\Columns\TextColumn;
|
use Filament\Tables\Columns\TextColumn;
|
||||||
@ -64,8 +63,7 @@ class RoleResource extends Resource
|
|||||||
->columns([
|
->columns([
|
||||||
TextColumn::make('name')
|
TextColumn::make('name')
|
||||||
->label(trans('admin/role.name'))
|
->label(trans('admin/role.name'))
|
||||||
->sortable()
|
->sortable(),
|
||||||
->searchable(),
|
|
||||||
TextColumn::make('permissions_count')
|
TextColumn::make('permissions_count')
|
||||||
->label(trans('admin/role.permissions'))
|
->label(trans('admin/role.permissions'))
|
||||||
->badge()
|
->badge()
|
||||||
@ -96,7 +94,7 @@ class RoleResource extends Resource
|
|||||||
/**
|
/**
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public static function form(Form|Schema $schema): Schema
|
public static function form(Schema $schema): Schema
|
||||||
{
|
{
|
||||||
$permissionSections = [];
|
$permissionSections = [];
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@ use App\Models\User;
|
|||||||
use Filament\Facades\Filament;
|
use Filament\Facades\Filament;
|
||||||
use Filament\Forms\Components\CheckboxList;
|
use Filament\Forms\Components\CheckboxList;
|
||||||
use Filament\Forms\Components\TextInput;
|
use Filament\Forms\Components\TextInput;
|
||||||
use Filament\Schemas\Components\Form;
|
|
||||||
use Filament\Resources\Resource;
|
use Filament\Resources\Resource;
|
||||||
use Filament\Actions\DeleteBulkAction;
|
use Filament\Actions\DeleteBulkAction;
|
||||||
use Filament\Actions\EditAction;
|
use Filament\Actions\EditAction;
|
||||||
@ -65,10 +64,12 @@ class UserResource extends Resource
|
|||||||
->alignCenter()
|
->alignCenter()
|
||||||
->defaultImageUrl(fn (User $user) => Filament::getUserAvatarUrl($user)),
|
->defaultImageUrl(fn (User $user) => Filament::getUserAvatarUrl($user)),
|
||||||
TextColumn::make('username')
|
TextColumn::make('username')
|
||||||
->label(trans('admin/user.username')),
|
->label(trans('admin/user.username'))
|
||||||
|
->searchable(),
|
||||||
TextColumn::make('email')
|
TextColumn::make('email')
|
||||||
->label(trans('admin/user.email'))
|
->label(trans('admin/user.email'))
|
||||||
->icon('tabler-mail'),
|
->icon('tabler-mail')
|
||||||
|
->searchable(),
|
||||||
IconColumn::make('use_totp')
|
IconColumn::make('use_totp')
|
||||||
->label('2FA')
|
->label('2FA')
|
||||||
->visibleFrom('lg')
|
->visibleFrom('lg')
|
||||||
@ -100,7 +101,7 @@ class UserResource extends Resource
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function form(Form|Schema $schema): Schema
|
public static function form(Schema $schema): Schema
|
||||||
{
|
{
|
||||||
return $schema
|
return $schema
|
||||||
->columns(['default' => 1, 'lg' => 3])
|
->columns(['default' => 1, 'lg' => 3])
|
||||||
|
@ -39,10 +39,10 @@ abstract class ServerFormPage extends Page
|
|||||||
/**
|
/**
|
||||||
* @return array<int | string, string | Form>
|
* @return array<int | string, string | Form>
|
||||||
*/
|
*/
|
||||||
protected function getForms(): array
|
protected function getFormSchema(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'form' => $this->form($this->makeForm()
|
'schema' => $this->form($this->makeSchema()
|
||||||
->model($this->getRecord())
|
->model($this->getRecord())
|
||||||
->statePath($this->getFormStatePath())
|
->statePath($this->getFormStatePath())
|
||||||
->columns($this->hasInlineLabels() ? 1 : 2)
|
->columns($this->hasInlineLabels() ? 1 : 2)
|
||||||
|
@ -14,7 +14,6 @@ use Filament\Infolists\Components\TextEntry;
|
|||||||
use Filament\Schemas\Components\Section;
|
use Filament\Schemas\Components\Section;
|
||||||
use Filament\Forms\Components\Textarea;
|
use Filament\Forms\Components\Textarea;
|
||||||
use Filament\Forms\Components\TextInput;
|
use Filament\Forms\Components\TextInput;
|
||||||
use Filament\Schemas\Components\Form;
|
|
||||||
use Filament\Notifications\Notification;
|
use Filament\Notifications\Notification;
|
||||||
use Filament\Schemas\Schema;
|
use Filament\Schemas\Schema;
|
||||||
use Filament\Support\Enums\Alignment;
|
use Filament\Support\Enums\Alignment;
|
||||||
@ -26,7 +25,10 @@ class Settings extends ServerFormPage
|
|||||||
|
|
||||||
protected static ?int $navigationSort = 10;
|
protected static ?int $navigationSort = 10;
|
||||||
|
|
||||||
public function form(Form|Schema $schema): Schema
|
/**
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public function form(Schema $schema): Schema
|
||||||
{
|
{
|
||||||
/** @var Server $server */
|
/** @var Server $server */
|
||||||
$server = Filament::getTenant();
|
$server = Filament::getTenant();
|
||||||
@ -49,6 +51,7 @@ class Settings extends ServerFormPage
|
|||||||
->schema([
|
->schema([
|
||||||
Fieldset::make('Server')
|
Fieldset::make('Server')
|
||||||
->label('Information')
|
->label('Information')
|
||||||
|
->columnSpanFull()
|
||||||
->schema([
|
->schema([
|
||||||
TextInput::make('name')
|
TextInput::make('name')
|
||||||
->label('Server Name')
|
->label('Server Name')
|
||||||
@ -91,6 +94,7 @@ class Settings extends ServerFormPage
|
|||||||
]),
|
]),
|
||||||
Fieldset::make('Limits')
|
Fieldset::make('Limits')
|
||||||
->label('Limits')
|
->label('Limits')
|
||||||
|
->columnSpanFull()
|
||||||
->columns([
|
->columns([
|
||||||
'default' => 1,
|
'default' => 1,
|
||||||
'sm' => 1,
|
'sm' => 1,
|
||||||
@ -149,6 +153,7 @@ class Settings extends ServerFormPage
|
|||||||
->formatStateUsing(fn (Server $server) => $server->node->name)
|
->formatStateUsing(fn (Server $server) => $server->node->name)
|
||||||
->disabled(),
|
->disabled(),
|
||||||
Fieldset::make('SFTP Information')
|
Fieldset::make('SFTP Information')
|
||||||
|
->columnSpanFull()
|
||||||
->hidden(fn () => !auth()->user()->can(Permission::ACTION_FILE_SFTP, $server))
|
->hidden(fn () => !auth()->user()->can(Permission::ACTION_FILE_SFTP, $server))
|
||||||
->label('SFTP Information')
|
->label('SFTP Information')
|
||||||
->columns([
|
->columns([
|
||||||
@ -191,6 +196,7 @@ class Settings extends ServerFormPage
|
|||||||
]),
|
]),
|
||||||
]),
|
]),
|
||||||
Section::make('Reinstall Server')
|
Section::make('Reinstall Server')
|
||||||
|
->columnSpanFull()
|
||||||
->hidden(fn () => !auth()->user()->can(Permission::ACTION_SETTINGS_REINSTALL, $server))
|
->hidden(fn () => !auth()->user()->can(Permission::ACTION_SETTINGS_REINSTALL, $server))
|
||||||
->collapsible()
|
->collapsible()
|
||||||
->footerActions([
|
->footerActions([
|
||||||
|
@ -27,7 +27,7 @@ class AppPanelProvider extends PanelProvider
|
|||||||
{
|
{
|
||||||
return $panel
|
return $panel
|
||||||
->id('app')
|
->id('app')
|
||||||
->spa()
|
//->spa()
|
||||||
->databaseNotifications()
|
->databaseNotifications()
|
||||||
->breadcrumbs(false)
|
->breadcrumbs(false)
|
||||||
->brandName(config('app.name', 'Pelican'))
|
->brandName(config('app.name', 'Pelican'))
|
||||||
|
@ -34,7 +34,7 @@ class ServerPanelProvider extends PanelProvider
|
|||||||
->id('server')
|
->id('server')
|
||||||
->path('server')
|
->path('server')
|
||||||
->homeUrl('/')
|
->homeUrl('/')
|
||||||
->spa()
|
//->spa()
|
||||||
->databaseNotifications()
|
->databaseNotifications()
|
||||||
->tenant(Server::class)
|
->tenant(Server::class)
|
||||||
->brandName(config('app.name', 'Pelican'))
|
->brandName(config('app.name', 'Pelican'))
|
||||||
|
@ -1,10 +1,13 @@
|
|||||||
@php
|
|
||||||
use Illuminate\View\ComponentAttributeBag;
|
|
||||||
@endphp
|
|
||||||
|
|
||||||
<x-filament-panels::page>
|
<x-filament-panels::page>
|
||||||
|
@php
|
||||||
|
$getId = fn () => 'health-results-grid';
|
||||||
|
@endphp
|
||||||
@if (count($checkResults?->storedCheckResults ?? []))
|
@if (count($checkResults?->storedCheckResults ?? []))
|
||||||
<div {{ $getExtraAttributeBag()->when(! $isInline, fn (ComponentAttributeBag $attributes) => $attributes->grid($getColumns(), $gridDirection)) }}>
|
|
||||||
|
<x-filament-schemas::grid
|
||||||
|
:getId="$getId"
|
||||||
|
:
|
||||||
|
>
|
||||||
@foreach ($checkResults->storedCheckResults as $result)
|
@foreach ($checkResults->storedCheckResults as $result)
|
||||||
<div
|
<div
|
||||||
class="flex items-start px-4 py-5 space-x-2 md:space-x-3 overflow-hidden shadow-lg rounded-xl bg-white dark:bg-gray-900 ring-1 ring-gray-950/5 dark:ring-white/10 sm:p-6">
|
class="flex items-start px-4 py-5 space-x-2 md:space-x-3 overflow-hidden shadow-lg rounded-xl bg-white dark:bg-gray-900 ring-1 ring-gray-950/5 dark:ring-white/10 sm:p-6">
|
||||||
@ -27,7 +30,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
</div>
|
</x-filament-schemas::grid>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@if ($lastRanAt)
|
@if ($lastRanAt)
|
||||||
|
@ -2,12 +2,9 @@
|
|||||||
@class([
|
@class([
|
||||||
'fi-page-settings'
|
'fi-page-settings'
|
||||||
])
|
])
|
||||||
|
id="form"
|
||||||
|
:wire:key="$this->getId() . '.forms.' . $this->getFormStatePath()"
|
||||||
|
wire:submit="save"
|
||||||
>
|
>
|
||||||
<x-filament-panels::form
|
{{ $this->form }}
|
||||||
id="form"
|
|
||||||
:wire:key="$this->getId() . '.forms.' . $this->getFormStatePath()"
|
|
||||||
wire:submit="save"
|
|
||||||
>
|
|
||||||
{{ $this->form }}
|
|
||||||
</x-filament-panels::form>
|
|
||||||
</x-filament-panels::page>
|
</x-filament-panels::page>
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
<x-filament-panels::page>
|
<x-filament-panels::page
|
||||||
<x-filament-panels::form
|
id="form"
|
||||||
id="form"
|
:wire:key="$this->getId() . '.forms.' . $this->getFormStatePath()"
|
||||||
:wire:key="$this->getId() . '.forms.' . $this->getFormStatePath()"
|
wire:submit="save">
|
||||||
wire:submit="save"
|
{{ $this->form }}
|
||||||
>
|
|
||||||
{{ $this->form }}
|
|
||||||
</x-filament-panels::form>
|
|
||||||
</x-filament-panels::page>
|
</x-filament-panels::page>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user