mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 05:56:16 +00:00
2.x
This commit is contained in:
42
app/Web/Pages/Servers/Sites/Index.php
Normal file
42
app/Web/Pages/Servers/Sites/Index.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Web\Pages\Servers\Sites;
|
||||
|
||||
use App\Models\Server;
|
||||
use App\Models\Site;
|
||||
use App\Web\Pages\Servers\Sites\Widgets\SitesList;
|
||||
use App\Web\Traits\PageHasServer;
|
||||
use App\Web\Traits\PageHasWidgets;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Pages\Page;
|
||||
|
||||
class Index extends Page
|
||||
{
|
||||
use PageHasServer;
|
||||
use PageHasWidgets;
|
||||
|
||||
protected static ?string $slug = 'servers/{server}/sites';
|
||||
|
||||
protected static bool $shouldRegisterNavigation = false;
|
||||
|
||||
protected static ?string $title = 'Sites';
|
||||
|
||||
public Server $server;
|
||||
|
||||
public function getWidgets(): array
|
||||
{
|
||||
return [
|
||||
[SitesList::class, ['server' => $this->server]],
|
||||
];
|
||||
}
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
CreateAction::make()
|
||||
->authorize(fn () => auth()->user()?->can('create', [Site::class, $this->server]))
|
||||
->createAnother(false)
|
||||
->label('Create a Site'),
|
||||
];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user