mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-03 15:02:34 +00:00
[2.x] [Filament] Update deprecated getFormSchema
method to use form()
override (#354)
This commit is contained in:
@ -25,8 +25,6 @@ protected function getTableQuery(): Builder
|
||||
return CronJob::query()->where('server_id', $this->server->id);
|
||||
}
|
||||
|
||||
protected static ?string $heading = '';
|
||||
|
||||
protected function getTableColumns(): array
|
||||
{
|
||||
return [
|
||||
@ -52,9 +50,12 @@ protected function getTableColumns(): array
|
||||
];
|
||||
}
|
||||
|
||||
public function getTable(): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $this->table
|
||||
return $table
|
||||
->heading(null)
|
||||
->query($this->getTableQuery())
|
||||
->columns($this->getTableColumns())
|
||||
->actions([
|
||||
Action::make('enable')
|
||||
->hiddenLabel()
|
||||
|
@ -26,8 +26,6 @@ protected function getTableQuery(): Builder
|
||||
return BackupFile::query()->where('backup_id', $this->backup->id);
|
||||
}
|
||||
|
||||
protected static ?string $heading = '';
|
||||
|
||||
protected function getTableColumns(): array
|
||||
{
|
||||
return [
|
||||
@ -54,9 +52,12 @@ protected function applyDefaultSortingToTableQuery(Builder $query): Builder
|
||||
return $query->latest('created_at');
|
||||
}
|
||||
|
||||
public function getTable(): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $this->table
|
||||
return $table
|
||||
->heading(null)
|
||||
->query($this->getTableQuery())
|
||||
->columns($this->getTableColumns())
|
||||
->actions([
|
||||
Action::make('restore')
|
||||
->hiddenLabel()
|
||||
|
@ -24,8 +24,6 @@ protected function getTableQuery(): Builder
|
||||
return Backup::query()->where('server_id', $this->server->id);
|
||||
}
|
||||
|
||||
protected static ?string $heading = '';
|
||||
|
||||
protected function getTableColumns(): array
|
||||
{
|
||||
return [
|
||||
@ -52,9 +50,12 @@ protected function getTableColumns(): array
|
||||
];
|
||||
}
|
||||
|
||||
public function getTable(): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $this->table
|
||||
return $table
|
||||
->heading(null)
|
||||
->query($this->getTableQuery())
|
||||
->columns($this->getTableColumns())
|
||||
->actions([
|
||||
Action::make('files')
|
||||
->hiddenLabel()
|
||||
|
@ -27,8 +27,6 @@ protected function getTableQuery(): Builder
|
||||
return DatabaseUser::query()->where('server_id', $this->server->id);
|
||||
}
|
||||
|
||||
protected static ?string $heading = '';
|
||||
|
||||
protected function getTableColumns(): array
|
||||
{
|
||||
return [
|
||||
@ -46,9 +44,12 @@ protected function getTableColumns(): array
|
||||
];
|
||||
}
|
||||
|
||||
public function getTable(): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $this->table
|
||||
return $table
|
||||
->heading(null)
|
||||
->query($this->getTableQuery())
|
||||
->columns($this->getTableColumns())
|
||||
->actions([
|
||||
$this->passwordAction(),
|
||||
$this->linkAction(),
|
||||
|
@ -22,8 +22,6 @@ protected function getTableQuery(): Builder
|
||||
return Database::query()->where('server_id', $this->server->id);
|
||||
}
|
||||
|
||||
protected static ?string $heading = '';
|
||||
|
||||
protected function getTableColumns(): array
|
||||
{
|
||||
return [
|
||||
@ -41,9 +39,12 @@ protected function getTableColumns(): array
|
||||
];
|
||||
}
|
||||
|
||||
public function getTable(): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $this->table
|
||||
return $table
|
||||
->heading(null)
|
||||
->query($this->getTableQuery())
|
||||
->columns($this->getTableColumns())
|
||||
->actions([
|
||||
Action::make('delete')
|
||||
->hiddenLabel()
|
||||
|
@ -23,8 +23,6 @@ protected function getTableQuery(): Builder
|
||||
return FirewallRule::query()->where('server_id', $this->server->id);
|
||||
}
|
||||
|
||||
protected static ?string $heading = '';
|
||||
|
||||
protected function getTableColumns(): array
|
||||
{
|
||||
return [
|
||||
@ -44,9 +42,12 @@ protected function getTableColumns(): array
|
||||
];
|
||||
}
|
||||
|
||||
public function getTable(): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $this->table
|
||||
return $table
|
||||
->heading(null)
|
||||
->query($this->getTableQuery())
|
||||
->columns($this->getTableColumns())
|
||||
->actions([
|
||||
Action::make('delete')
|
||||
->icon('heroicon-o-trash')
|
||||
|
@ -23,8 +23,6 @@ class LogsList extends Widget
|
||||
|
||||
public ?Site $site = null;
|
||||
|
||||
public ?string $label = '';
|
||||
|
||||
public bool $remote = false;
|
||||
|
||||
protected $listeners = ['$refresh'];
|
||||
@ -63,9 +61,12 @@ protected function applyDefaultSortingToTableQuery(Builder $query): Builder
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getTable(): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $this->table
|
||||
return $table
|
||||
->heading(null)
|
||||
->query($this->getTableQuery())
|
||||
->columns($this->getTableColumns())
|
||||
->filters([
|
||||
Filter::make('created_at')
|
||||
->form([
|
||||
@ -84,7 +85,6 @@ public function getTable(): Table
|
||||
);
|
||||
}),
|
||||
])
|
||||
->heading($this->label)
|
||||
->actions([
|
||||
Action::make('view')
|
||||
->hiddenLabel()
|
||||
|
@ -35,8 +35,6 @@ protected function getTableQuery(): Builder
|
||||
return Service::query()->where('type', 'php')->where('server_id', $this->server->id);
|
||||
}
|
||||
|
||||
protected static ?string $heading = '';
|
||||
|
||||
protected function getTableColumns(): array
|
||||
{
|
||||
return [
|
||||
@ -62,9 +60,12 @@ protected function getTableColumns(): array
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getTable(): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $this->table
|
||||
return $table
|
||||
->heading(null)
|
||||
->query($this->getTableQuery())
|
||||
->columns($this->getTableColumns())
|
||||
->actions([
|
||||
ActionGroup::make([
|
||||
$this->installExtensionAction(),
|
||||
|
@ -28,8 +28,6 @@ protected function getTableQuery(): Builder
|
||||
);
|
||||
}
|
||||
|
||||
protected static ?string $heading = '';
|
||||
|
||||
protected function getTableColumns(): array
|
||||
{
|
||||
return [
|
||||
@ -44,9 +42,12 @@ protected function getTableColumns(): array
|
||||
];
|
||||
}
|
||||
|
||||
public function getTable(): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $this->table
|
||||
return $table
|
||||
->heading(null)
|
||||
->query($this->getTableQuery())
|
||||
->columns($this->getTableColumns())
|
||||
->actions([
|
||||
DeleteAction::make('delete')
|
||||
->hiddenLabel()
|
||||
|
@ -28,8 +28,6 @@ protected function getTableQuery(): Builder
|
||||
return Service::query()->where('server_id', $this->server->id);
|
||||
}
|
||||
|
||||
protected static ?string $heading = 'Installed Services';
|
||||
|
||||
protected function getTableColumns(): array
|
||||
{
|
||||
return [
|
||||
@ -56,9 +54,12 @@ protected function getTableColumns(): array
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getTable(): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $this->table
|
||||
return $table
|
||||
->heading('Installed Services')
|
||||
->query($this->getTableQuery())
|
||||
->columns($this->getTableColumns())
|
||||
->actions([
|
||||
ActionGroup::make([
|
||||
$this->serviceAction('start', 'heroicon-o-play'),
|
||||
|
@ -34,8 +34,6 @@ protected function getTableQuery(): Builder
|
||||
return Queue::query()->where('site_id', $this->site->id);
|
||||
}
|
||||
|
||||
protected static ?string $heading = '';
|
||||
|
||||
protected function getTableColumns(): array
|
||||
{
|
||||
return [
|
||||
@ -57,9 +55,12 @@ protected function getTableColumns(): array
|
||||
];
|
||||
}
|
||||
|
||||
public function getTable(): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $this->table
|
||||
return $table
|
||||
->heading(null)
|
||||
->query($this->getTableQuery())
|
||||
->columns($this->getTableColumns())
|
||||
->actions([
|
||||
ActionGroup::make([
|
||||
$this->editAction(),
|
||||
|
@ -24,8 +24,6 @@ protected function getTableQuery(): Builder
|
||||
return Ssl::query()->where('site_id', $this->site->id);
|
||||
}
|
||||
|
||||
protected static ?string $heading = '';
|
||||
|
||||
protected function getTableColumns(): array
|
||||
{
|
||||
return [
|
||||
@ -47,9 +45,12 @@ protected function getTableColumns(): array
|
||||
];
|
||||
}
|
||||
|
||||
public function getTable(): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $this->table
|
||||
return $table
|
||||
->heading(null)
|
||||
->query($this->getTableQuery())
|
||||
->columns($this->getTableColumns())
|
||||
->actions([
|
||||
Action::make('logs')
|
||||
->hiddenLabel()
|
||||
|
@ -22,8 +22,6 @@ protected function getTableQuery(): Builder
|
||||
return Site::query()->where('server_id', $this->server->id);
|
||||
}
|
||||
|
||||
protected static ?string $heading = '';
|
||||
|
||||
protected function getTableColumns(): array
|
||||
{
|
||||
return [
|
||||
@ -54,9 +52,12 @@ protected function getTableColumns(): array
|
||||
];
|
||||
}
|
||||
|
||||
public function getTable(): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $this->table
|
||||
return $table
|
||||
->heading(null)
|
||||
->query($this->getTableQuery())
|
||||
->columns($this->getTableColumns())
|
||||
->recordUrl(fn (Site $record) => View::getUrl(parameters: ['server' => $this->server, 'site' => $record]))
|
||||
->actions([
|
||||
Action::make('settings')
|
||||
|
@ -19,8 +19,6 @@ protected function getTableQuery(): Builder
|
||||
return Server::query()->where('project_id', auth()->user()->current_project_id);
|
||||
}
|
||||
|
||||
protected static ?string $heading = '';
|
||||
|
||||
protected function getTableColumns(): array
|
||||
{
|
||||
return [
|
||||
@ -53,9 +51,12 @@ protected function getTableColumns(): array
|
||||
];
|
||||
}
|
||||
|
||||
public function getTable(): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $this->table
|
||||
return $table
|
||||
->heading(null)
|
||||
->query($this->getTableQuery())
|
||||
->columns($this->getTableColumns())
|
||||
->recordUrl(fn (Server $record) => View::getUrl(parameters: ['server' => $record]))
|
||||
->actions([
|
||||
Action::make('settings')
|
||||
|
Reference in New Issue
Block a user