Update synchronize actions in main index pages, hide for busy servers/sites to prevent exceptions

This commit is contained in:
Ralph J. Smit
2022-08-08 17:31:18 +02:00
parent 06aecba93d
commit 96587db6a2
2 changed files with 6 additions and 3 deletions

View File

@@ -89,7 +89,8 @@ class ServerResource extends Resource
->label(__('Synchronize'))
->tooltip(__('This will synchronize the latest data from this provider to your Ploi Core installation'))
->icon('heroicon-o-refresh')
->action(fn (Server $record) => app(SynchronizeServerAction::class)->execute($record->ploi_id)),
->action(fn (Server $record) => app(SynchronizeServerAction::class)->execute($record->ploi_id))
->visible(fn (Server $record) => $record->status === Server::STATUS_ACTIVE),
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),