mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 19:14:45 +02:00
wip
This commit is contained in:
parent
d84f873693
commit
e73f78f2f7
@ -46,7 +46,6 @@ use Filament\Forms\Components\Textarea;
|
|||||||
use Filament\Forms\Components\TextInput;
|
use Filament\Forms\Components\TextInput;
|
||||||
use Filament\Forms\Components\Toggle;
|
use Filament\Forms\Components\Toggle;
|
||||||
use Filament\Forms\Components\ToggleButtons;
|
use Filament\Forms\Components\ToggleButtons;
|
||||||
use Filament\Schemas\Components\Form;
|
|
||||||
use Filament\Schemas\Components\Utilities\Get;
|
use Filament\Schemas\Components\Utilities\Get;
|
||||||
use Filament\Schemas\Components\Utilities\Set;
|
use Filament\Schemas\Components\Utilities\Set;
|
||||||
use Filament\Notifications\Notification;
|
use Filament\Notifications\Notification;
|
||||||
@ -58,6 +57,7 @@ use Illuminate\Support\Facades\Validator;
|
|||||||
use Illuminate\Support\HtmlString;
|
use Illuminate\Support\HtmlString;
|
||||||
use LogicException;
|
use LogicException;
|
||||||
use Filament\Schemas\Schema;
|
use Filament\Schemas\Schema;
|
||||||
|
use Random\RandomException;
|
||||||
|
|
||||||
class EditServer extends EditRecord
|
class EditServer extends EditRecord
|
||||||
{
|
{
|
||||||
@ -70,7 +70,10 @@ class EditServer extends EditRecord
|
|||||||
$this->daemonServerRepository = $daemonServerRepository;
|
$this->daemonServerRepository = $daemonServerRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function form(Form|Schema $schema): Schema
|
/**
|
||||||
|
* @throws RandomException
|
||||||
|
*/
|
||||||
|
public function form(Schema $schema): Schema
|
||||||
{
|
{
|
||||||
return $schema
|
return $schema
|
||||||
->schema([
|
->schema([
|
||||||
@ -108,7 +111,6 @@ class EditServer extends EditRecord
|
|||||||
])
|
])
|
||||||
->required()
|
->required()
|
||||||
->maxLength(255),
|
->maxLength(255),
|
||||||
|
|
||||||
Select::make('owner_id')
|
Select::make('owner_id')
|
||||||
->prefixIcon('tabler-user')
|
->prefixIcon('tabler-user')
|
||||||
->label(trans('admin/server.owner'))
|
->label(trans('admin/server.owner'))
|
||||||
@ -188,6 +190,7 @@ class EditServer extends EditRecord
|
|||||||
->icon('tabler-brand-docker')
|
->icon('tabler-brand-docker')
|
||||||
->schema([
|
->schema([
|
||||||
Fieldset::make(trans('admin/server.resource_limits'))
|
Fieldset::make(trans('admin/server.resource_limits'))
|
||||||
|
->columnSpanFull()
|
||||||
->columns([
|
->columns([
|
||||||
'default' => 1,
|
'default' => 1,
|
||||||
'sm' => 2,
|
'sm' => 2,
|
||||||
@ -291,6 +294,7 @@ class EditServer extends EditRecord
|
|||||||
]),
|
]),
|
||||||
|
|
||||||
Fieldset::make(trans('admin/server.advanced_limits'))
|
Fieldset::make(trans('admin/server.advanced_limits'))
|
||||||
|
->columnSpanFull()
|
||||||
->columns([
|
->columns([
|
||||||
'default' => 1,
|
'default' => 1,
|
||||||
'sm' => 2,
|
'sm' => 2,
|
||||||
@ -403,6 +407,7 @@ class EditServer extends EditRecord
|
|||||||
|
|
||||||
Fieldset::make(trans('admin/server.feature_limits'))
|
Fieldset::make(trans('admin/server.feature_limits'))
|
||||||
->inlineLabel()
|
->inlineLabel()
|
||||||
|
->columnSpanFull()
|
||||||
->columns([
|
->columns([
|
||||||
'default' => 1,
|
'default' => 1,
|
||||||
'sm' => 2,
|
'sm' => 2,
|
||||||
@ -430,6 +435,7 @@ class EditServer extends EditRecord
|
|||||||
->numeric(),
|
->numeric(),
|
||||||
]),
|
]),
|
||||||
Fieldset::make(trans('admin/server.docker_settings'))
|
Fieldset::make(trans('admin/server.docker_settings'))
|
||||||
|
->columnSpanFull()
|
||||||
->columns([
|
->columns([
|
||||||
'default' => 1,
|
'default' => 1,
|
||||||
'sm' => 2,
|
'sm' => 2,
|
||||||
@ -683,7 +689,7 @@ class EditServer extends EditRecord
|
|||||||
->hintAction(
|
->hintAction(
|
||||||
Action::make('Delete')
|
Action::make('Delete')
|
||||||
->label(trans('filament-actions::delete.single.modal.actions.delete.label'))
|
->label(trans('filament-actions::delete.single.modal.actions.delete.label'))
|
||||||
->authorize(fn (Database $database) => auth()->user()->can('delete database', $database))
|
//->authorize(fn (Database $database) => auth()->user()->can('delete database', $database))
|
||||||
->color('danger')
|
->color('danger')
|
||||||
->icon('tabler-trash')
|
->icon('tabler-trash')
|
||||||
->requiresConfirmation()
|
->requiresConfirmation()
|
||||||
@ -708,7 +714,7 @@ class EditServer extends EditRecord
|
|||||||
->password()
|
->password()
|
||||||
->revealable()
|
->revealable()
|
||||||
->columnSpan(1)
|
->columnSpan(1)
|
||||||
->hintAction(RotateDatabasePasswordAction::make())
|
//->hintAction(RotateDatabasePasswordAction::make())
|
||||||
//TODO ->suffixAction(fn (string $state) => request()->isSecure() ? CopyAction::make()->copyable($state) : null)
|
//TODO ->suffixAction(fn (string $state) => request()->isSecure() ? CopyAction::make()->copyable($state) : null)
|
||||||
->formatStateUsing(fn (Database $database) => $database->password),
|
->formatStateUsing(fn (Database $database) => $database->password),
|
||||||
TextInput::make('remote')
|
TextInput::make('remote')
|
||||||
@ -792,6 +798,7 @@ class EditServer extends EditRecord
|
|||||||
->icon('tabler-settings')
|
->icon('tabler-settings')
|
||||||
->schema([
|
->schema([
|
||||||
Fieldset::make(trans('admin/server.actions'))
|
Fieldset::make(trans('admin/server.actions'))
|
||||||
|
->columnSpanFull()
|
||||||
->columns([
|
->columns([
|
||||||
'default' => 1,
|
'default' => 1,
|
||||||
'sm' => 2,
|
'sm' => 2,
|
||||||
|
@ -30,7 +30,7 @@ class AdminPanelProvider extends PanelProvider
|
|||||||
->id('admin')
|
->id('admin')
|
||||||
->path('admin')
|
->path('admin')
|
||||||
->homeUrl('/')
|
->homeUrl('/')
|
||||||
->spa()
|
//->spa()
|
||||||
->databaseNotifications()
|
->databaseNotifications()
|
||||||
->breadcrumbs(false)
|
->breadcrumbs(false)
|
||||||
->brandName(config('app.name', 'Pelican'))
|
->brandName(config('app.name', 'Pelican'))
|
||||||
|
22
composer.lock
generated
22
composer.lock
generated
@ -936,16 +936,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "aws/aws-sdk-php",
|
"name": "aws/aws-sdk-php",
|
||||||
"version": "3.342.33",
|
"version": "3.342.35",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/aws/aws-sdk-php.git",
|
"url": "https://github.com/aws/aws-sdk-php.git",
|
||||||
"reference": "ddd3747bd08f04159aec5d102a60c7d29906ee0b"
|
"reference": "3fdb88961cf80775dbaf48a5641c9790d63d1d66"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/ddd3747bd08f04159aec5d102a60c7d29906ee0b",
|
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/3fdb88961cf80775dbaf48a5641c9790d63d1d66",
|
||||||
"reference": "ddd3747bd08f04159aec5d102a60c7d29906ee0b",
|
"reference": "3fdb88961cf80775dbaf48a5641c9790d63d1d66",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -1027,9 +1027,9 @@
|
|||||||
"support": {
|
"support": {
|
||||||
"forum": "https://github.com/aws/aws-sdk-php/discussions",
|
"forum": "https://github.com/aws/aws-sdk-php/discussions",
|
||||||
"issues": "https://github.com/aws/aws-sdk-php/issues",
|
"issues": "https://github.com/aws/aws-sdk-php/issues",
|
||||||
"source": "https://github.com/aws/aws-sdk-php/tree/3.342.33"
|
"source": "https://github.com/aws/aws-sdk-php/tree/3.342.35"
|
||||||
},
|
},
|
||||||
"time": "2025-04-23T18:07:32+00:00"
|
"time": "2025-04-25T18:09:39+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "blade-ui-kit/blade-heroicons",
|
"name": "blade-ui-kit/blade-heroicons",
|
||||||
@ -14049,16 +14049,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpstan/phpstan",
|
"name": "phpstan/phpstan",
|
||||||
"version": "2.1.12",
|
"version": "2.1.13",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/phpstan/phpstan.git",
|
"url": "https://github.com/phpstan/phpstan.git",
|
||||||
"reference": "96dde49e967c0c22812bcfa7bda4ff82c09f3b0c"
|
"reference": "e55e03e6d4ac49cd1240907e5b08e5cd378572a9"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/96dde49e967c0c22812bcfa7bda4ff82c09f3b0c",
|
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/e55e03e6d4ac49cd1240907e5b08e5cd378572a9",
|
||||||
"reference": "96dde49e967c0c22812bcfa7bda4ff82c09f3b0c",
|
"reference": "e55e03e6d4ac49cd1240907e5b08e5cd378572a9",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -14103,7 +14103,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2025-04-16T13:19:18+00:00"
|
"time": "2025-04-27T12:28:25+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpunit/php-code-coverage",
|
"name": "phpunit/php-code-coverage",
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
|
@php
|
||||||
|
use Illuminate\View\ComponentAttributeBag;
|
||||||
|
@endphp
|
||||||
|
|
||||||
<x-filament-panels::page>
|
<x-filament-panels::page>
|
||||||
@if (count($checkResults?->storedCheckResults ?? []))
|
@if (count($checkResults?->storedCheckResults ?? []))
|
||||||
<x-filament::grid default="1" sm="2" class="gap-6 mb-5">
|
<div {{ $getExtraAttributeBag()->when(! $isInline, fn (ComponentAttributeBag $attributes) => $attributes->grid($getColumns(), $gridDirection)) }}>
|
||||||
@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">
|
||||||
@ -23,7 +27,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
</x-filament::grid>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@if ($lastRanAt)
|
@if ($lastRanAt)
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
@php
|
@php
|
||||||
use Filament\Tables\Columns\IconColumn\IconColumnSize;
|
use Filament\Support\Enums\IconSize;
|
||||||
|
|
||||||
$node = $getRecord();
|
$node = $getRecord();
|
||||||
$size = $getSize($node) ?? IconColumnSize::Large;
|
$size = $getSize($node) ?? IconSize::Large;
|
||||||
|
|
||||||
$sizeClasses = match ($size) {
|
$sizeClasses = match ($size) {
|
||||||
IconColumnSize::ExtraSmall, 'xs' => 'fi-ta-icon-item-size-xs h-3 w-3',
|
IconSize::ExtraSmall, 'xs' => 'fi-ta-icon-item-size-xs h-3 w-3',
|
||||||
IconColumnSize::Small, 'sm' => 'fi-ta-icon-item-size-sm h-4 w-4',
|
IconSize::Small, 'sm' => 'fi-ta-icon-item-size-sm h-4 w-4',
|
||||||
IconColumnSize::Medium, 'md' => 'fi-ta-icon-item-size-md h-5 w-5',
|
IconSize::Medium, 'md' => 'fi-ta-icon-item-size-md h-5 w-5',
|
||||||
IconColumnSize::Large, 'lg' => 'fi-ta-icon-item-size-lg h-6 w-6',
|
IconSize::Large, 'lg' => 'fi-ta-icon-item-size-lg h-6 w-6',
|
||||||
IconColumnSize::ExtraLarge, 'xl' => 'fi-ta-icon-item-size-xl h-7 w-7',
|
IconSize::ExtraLarge, 'xl' => 'fi-ta-icon-item-size-xl h-7 w-7',
|
||||||
IconColumnSize::TwoExtraLarge, IconColumnSize::ExtraExtraLarge, '2xl' => 'fi-ta-icon-item-size-2xl h-8 w-8',
|
IconSize::TwoExtraLarge, '2xl' => 'fi-ta-icon-item-size-2xl h-8 w-8',
|
||||||
default => $size,
|
default => $size,
|
||||||
}
|
}
|
||||||
@endphp
|
@endphp
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
$animated = $exception ? '' : 'animate-pulse';
|
$animated = $exception ? '' : 'animate-pulse';
|
||||||
$condition = $exception ? 'danger' : 'success';
|
$condition = $exception ? 'danger' : 'success';
|
||||||
$class = ['fi-ta-icon-item', $sizeClasses, 'fi-color-custom text-custom-500 dark:text-custom-400', 'fi-color-'.$condition, $animated];
|
$class = ['fi-ta-icon-item', $sizeClasses, 'fi-color-custom text-custom-500 dark:text-custom-400', 'fi-color-'.$condition, $animated];
|
||||||
$style = [Filament\Support\get_color_css_variables($condition, shades: [400, 500], alias: 'tables::columns.icon-column.item')];
|
$style = Filament\Support\Colors\Color::generatePalette($condition)
|
||||||
@endphp
|
@endphp
|
||||||
<x-filament::icon
|
<x-filament::icon
|
||||||
x-tooltip="{
|
x-tooltip="{
|
||||||
@ -27,5 +27,5 @@
|
|||||||
</script>
|
</script>
|
||||||
@endscript
|
@endscript
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user