mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-03 06:56:15 +00:00
2.x
This commit is contained in:
51
app/Web/Pages/Settings/ServerProviders/Index.php
Normal file
51
app/Web/Pages/Settings/ServerProviders/Index.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Web\Pages\Settings\ServerProviders;
|
||||
|
||||
use App\Enums\ServerProvider;
|
||||
use App\Web\Traits\PageHasWidgets;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Pages\Page;
|
||||
use Filament\Support\Enums\MaxWidth;
|
||||
|
||||
class Index extends Page
|
||||
{
|
||||
use PageHasWidgets;
|
||||
|
||||
protected static ?string $navigationGroup = 'Settings';
|
||||
|
||||
protected static ?string $slug = 'settings/server-providers';
|
||||
|
||||
protected static ?string $title = 'Server Providers';
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-server-stack';
|
||||
|
||||
protected static ?int $navigationSort = 5;
|
||||
|
||||
public static function canAccess(): bool
|
||||
{
|
||||
return auth()->user()?->can('viewAny', ServerProvider::class) ?? false;
|
||||
}
|
||||
|
||||
public function getWidgets(): array
|
||||
{
|
||||
return [
|
||||
[Widgets\ServerProvidersList::class],
|
||||
];
|
||||
}
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
CreateAction::make()
|
||||
->label('Connect')
|
||||
->modalHeading('Connect to a Server Provider')
|
||||
->modalSubmitActionLabel('Connect')
|
||||
->createAnother(false)
|
||||
->form(Actions\Create::form())
|
||||
->authorize('create', ServerProvider::class)
|
||||
->modalWidth(MaxWidth::Medium)
|
||||
->using(fn (array $data) => Actions\Create::action($data)),
|
||||
];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user