Update synchronize actions in main index pages, hide for busy servers/sites to prevent exceptions
This commit is contained in:
@@ -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(),
|
||||
|
||||
@@ -47,6 +47,7 @@ class SiteResource extends Resource
|
||||
return "PHP $record->php_version";
|
||||
})
|
||||
->label(__('Name'))
|
||||
->sortable()
|
||||
->searchable(),
|
||||
Tables\Columns\TextColumn::make('server.name')
|
||||
->label(__('Server')),
|
||||
@@ -86,8 +87,9 @@ class SiteResource extends Resource
|
||||
->tooltip(__('This will synchronize the latest data from this provider to your Ploi Core installation'))
|
||||
->icon('heroicon-o-refresh')
|
||||
->action(function (Site $record) {
|
||||
app(SynchronizeSiteAction::class)->execute($record->ploi_id);
|
||||
}),
|
||||
app(SynchronizeSiteAction::class)->execute($record->server->ploi_id, $record->ploi_id);
|
||||
})
|
||||
->visible(fn (Site $record) => $record->status === Site::STATUS_ACTIVE),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
|
||||
Reference in New Issue
Block a user